Kintone plugin 実装

This commit is contained in:
2023-10-24 09:08:45 +09:00
parent 25f05ab018
commit f6d677b51f
27 changed files with 1477 additions and 20251 deletions

24
plugin/kintone-addins/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

588
plugin/kintone-addins/package-lock.json generated Normal file
View File

@@ -0,0 +1,588 @@
{
"name": "kintone-addins",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "kintone-addins",
"version": "0.0.0",
"dependencies": {
"jquery": "^3.7.1"
},
"devDependencies": {
"@types/jquery": "^3.5.24",
"typescript": "^5.0.2",
"vite": "^4.4.5"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz",
"integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz",
"integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz",
"integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz",
"integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz",
"integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz",
"integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz",
"integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz",
"integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz",
"integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz",
"integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz",
"integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==",
"cpu": [
"loong64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz",
"integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==",
"cpu": [
"mips64el"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz",
"integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz",
"integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==",
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz",
"integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==",
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz",
"integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz",
"integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz",
"integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz",
"integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz",
"integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz",
"integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz",
"integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@types/jquery": {
"version": "3.5.24",
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.24.tgz",
"integrity": "sha512-V/TG69ge5amcr8Ap7vY3SObqKfZlV7ttqcYnNcYnndI77ySIRi05+3GjvfwRtE2qalAC2ySLIL1ker512sI20g==",
"dev": true,
"dependencies": {
"@types/sizzle": "*"
}
},
"node_modules/@types/sizzle": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.5.tgz",
"integrity": "sha512-tAe4Q+OLFOA/AMD+0lq8ovp8t3ysxAOeaScnfNdZpUxaGl51ZMDEITxkvFl1STudQ58mz6gzVGl9VhMKhwRnZQ==",
"dev": true
},
"node_modules/esbuild": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz",
"integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/android-arm": "0.18.20",
"@esbuild/android-arm64": "0.18.20",
"@esbuild/android-x64": "0.18.20",
"@esbuild/darwin-arm64": "0.18.20",
"@esbuild/darwin-x64": "0.18.20",
"@esbuild/freebsd-arm64": "0.18.20",
"@esbuild/freebsd-x64": "0.18.20",
"@esbuild/linux-arm": "0.18.20",
"@esbuild/linux-arm64": "0.18.20",
"@esbuild/linux-ia32": "0.18.20",
"@esbuild/linux-loong64": "0.18.20",
"@esbuild/linux-mips64el": "0.18.20",
"@esbuild/linux-ppc64": "0.18.20",
"@esbuild/linux-riscv64": "0.18.20",
"@esbuild/linux-s390x": "0.18.20",
"@esbuild/linux-x64": "0.18.20",
"@esbuild/netbsd-x64": "0.18.20",
"@esbuild/openbsd-x64": "0.18.20",
"@esbuild/sunos-x64": "0.18.20",
"@esbuild/win32-arm64": "0.18.20",
"@esbuild/win32-ia32": "0.18.20",
"@esbuild/win32-x64": "0.18.20"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/jquery": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
},
"node_modules/nanoid": {
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"node_modules/postcss": {
"version": "8.4.31",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"dependencies": {
"nanoid": "^3.3.6",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/rollup": {
"version": "3.29.4",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz",
"integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
},
"engines": {
"node": ">=14.18.0",
"npm": ">=8.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/typescript": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/vite": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz",
"integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==",
"dev": true,
"dependencies": {
"esbuild": "^0.18.10",
"postcss": "^8.4.27",
"rollup": "^3.27.1"
},
"bin": {
"vite": "bin/vite.js"
},
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
"funding": {
"url": "https://github.com/vitejs/vite?sponsor=1"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
},
"peerDependencies": {
"@types/node": ">= 14",
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.4.0"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"less": {
"optional": true
},
"lightningcss": {
"optional": true
},
"sass": {
"optional": true
},
"stylus": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
}
}
}
}
}

View File

@@ -0,0 +1,19 @@
{
"name": "kintone-addins",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build && xcopy dist\\*.js ..\\..\\backend\\Temp\\ /E /I /Y",
"preview": "vite preview"
},
"devDependencies": {
"@types/jquery": "^3.5.24",
"typescript": "^5.0.2",
"vite": "^4.4.5"
},
"dependencies": {
"jquery": "^3.7.1"
}
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,2 @@
import { IAction } from "../types/ActionTypes";
export const actionAddins :Record<string,IAction>={};

