@konomi-app/kintone-utilities 0.5.3 → 0.7.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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +10 -0
- package/dist/plugin.js +20 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* プラグインがアプリ単位で保存している設定情報を返却します
|
|
3
|
+
*/
|
|
4
|
+
export declare const restoreStorage: <T = any>(id: string) => T | null;
|
|
5
|
+
/**
|
|
6
|
+
* アプリにプラグインの設定情報を保存します
|
|
7
|
+
* @param target プラグインの設定情報
|
|
8
|
+
* @param callback 保存成功後に実行する処理
|
|
9
|
+
*/
|
|
10
|
+
export declare const storeStorage: (target: Record<string, any>, callback?: () => void) => void;
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* プラグインがアプリ単位で保存している設定情報を返却します
|
|
3
|
+
*/
|
|
4
|
+
export const restoreStorage = (id) => {
|
|
5
|
+
const config = kintone.plugin.app.getConfig(id);
|
|
6
|
+
if (!Object.keys(config).length) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return Object.entries(config).reduce((acc, [key, value]) => ({ ...acc, [key]: JSON.parse(value) }), {});
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* アプリにプラグインの設定情報を保存します
|
|
13
|
+
* @param target プラグインの設定情報
|
|
14
|
+
* @param callback 保存成功後に実行する処理
|
|
15
|
+
*/
|
|
16
|
+
export const storeStorage = (target, callback) => {
|
|
17
|
+
const converted = Object.entries(target).reduce((acc, [key, value]) => ({ ...acc, [key]: JSON.stringify(value) }), {});
|
|
18
|
+
kintone.plugin.app.setConfig(converted, callback);
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,MAAM,CAC7C,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,EACjE,EAAE,CACH,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC"}
|