@konomi-app/kintone-utilities 6.0.1 → 6.2.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]);
@@ -1288,6 +1277,7 @@ var API_ENDPOINT_VIEWS = "app/views";
1288
1277
  var API_ENDPOINT_FORM_FIELDS = "app/form/fields";
1289
1278
  var API_ENDPOINT_FORM_LAYOUT = "app/form/layout";
1290
1279
  var API_ENDPOINT_APP_SETTINGS = "app/settings";
1280
+ var API_ENDPOINT_STATUS = "app/status";
1291
1281
  var getApp = async (params) => {
1292
1282
  const { debug, guestSpaceId, ...requestParams } = params;
1293
1283
  return api2({
@@ -1369,6 +1359,17 @@ var getAppSettings = async (params) => {
1369
1359
  guestSpaceId
1370
1360
  });
1371
1361
  };
1362
+ var getAppStatus = async (params) => {
1363
+ const { app, lang = "default", preview = false, debug, guestSpaceId } = params;
1364
+ return api2({
1365
+ endpointName: API_ENDPOINT_STATUS,
1366
+ method: "GET",
1367
+ body: { app, lang },
1368
+ preview,
1369
+ debug,
1370
+ guestSpaceId
1371
+ });
1372
+ };
1372
1373
 
1373
1374
  // src/rest-api/record.ts
1374
1375
  var API_ENDPOINT_RECORD = `record`;
@@ -1970,10 +1971,6 @@ var useQuery = (conditions, options) => {
1970
1971
  }
1971
1972
  return mergedCondition;
1972
1973
  };
1973
- var chunk = (arr, size) => Array.from(
1974
- { length: Math.ceil(arr.length / size) },
1975
- (_, i) => arr.slice(i * size, i * size + size)
1976
- );
1977
1974
 
1978
1975
  exports.API_LIMIT_POST = API_LIMIT_POST;
1979
1976
  exports.KintoneEventListener = KintoneEventListener;
@@ -1986,7 +1983,6 @@ exports.addRecords = addRecords;
1986
1983
  exports.backdoor = backdoor;
1987
1984
  exports.backdoorGetRecord = backdoorGetRecord;
1988
1985
  exports.bulkRequest = bulkRequest;
1989
- exports.chunk = chunk;
1990
1986
  exports.compareField = compareField;
1991
1987
  exports.convertFullwidthAlphanumericToHalfwidth = convertFullwidthAlphanumericToHalfwidth;
1992
1988
  exports.convertHalfwidthKatakanaToFullwidth = convertHalfwidthKatakanaToFullwidth;
@@ -2008,6 +2004,7 @@ exports.getAppCharts = getAppCharts;
2008
2004
  exports.getAppId = getAppId;
2009
2005
  exports.getAppObject = getAppObject;
2010
2006
  exports.getAppSettings = getAppSettings;
2007
+ exports.getAppStatus = getAppStatus;
2011
2008
  exports.getCalcFieldValueAsString = getCalcFieldValueAsString;
2012
2009
  exports.getCurrentRecord = getCurrentRecord;
2013
2010
  exports.getCybozuGroupUsers = getCybozuGroupUsers;
@@ -2049,7 +2046,6 @@ exports.isGuestSpace = isGuestSpace;
2049
2046
  exports.isMobile = isMobile;
2050
2047
  exports.onFileLoad = onFileLoad;
2051
2048
  exports.restorePluginConfig = restorePluginConfig;
2052
- exports.restoreStorage = restoreStorage;
2053
2049
  exports.setCurrentRecord = setCurrentRecord;
2054
2050
  exports.setFieldShown = setFieldShown;
2055
2051
  exports.setPluginProxyConfig = setPluginProxyConfig;