View File

@@ -0,0 +1,53 @@
import { actionAddins } from ".";
import { IAction,IActionResult, IActionNode, IActionProperty } from "../types/ActionTypes";
interface IMustInputProps{
field:string;
message:string;
}
export class MustInputAction implements IAction{
name: string;
actionProps: IActionProperty[];
props:IMustInputProps;
constructor(){
this.name="必須チェック";
this.actionProps=[];
this.register();
this.props={
field:'',
message:''
}
this.register();
}
process(actionNode:IActionNode,event:any):IActionResult {
let result={
canNext:true,
result:false
};
this.actionProps=actionNode.actionProps;
if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue)) {
return result
}
this.props = actionNode.ActionValue as IMustInputProps;
const record = event.record;
const value = record[this.props.field]?.value;
if(value===undefined || value===''){
record[this.props.field].error=this.props.message;
return result;
}
result= {
canNext:true,
result:true
}
return result;
}
register(): void {
actionAddins[this.name]=this;
}
}
new MustInputAction();

View File

@@ -0,0 +1,27 @@
// export const sum = (a: number, b: number) => {
// if ('development' === process.env.NODE_ENV) {
// console.log('boop');
// }
// return a + b;
// };
import $ from 'jquery';
import { ActionProcess } from './types/action-process';
import { ActionFlow } from './types/ActionTypes';
import { FlowInfo } from './types/flowSetting';
declare const alcflow : {
[key:string]:FlowInfo
};
$(function (){
const events=Object.keys(alcflow);
kintone.events.on(events,(event:any)=>{
const flowinfo = alcflow[event.type];
const flow=ActionFlow.fromJSON(flowinfo.content);
if(flow!==undefined){
const process = new ActionProcess(event.type,flow,event);
process.exec();
}
return event;
});
});

402
plugin/kintone-addins/src/kintone.d.ts vendored Normal file
View File

