@konomi-app/kintone-utilities 3.3.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +12 -0
- package/dist/{plugin.d.ts → plugin/config.d.ts} +4 -0
- package/dist/{plugin.js → plugin/config.js} +5 -1
- package/dist/plugin/config.js.map +1 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/index.js +3 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/local-storage.d.ts +7 -0
- package/dist/plugin/local-storage.js +25 -0
- package/dist/plugin/local-storage.js.map +1 -0
- package/package.json +3 -3
- package/dist/plugin.js.map +0 -1
package/.editorconfig
ADDED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* プラグインがアプリ単位で保存している設定情報を返却します
|
|
3
|
+
*
|
|
4
|
+
* 設定情報の取得に失敗した場合は、nullを返却します
|
|
5
|
+
* @param id プラグインID
|
|
6
|
+
* @returns プラグインの設定情報
|
|
3
7
|
*/
|
|
4
8
|
export const restoreStorage = (id) => {
|
|
5
9
|
const config = kintone.plugin.app.getConfig(id);
|
|
@@ -19,4 +23,4 @@ export const storeStorage = (target, callback) => {
|
|
|
19
23
|
.reduce((acc, [key, value]) => ({ ...acc, [key]: JSON.stringify(value) }), {});
|
|
20
24
|
kintone.plugin.app.setConfig(converted, callback);
|
|
21
25
|
};
|
|
22
|
-
//# sourceMappingURL=
|
|
26
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/plugin/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAU,EAAU,EAAY,EAAE;IAC9D,MAAM,MAAM,GAA2B,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAClC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,EAC7D,EAAE,CACH,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAA2B,EAAE,QAAqB,EAAQ,EAAE;IACvF,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACrC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;SACnC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEjF,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class PluginLocalStorage {
|
|
2
|
+
#key;
|
|
3
|
+
#storage;
|
|
4
|
+
constructor(key) {
|
|
5
|
+
this.#key = key;
|
|
6
|
+
const stored = localStorage.getItem(this.#key) ?? '{}';
|
|
7
|
+
this.#storage = JSON.parse(stored);
|
|
8
|
+
}
|
|
9
|
+
save() {
|
|
10
|
+
localStorage.setItem(this.#key, JSON.stringify(this.#storage));
|
|
11
|
+
}
|
|
12
|
+
updateVersion = (currentVersion) => {
|
|
13
|
+
const latestVersion = this.#storage.latestVersion ?? currentVersion;
|
|
14
|
+
this.#storage.version = currentVersion;
|
|
15
|
+
const [latestMajor, latestMinor] = latestVersion.split('.').map((v) => parseInt(v, 10));
|
|
16
|
+
const [currentMajor, currentMinor] = currentVersion.split('.').map((v) => parseInt(v, 10));
|
|
17
|
+
this.#storage.hasNewVersion =
|
|
18
|
+
latestMajor > currentMajor || (latestMajor === currentMajor && latestMinor > currentMinor);
|
|
19
|
+
this.save();
|
|
20
|
+
};
|
|
21
|
+
get hasNewVersion() {
|
|
22
|
+
return this.#storage.hasNewVersion ?? false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=local-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../src/plugin/local-storage.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,kBAAkB;IACpB,IAAI,CAAS;IACtB,QAAQ,CAAsB;IAE9B,YAAmB,GAAW;QAC5B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;QACvD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAEO,IAAI;QACV,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjE,CAAC;IAEM,aAAa,GAAG,CAAC,cAAsB,EAAE,EAAE;QAChD,MAAM,aAAa,GAAW,IAAI,CAAC,QAAQ,CAAC,aAAa,IAAI,cAAc,CAAC;QAE5E,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,cAAc,CAAC;QAEvC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACxF,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAE3F,IAAI,CAAC,QAAQ,CAAC,aAAa;YACzB,WAAW,GAAG,YAAY,IAAI,CAAC,WAAW,KAAK,YAAY,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC;QAE7F,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,IAAI,KAAK,CAAC;IAC9C,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@konomi-app/kintone-utilities",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": "https://github.com/local-bias/kintone-utilities.git",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@emotion/css": "^11.11.2",
|
|
16
|
-
"@kintone/rest-api-client": "^
|
|
16
|
+
"@kintone/rest-api-client": "^5.0.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@kintone/dts-gen": "^
|
|
19
|
+
"@kintone/dts-gen": "^8.0.0",
|
|
20
20
|
"typescript": "^5.2.2"
|
|
21
21
|
},
|
|
22
22
|
"prettier": {
|
package/dist/plugin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAU,EAAU,EAAY,EAAE;IAC9D,MAAM,MAAM,GAA2B,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAClC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,EAC7D,EAAE,CACH,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAA2B,EAAE,QAAqB,EAAQ,EAAE;IACvF,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACrC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;SACnC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEjF,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC"}
|