From 7798088addcbbbff559b74da118e03d97b3acd81 Mon Sep 17 00:00:00 2001 From: xuejiahao Date: Mon, 3 Nov 2025 13:52:55 +0800 Subject: [PATCH] apply license --- components.d.ts | 1 + package-lock.json | 70 +++--- package.json | 8 +- rsa_private.pem | 28 +++ rsa_public.pem | 9 + src/components/Config.vue | 4 + src/components/LicenseStatus.vue | 180 ++++++++++++++++ src/composables/useKintoneClient.ts | 13 ++ src/config.json | 19 ++ src/css/config.css | 12 +- src/css/license.css | 103 +++++++++ src/i18n/lang/en.ts | 36 ++++ src/i18n/lang/ja.ts | 36 ++++ src/js/desktop.ts | 30 +-- src/js/mobile.ts | 30 +-- src/manifest.json | 2 + src/plugins/kintoneClient.ts | 19 ++ src/services/license-service.ts | 319 ++++++++++++++++++++++++++++ src/types/index.d.ts | 1 + src/types/license.d.ts | 48 +++++ src/types/my-kintone.d.ts | 10 + src/utils/license-storage.ts | 147 +++++++++++++ src/utils/permissions.ts | 51 +++++ 23 files changed, 1117 insertions(+), 59 deletions(-) create mode 100644 rsa_private.pem create mode 100644 rsa_public.pem create mode 100644 src/components/LicenseStatus.vue create mode 100644 src/composables/useKintoneClient.ts create mode 100644 src/config.json create mode 100644 src/css/license.css create mode 100644 src/plugins/kintoneClient.ts create mode 100644 src/services/license-service.ts create mode 100644 src/types/license.d.ts create mode 100644 src/utils/license-storage.ts create mode 100644 src/utils/permissions.ts diff --git a/components.d.ts b/components.d.ts index 3b96285..d0ebd1b 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,6 +11,7 @@ declare module 'vue' { CellInput: typeof import('./src/components/basic/conditions/CellInput.vue')['default'] Config: typeof import('./src/components/Config.vue')['default'] ErrorDialog: typeof import('./src/components/basic/ErrorDialog.vue')['default'] + LicenseStatus: typeof import('./src/components/LicenseStatus.vue')['default'] PluginDropdown: typeof import('./src/components/basic/PluginDropdown.vue')['default'] PluginInput: typeof import('./src/components/basic/PluginInput.vue')['default'] PluginLabel: typeof import('./src/components/basic/PluginLabel.vue')['default'] diff --git a/package-lock.json b/package-lock.json index 955ff65..2b01363 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,9 @@ "version": "0.0.0", "dependencies": { "@kintone/rest-api-client": "^5.7.5", - "kintone-ui-component": "1.18.0", + "jsrsasign": "^11.1.0", + "jsrsasign-util": "^1.0.5", + "kintone-ui-component": "1.21.0", "rollup-plugin-css-only": "^4.5.2", "vue": "^3.5.13", "vue-i18n": "^11.0.1" @@ -19,6 +21,7 @@ "@kintone/dts-gen": "^8.1.1", "@kintone/plugin-packer": "^8.1.3", "@kintone/plugin-uploader": "^9.1.2", + "@types/jsrsasign": "^10.5.15", "@types/node-rsa": "^1.1.4", "@vitejs/plugin-vue": "^5.2.1", "@vue/tsconfig": "^0.7.0", @@ -2649,6 +2652,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/jsrsasign": { + "version": "10.5.15", + "resolved": "https://registry.npmmirror.com/@types/jsrsasign/-/jsrsasign-10.5.15.tgz", + "integrity": "sha512-3stUTaSRtN09PPzVWR6aySD9gNnuymz+WviNHoTb85dKu+BjaV4uBbWWGykBBJkfwPtcNZVfTn2lbX00U+yhpQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/minimatch": { "version": "5.1.2", "resolved": "https://registry.npmmirror.com/@types/minimatch/-/minimatch-5.1.2.tgz", @@ -3450,12 +3460,6 @@ } } }, - "node_modules/@webcomponents/webcomponentsjs": { - "version": "2.8.0", - "resolved": "https://registry.npmmirror.com/@webcomponents/webcomponentsjs/-/webcomponentsjs-2.8.0.tgz", - "integrity": "sha512-loGD63sacRzOzSJgQnB9ZAhaQGkN7wl2Zuw7tsphI5Isa0irijrRo6EnJii/GgjGefIFO8AIO7UivzRhFaEk9w==", - "license": "BSD-3-Clause" - }, "node_modules/acorn": { "version": "8.15.0", "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.15.0.tgz", @@ -7339,6 +7343,12 @@ "json5": "lib/cli.js" } }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "license": "MIT" + }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-4.0.0.tgz", @@ -7349,6 +7359,24 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsrsasign": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/jsrsasign/-/jsrsasign-11.1.0.tgz", + "integrity": "sha512-Ov74K9GihaK9/9WncTe1mPmvrO7Py665TUfUKvraXBpu+xcTWitrtuOwcjf4KMU9maPaYn0OuaWy0HOzy/GBXg==", + "license": "MIT", + "funding": { + "url": "https://github.com/kjur/jsrsasign#donations" + } + }, + "node_modules/jsrsasign-util": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/jsrsasign-util/-/jsrsasign-util-1.0.5.tgz", + "integrity": "sha512-e5Kp8aaT5GH2c5X8j4uaJruYmT4GcnaGb47nw8m60YqPywtnOtTISZ9hZgtZ3a+jh7B27bU2LCf3Y32wZyfhtQ==", + "dependencies": { + "jsonc-parser": ">= 0.0.1", + "jsrsasign": ">= 4.8.2" + } + }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmmirror.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -7386,16 +7414,14 @@ } }, "node_modules/kintone-ui-component": { - "version": "1.18.0", - "resolved": "https://registry.npmmirror.com/kintone-ui-component/-/kintone-ui-component-1.18.0.tgz", - "integrity": "sha512-cwNhOMAfZ5TBzNe4edGwQ3LeEJ466d+GwSWVQ0k43zVYkWCBkFzU68s/zzjJUKxFtjmIkND+77Lr6IolpBqRcw==", + "version": "1.21.0", + "resolved": "https://registry.npmmirror.com/kintone-ui-component/-/kintone-ui-component-1.21.0.tgz", + "integrity": "sha512-GxxRw24v3p//ao5/KKyGnlh3vpkYmmyqm9NduYx1dCivRZMifweI5VhImhLw/QkAVHUOHowK3HVWIM5efOw0jw==", "license": "MIT", "dependencies": { - "@webcomponents/webcomponentsjs": "^2.8.0", - "core-js": "^3.38.1", - "lit": "^3.2.0", - "regenerator-runtime": "^0.14.1", - "uuid": "^10.0.0" + "core-js": "^3.42.0", + "lit": "^3.3.0", + "uuid": "^11.1.0" } }, "node_modules/language-subtag-registry": { @@ -8863,12 +8889,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "license": "MIT" - }, "node_modules/regexp.prototype.flags": { "version": "1.5.4", "resolved": "https://registry.npmmirror.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", @@ -10547,16 +10567,16 @@ } }, "node_modules/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmmirror.com/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, "node_modules/validate-npm-package-license": { diff --git a/package.json b/package.json index 0b97753..2bf9c4b 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,16 @@ "vite:build": "vite build", "build": "vite build && npm run pkg", "build:prod": "cross-env BUILD_MODE=production vite build && npm run pkg", - "build-upload":"npm run build && npm run upload", + "build-upload": "npm run build && npm run upload", + "build-upload:prod": "npm run build:prod && npm run upload", "pkg": "kintone-plugin-packer --ppk private.ppk --out dist/plugin.zip dist/src", "upload": "kintone-plugin-uploader --base-url https://alicorn.cybozu.com --username maxz --password 7ld7i8vd dist/plugin.zip " }, "dependencies": { "@kintone/rest-api-client": "^5.7.5", - "kintone-ui-component": "1.18.0", + "jsrsasign": "^11.1.0", + "jsrsasign-util": "^1.0.5", + "kintone-ui-component": "1.21.0", "rollup-plugin-css-only": "^4.5.2", "vue": "^3.5.13", "vue-i18n": "^11.0.1" @@ -23,6 +26,7 @@ "@kintone/dts-gen": "^8.1.1", "@kintone/plugin-packer": "^8.1.3", "@kintone/plugin-uploader": "^9.1.2", + "@types/jsrsasign": "^10.5.15", "@types/node-rsa": "^1.1.4", "@vitejs/plugin-vue": "^5.2.1", "@vue/tsconfig": "^0.7.0", diff --git a/rsa_private.pem b/rsa_private.pem new file mode 100644 index 0000000..b6ec190 --- /dev/null +++ b/rsa_private.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAOp+f4vMaBPla +Y59TTqIhDS7OKlXtJo3vUssv3rYnAWw/dIRQqJF7quddxHeMykr3PMiZ0YES16Ps +t1U/vrL/koOPB2w7nRTg/GruVR5BULe/VV/fehBqsn/eC91RbYKNWjLlkHhWn/u/ +U0xaZkJCKsgpfMFeLRu7BBwOi9mQ4a27YOhgb0dcf553EzKSbkL1po4ZZCJ0GJt5 +Wozklz4wI+2wqqvykeK+THUAOC1FSx6wmFWDNG7l8hSe/li8Ju78+6kXz0NjvIfx +uBfkAYnI1UPAefrhOIWc+2hc2G8jJX+Xe2iCY9VRliAlBY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5R/xh+LPj8FsnHMCgYEApp7hIVSX3FIe1M1oGVbB +cLzSb6wirKU6RcVF7rJ8IAh7IouuOluZ2SdcM6Pc8Jm1VXLi0pnj1SMwKaMrt98t +j6I1YKGWCaoXmQBs/CSUmJU2KUk2L0N/Go7xxb0BD9IhZVyd+9ge4moUTYApTNi9 +cOTdlhJogUO+mvk98/r/Hc0= +-----END PRIVATE KEY----- diff --git a/rsa_public.pem b/rsa_public.pem new file mode 100644 index 0000000..0ae9267 --- /dev/null +++ b/rsa_public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwDqfn+LzGgT5WmOfU06i +IQ0uzipV7SaN71LLL962JwFsP3SEUKiRe6rnXcR3jMpK9zzImdGBEtej7LdVP76y +/5KDjwdsO50U4Pxq7lUeQVC3v1Vf33oQarJ/3gvdUW2CjVoy5ZB4Vp/7v1NMWmZC +QirIKXzBXi0buwQcDovZkOGtu2DoYG9HXH+edxMykm5C9aaOGWQidBibeVqM5Jc+ +MCPtsKqr8pHivkx1ADgtRUsesJhVgzRu5fIUnv5YvCbu/PupF89DY7yH8bgX5AGJ +yNVDwHn64TiFnPtoXNhvIyV/l3togmPVUZYgJQWF0MQ9ppjDTYU05Y/7M88JaAJZ +KQIDAQAB +-----END PUBLIC KEY----- diff --git a/src/components/Config.vue b/src/components/Config.vue index 6243ffd..027f320 100644 --- a/src/components/Config.vue +++ b/src/components/Config.vue @@ -1,4 +1,7 @@