@@ -0,0 +1,402 @@
/**
* Kintone APIタイプ定義
*/
declare namespace kintone {
namespace events {
function on(event: string | string[], handler: (event: any) => any): void;
function off(
event: string | string[],
handler: (event: any) => any
): boolean;
function off(event: string | string[]): boolean;
function off(): boolean;
}
namespace api {
function url(path: string, detectGuestSpace?: boolean): string;
function urlForGet(
path: string,
params: any,
detectGuestSpace?: boolean
): string;
function getConcurrencyLimit(): Promise<{
limit: number;
running: number;
}>;
}
function api(pathOrUrl: string, method: string, params: any): Promise<any>;
function api(
pathOrUrl: string,
method: string,
params: any,
callback: (resp: any) => void,
errback: (err: any) => void
): void;
function getRequestToken(): string;
function proxy(
url: string,
method: string,
headers: any,
data: any
): Promise<any>;
function proxy(
url: string,
method: string,
headers: any,
data: any,
callback: (resp: any) => void,
errback: (err: any) => void
): void;
class Promise<T> {
constructor(
callback: (
resolve: (resolved: T) => any,
reject: (rejected: any) => any
) => void
);
then(callback: (resolved: T) => any): Promise<any>;
catch(callback: (rejected: any) => any): Promise<any>;
static resolve(resolved: any): Promise<any>;
static reject(rejected: any): Promise<any>;
static all(listOfPromise: Array<Promise<any>>): Promise<any>;
}
namespace proxy {
function upload(
url: string,
method: string,
headers: any,
data: any,
callback: (resp: any) => void,
errback: (err: any) => void
): void;
function upload(
url: string,
method: string,
headers: any,
data: any
): Promise<any>;
}
namespace app {
function getFieldElements(fieldCode: string): HTMLElement[] | null;
function getHeaderMenuSpaceElement(): HTMLElement | null;
function getHeaderSpaceElement(): HTMLElement | null;
function getId(): number | null;
function getLookupTargetAppId(fieldCode: string): string | null;
function getQuery(): string | null;
function getQueryCondition(): string | null;
function getRelatedRecordsTargetAppId(fieldCode: string): string | null;
namespace record {
function getId(): number | null;
function get(): any | null;
function getHeaderMenuSpaceElement(): HTMLElement | null;
function getFieldElement(fieldCode: string): HTMLElement | null;
function set(record: any): void;
function getSpaceElement(id: string): HTMLElement | null;
function setFieldShown(fieldCode: string, isShown: boolean): void;
function setGroupFieldOpen(fieldCode: string, isOpen: boolean): void;
}
}
namespace mobile {
namespace app {
function getFieldElements(fieldCode: string): HTMLElement[] | null;
function getHeaderSpaceElement(): HTMLElement | null;
function getId(): number | null;
function getLookupTargetAppId(fieldCode: string): string | null;
function getQuery(): string | null;
function getQueryCondition(): string | null;
function getRelatedRecordsTargetAppId(fieldCode: string): string | null;
namespace record {
function getId(): number | null;
function get(): any | null;
function getFieldElement(fieldCode: string): HTMLElement | null;
function set(record: any): void;
function getSpaceElement(id: string): HTMLElement | null;
function setFieldShown(fieldCode: string, isShown: boolean): void;
function setGroupFieldOpen(fieldCode: string, isOpen: boolean): void;
}
}
namespace portal {
function getContentSpaceElement(): HTMLElement | null;
}
namespace space {
namespace portal {
function getContentSpaceElement(): HTMLElement | null;
}
}
}
namespace plugin {
namespace app {
function getConfig(pluginId: string): any;
function setConfig(config: any, callback?: () => void): void;
function proxy(
pluginId: string,
url: string,
method: string,
headers: any,
data: any
): Promise<any>;
function proxy(
pluginId: string,
url: string,
method: string,
headers: any,
data: any,
callback: (resp: any) => void,
error: (err: any) => void
): void;
function setProxyConfig(
url: string,
method: string,
headers: any,
data: any,
callback?: () => void
): void;
function getProxyConfig(url: string, method: string): any;
namespace proxy {
function upload(
pluginId: any,
url: string,
method: string,
headers: any,
data: any
): Promise<any>;
function upload(
pluginId: any,
url: string,
method: string,
headers: any,
data: any,
callback: (resp: any) => void,
error: (err: any) => void
): void;
}
}
}
namespace portal {
function getContentSpaceElement(): HTMLElement | null;
}
namespace space {
namespace portal {
function getContentSpaceElement(): HTMLElement | null;
}
}
interface LoginUser {
id: string;
code: string;
name: string;
email: string;
url: string;
employeeNumber: string;
phone: string;
mobilePhone: string;
extensionNumber: string;
timezone: string;
isGuest: boolean;
language: string;
}
function getLoginUser(): LoginUser;
function getUiVersion(): 1 | 2;
const $PLUGIN_ID: string;
namespace fieldTypes {
interface SingleLineText {
type?: "SINGLE_LINE_TEXT";
value: string;
disabled?: boolean;
error?: string;
}
interface RichText {
type?: "RICH_TEXT";
value: string;
disabled?: boolean;
error?: string;
}
interface MultiLineText {
type?: "MULTI_LINE_TEXT";
value: string;
disabled?: boolean;
error?: string;
}
interface Number {
type?: "NUMBER";
value: string;
disabled?: boolean;
error?: string;
}
interface Calc {
type: "CALC";
value: string;
disabled?: boolean;
}
interface RadioButton {
type?: "RADIO_BUTTON";
value: string;
disabled?: boolean;
error?: string;
}
interface DropDown {
type?: "DROP_DOWN";
value: string;
disabled?: boolean;
error?: string;
}
interface Date {
type?: "DATE";
value: string;
disabled?: boolean;
error?: string;
}
interface Time {
type?: "TIME";
value: string;
disabled?: boolean;
error?: string;
}
interface DateTime {
type?: "DATETIME";
value: string;
disabled?: boolean;
error?: string;
}
interface Link {
type?: "LINK";
value: string;
disabled?: boolean;
error?: string;
}
interface CheckBox {
type?: "CHECK_BOX";
value: string[];
disabled?: boolean;
error?: string;
}
interface MultiSelect {
type?: "MULTI_SELECT";
value: string[];
disabled?: boolean;
error?: string;
}
interface UserSelect {
type?: "USER_SELECT";
value: Array<{ code: string; name: string }>;
disabled?: boolean;
error?: string;
}
interface OrganizationSelect {
type?: "ORGANIZATION_SELECT";
value: Array<{ code: string; name: string }>;
disabled?: boolean;
error?: string;
}
interface GroupSelect {
type?: "GROUP_SELECT";
value: Array<{ code: string; name: string }>;
disabled?: boolean;
error?: string;
}
interface File {
type: "FILE";
value: Array<{
contentType: string;
fileKey: string;
name: string;
size: string;
}>;
disabled?: boolean;
error?: string;
}
interface Id {
type: "__ID__";
value: string;
}
interface Revision {
type: "__REVISION__";
value: string;
}
/**
* field type of UserField is MODIFIER.
* So error property not exists.
*/
interface Modifier {
type: "MODIFIER";
value: { code: string; name: string };
}
/**
* field type of UserField is CREATOR.
* So error property not exists.
*/
interface Creator {
type: "CREATOR";
value: { code: string; name: string };
}
interface RecordNumber {
type: "RECORD_NUMBER";
value: string;
error?: string;
}
interface UpdatedTime {
type: "UPDATED_TIME";
value: string;
error?: string;
}
interface CreatedTime {
type: "CREATED_TIME";
value: string;
error?: string;
}
}
}

