@konomi-app/kintone-utilities 6.0.0 → 6.1.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.cjs CHANGED
@@ -1101,16 +1101,6 @@ var KintoneEventListener = KintoneEventManager;
1101
1101
 
1102
1102
  // src/plugin/config.ts
1103
1103
  var META_PROPERTY_KEY = "$meta";
1104
- var restoreStorage = (id) => {
1105
- const config = kintone.plugin.app.getConfig(id);
1106
- if (!Object.keys(config).length) {
1107
- return null;
1108
- }
1109
- return Object.entries(config).reduce(
1110
- (acc, [key, value]) => ({ ...acc, [key]: JSON.parse(value) }),
1111
- {}
1112
- );
1113
- };
1114
1104
  var storeStorage = (target, callback) => {
1115
1105
  const converted = Object.entries(target).filter(([_, v]) => v !== void 0).reduce((acc, [key, value]) => ({ ...acc, [key]: JSON.stringify(value) }), {});
1116
1106
  kintone.plugin.app.setConfig(converted, callback);
@@ -1125,9 +1115,8 @@ var restorePluginConfig = (id, options = {}) => {
1125
1115
  }
1126
1116
  if (!(META_PROPERTY_KEY in config)) {
1127
1117
  debug && console.warn("[config] Meta property is not found. Fallback to normal config.");
1128
- return Object.entries(config).reduce(
1129
- (acc, [key, value]) => ({ ...acc, [key]: JSON.parse(value) }),
1130
- {}
1118
+ return Object.fromEntries(
1119
+ Object.entries(config).map(([key, value]) => [key, JSON.parse(value)])
1131
1120
  );
1132
1121
  }
1133
1122
  const meta = JSON.parse(config[META_PROPERTY_KEY]);
@@ -1242,14 +1231,11 @@ var api2 = async (params) => {
1242
1231
  checkBrowser2();
1243
1232
  const path = buildPath2({ endpointName, guestSpaceId, preview });
1244
1233
  if (debug) {
1245
- console.groupCollapsed(
1246
- `%ckintone REST API %c(${endpointName})`,
1247
- "color: #1e40af;",
1248
- "color: #aaa"
1249
- );
1250
- console.log(`path: ${path}`);
1251
- console.log(`method: ${method}`);
1252
- console.log("body", body);
1234
+ console.log(`%ckintone REST API %c(${endpointName})`, "color: #1e40af;", "color: #aaa", {
1235
+ path,
1236
+ method,
1237
+ body
1238
+ });
1253
1239
  }
1254
1240
  const response = await kintone.api(path, method, body);
1255
1241
  if (debug) {
@@ -2052,7 +2038,6 @@ exports.isGuestSpace = isGuestSpace;
2052
2038
  exports.isMobile = isMobile;
2053
2039
  exports.onFileLoad = onFileLoad;
2054
2040
  exports.restorePluginConfig = restorePluginConfig;
2055
- exports.restoreStorage = restoreStorage;
2056
2041
  exports.setCurrentRecord = setCurrentRecord;
2057
2042
  exports.setFieldShown = setFieldShown;
2058
2043
  exports.setPluginProxyConfig = setPluginProxyConfig;