View File

@@ -0,0 +1,247 @@
/**
* アプリ情報
*/
export interface AppInfo {
appId: string;
code?: string;
name: string;
description?: string;
}
/**
* アクションのプロパティ定義
*/
export interface IActionProperty {
component: string;
props: {
//プロパティ名
name: string;
//プロパティ表示名
displayName: string;
placeholder: string;
//プロパティ設定値
modelValue: any;
};
}
/**
* アクションタイプ定義
*/
export interface IActionNode {
id: string;
//アクション名
name: string;
title: string;
subTitle: string;
inputPoint: string;
//出力ポイント(条件分岐以外未使用)
outputPoints: Array<string>;
//ルートアクションKintone event
isRoot: boolean;
//アクションのプロパティ定義
actionProps: Array<IActionProperty>;
//アクションのプロパティ設定値抽出
ActionValue: object
prevNodeId?: string;
nextNodeIds: Map<string, string>;
}
/**
* アクションフローの定義
*/
export interface IActionFlow {
id: string;
actionNodes: IActionNode[];
findNodeById(id: string): IActionNode | undefined;
toJSON(): any;
getRoot(): IActionNode | undefined;
}
export interface IActionResult{
canNext:boolean;
result?:any;
}
export interface IAction{
name:string;
actionProps: Array<IActionProperty>;
process(prop:IActionNode,event:any):IActionResult;
register():void;
}
/**
* アクションのプロパティ定義に基づいたクラス
*/
export class ActionProperty implements IActionProperty {
component: string;
props: {
// プロパティ名
name: string;
// プロパティ表示名
displayName: string;
placeholder: string;
// プロパティ設定値
modelValue: any;
};
static defaultProperty(): IActionProperty {
return new ActionProperty('InputText', 'displayName', '表示名', '表示を入力してください', '');
};
constructor(
component: string,
name: string,
displayName: string,
placeholder: string,
modelValue: any
) {
this.component = component;
this.props = {
name: name,
displayName: displayName,
placeholder: placeholder,
modelValue: modelValue
};
}
}
/**
* IActionNodeの実装、RootActionNode以外のアクション定義
*/
export class ActionNode implements IActionNode {
id: string;
name: string;
get title(): string {
const prop = this.actionProps.find((prop) => prop.props.name === "displayName");
return prop?.props.modelValue;
};
get subTitle(): string {
return this.name;
};
inputPoint: string;
//出力ポイント(条件分岐以外未使用)
outputPoints: Array<string>;
actionProps: Array<IActionProperty>;
get isRoot(): boolean {
return false;
};
get ActionValue(): object {
const propValue: any = {};
this.actionProps.forEach((value) => {
propValue[value.props.name] = value.props.modelValue
});
return propValue;
};
prevNodeId?: string;
nextNodeIds: Map<string, string>;
constructor(
{id,name,title,inputPoint,outputPoint,actionProps}:
{
id:string,
name: string,
title: string,
inputPoint: string,
outputPoint: Array<string>,
actionProps: Array<IActionProperty>}
) {
this.id=id;
this.name = name;
this.inputPoint = inputPoint;
this.outputPoints = outputPoint;
const defProp = ActionProperty.defaultProperty();
defProp.props.modelValue = title;
this.actionProps = actionProps;
this.nextNodeIds = new Map<string, string>();
}
}
/**
* ルートアクション定義
*/
export class RootAction implements IActionNode {
id: string;
name: string;
title: string;
subTitle: string;
inputPoint: string;
//出力ポイント(条件分岐以外未使用)
outputPoints: Array<string>;
isRoot: boolean;
actionProps: Array<IActionProperty>;
ActionValue: object;
prevNodeId?: string = undefined;
nextNodeIds: Map<string, string>;
constructor(
{id,name,title,subTitle}:{
id:string,
name: string,
title: string,
subTitle: string}
) {
this.id = id;
this.name = name;
this.title = title;
this.subTitle = subTitle;
this.inputPoint = '';
this.outputPoints = [];
this.isRoot = true;
this.actionProps = [];
this.ActionValue = {};
this.nextNodeIds = new Map<string, string>();
}
}
/**
* アクションフローの定義
*/
export class ActionFlow implements IActionFlow {
id: string;
actionNodes: Array<IActionNode>;
constructor(actionNodes: Array<IActionNode> | RootAction) {
if (actionNodes instanceof Array) {
this.actionNodes = actionNodes;
} else {
this.actionNodes = [actionNodes];
}
this.id = '';
}
/***
* IDでActionNodeを取得する
*/
findNodeById(id: string): IActionNode | undefined {
return this.actionNodes.find((node) => node.id === id);
}
toJSON() {
return {
id: this.id,
actionNodes: this.actionNodes.map(node => {
const { nextNodeIds, ...rest } = node;
return {
...rest,
nextNodeIds: Array.from(nextNodeIds.entries())
};
})
};
}
getRoot(): IActionNode | undefined {
return this.actionNodes.find(node => node.isRoot)
}
static fromJSON(json: string): ActionFlow {
const parsedObject = JSON.parse(json);
const actionNodes = parsedObject.actionNodes.map((node: any) => {
const nodeClass = !node.isRoot ? new ActionNode(node)
: new RootAction(node);
nodeClass.nextNodeIds = new Map(node.nextNodeIds);
nodeClass.prevNodeId = node.prevNodeId;
nodeClass.id = node.id;
return nodeClass;
});
const actionFlow = new ActionFlow(actionNodes);
actionFlow.id = parsedObject.id;
return actionFlow;
}
}

View File

@@ -0,0 +1,38 @@
import { actionAddins } from "../actions";
import '../actions/must-input';
import { ActionFlow,IActionFlow, IActionResult } from "./ActionTypes";
export class ActionProcess{
eventId:string;
flow:IActionFlow;
event:any;
constructor(eventId:string,flow:ActionFlow,event:any){
this.eventId=eventId;
this.flow=flow;
this.event=event;
}
exec(){
const root = this.flow.getRoot();
if(root===undefined || root.nextNodeIds.size===0){
return;
}
let id=root.nextNodeIds.get('');
if(id===undefined) return;
let nextAction = this.flow.findNodeById(id);
let result:IActionResult={
canNext:true
};
while(nextAction!==undefined && result.canNext){
const action = actionAddins[nextAction.name];
if(action!==undefined){
result = action.process(nextAction,this.event)
}
const nextInput = nextAction.outputPoints!==undefined?result.result||'':'';
id=nextAction.nextNodeIds.get(nextInput);
if(id===undefined) return;
nextAction = this.flow.findNodeById(id);
}
}
}

View File

@@ -0,0 +1,23 @@
import { ActionFlow } from "./ActionTypes";
export interface IFlowInfo {
flowid: string;
name:string;
content: string;
}
export class FlowInfo implements IFlowInfo{
flowid: string;
name:string;
content: string;
constructor({flowid,name,content}:{flowid: string,
name:string,
content: string,}) {
this.flowid=flowid;
this.name=name;
this.content=content;
}
getFlow():ActionFlow {
return ActionFlow.fromJSON(this.content)
}
}

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}

View File

@@ -0,0 +1,14 @@
// vite.config.js
import { defineConfig } from 'vite'
export default defineConfig({
build: {
rollupOptions: {
input: 'src/index.ts', // entry file
output:{
entryFileNames:'alc_runtime.js'
}
},
sourcemap:true
}
})