kintone-migrator 0.35.0 → 0.35.2
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.mjs +725 -633
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -199,6 +199,7 @@ const ViewErrorCode = {
|
|
|
199
199
|
* This error is thrown when domain logic determines that an operation cannot proceed.
|
|
200
200
|
*/
|
|
201
201
|
var BusinessRuleError = class extends AnyError {
|
|
202
|
+
code;
|
|
202
203
|
name = "BusinessRuleError";
|
|
203
204
|
constructor(code, message, cause) {
|
|
204
205
|
super(message, cause);
|
|
@@ -228,6 +229,7 @@ function wrapBusinessRuleError(fn) {
|
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
var ApplicationError = class extends AnyError {
|
|
232
|
+
code;
|
|
231
233
|
name = "ApplicationError";
|
|
232
234
|
constructor(code, message, cause) {
|
|
233
235
|
super(message, cause);
|
|
@@ -239,6 +241,7 @@ const NotFoundErrorCode = {
|
|
|
239
241
|
AppNotFound: "APP_NOT_FOUND"
|
|
240
242
|
};
|
|
241
243
|
var NotFoundError = class extends ApplicationError {
|
|
244
|
+
code;
|
|
242
245
|
name = "NotFoundError";
|
|
243
246
|
constructor(code, message, cause) {
|
|
244
247
|
super(code, message, cause);
|
|
@@ -250,9 +253,18 @@ function isNotFoundError(error) {
|
|
|
250
253
|
}
|
|
251
254
|
const ConflictErrorCode = {
|
|
252
255
|
Conflict: "CONFLICT",
|
|
256
|
+
/**
|
|
257
|
+
* The remote config drifted from the base snapshot and the push was not
|
|
258
|
+
* forced (push-specific drift). Distinct from
|
|
259
|
+
* {@link Conflict}, which the kintone adapter uses for API optimistic-lock
|
|
260
|
+
* (409) conflicts, so the CLI can tell snapshot drift apart from TOCTOU
|
|
261
|
+
* conflicts by code rather than by message string. Shared by every config
|
|
262
|
+
* domain (schema, view, ...), not schema-specific.
|
|
263
|
+
*/
|
|
253
264
|
ConfigDrift: "CONFIG_DRIFT"
|
|
254
265
|
};
|
|
255
266
|
var ConflictError = class extends ApplicationError {
|
|
267
|
+
code;
|
|
256
268
|
name = "ConflictError";
|
|
257
269
|
constructor(code, message, cause) {
|
|
258
270
|
super(code, message, cause);
|
|
@@ -267,6 +279,7 @@ const UnauthenticatedErrorCode = {
|
|
|
267
279
|
InvalidCredentials: "INVALID_CREDENTIALS"
|
|
268
280
|
};
|
|
269
281
|
var UnauthenticatedError = class extends ApplicationError {
|
|
282
|
+
code;
|
|
270
283
|
name = "UnauthenticatedError";
|
|
271
284
|
constructor(code, message, cause) {
|
|
272
285
|
super(code, message, cause);
|
|
@@ -278,6 +291,7 @@ function isUnauthenticatedError(error) {
|
|
|
278
291
|
}
|
|
279
292
|
const ForbiddenErrorCode = { InsufficientPermissions: "INSUFFICIENT_PERMISSIONS" };
|
|
280
293
|
var ForbiddenError = class extends ApplicationError {
|
|
294
|
+
code;
|
|
281
295
|
name = "ForbiddenError";
|
|
282
296
|
constructor(code, message, cause) {
|
|
283
297
|
super(code, message, cause);
|
|
@@ -289,6 +303,7 @@ function isForbiddenError(error) {
|
|
|
289
303
|
}
|
|
290
304
|
const ValidationErrorCode = { InvalidInput: "INVALID_INPUT" };
|
|
291
305
|
var ValidationError = class extends ApplicationError {
|
|
306
|
+
code;
|
|
292
307
|
name = "ValidationError";
|
|
293
308
|
constructor(code, message, cause) {
|
|
294
309
|
super(code, message, cause);
|
|
@@ -308,6 +323,7 @@ const SystemErrorCode = {
|
|
|
308
323
|
ExecutionError: "EXECUTION_ERROR"
|
|
309
324
|
};
|
|
310
325
|
var SystemError = class extends ApplicationError {
|
|
326
|
+
code;
|
|
311
327
|
name = "SystemError";
|
|
312
328
|
constructor(code, message, cause) {
|
|
313
329
|
super(code, message, cause);
|
|
@@ -420,11 +436,11 @@ function validateParsedConfig(parsed, invalidConfigStructure, domainLabel) {
|
|
|
420
436
|
if (!isRecord(parsed)) throw new BusinessRuleError(invalidConfigStructure, `${domainLabel} config must be an object`);
|
|
421
437
|
return parsed;
|
|
422
438
|
}
|
|
423
|
-
const VALID_SRC_TYPES = new Set(["FIELD", "RECORD_URL"]);
|
|
439
|
+
const VALID_SRC_TYPES = /* @__PURE__ */ new Set(["FIELD", "RECORD_URL"]);
|
|
424
440
|
function isActionMappingSrcType(value) {
|
|
425
441
|
return VALID_SRC_TYPES.has(value);
|
|
426
442
|
}
|
|
427
|
-
const VALID_ENTITY_TYPES$9 = new Set([
|
|
443
|
+
const VALID_ENTITY_TYPES$9 = /* @__PURE__ */ new Set([
|
|
428
444
|
"USER",
|
|
429
445
|
"GROUP",
|
|
430
446
|
"ORGANIZATION"
|
|
@@ -702,7 +718,7 @@ function buildDiffResult(entries, warnings = []) {
|
|
|
702
718
|
* (absence) compared to a defined value (presence) is always "changed".
|
|
703
719
|
*/
|
|
704
720
|
function classifyThreeWay(base, local, remote, eq) {
|
|
705
|
-
const keys = new Set([
|
|
721
|
+
const keys = /* @__PURE__ */ new Set([
|
|
706
722
|
...base.keys(),
|
|
707
723
|
...local.keys(),
|
|
708
724
|
...remote.keys()
|
|
@@ -948,6 +964,8 @@ function toKintoneAction$1(action) {
|
|
|
948
964
|
};
|
|
949
965
|
}
|
|
950
966
|
var KintoneActionConfigurator = class {
|
|
967
|
+
client;
|
|
968
|
+
appId;
|
|
951
969
|
constructor(client, appId) {
|
|
952
970
|
this.client = client;
|
|
953
971
|
this.appId = appId;
|
|
@@ -987,7 +1005,7 @@ var KintoneActionConfigurator = class {
|
|
|
987
1005
|
};
|
|
988
1006
|
//#endregion
|
|
989
1007
|
//#region src/core/adapters/kintone/appDeployer.ts
|
|
990
|
-
const VALID_DEPLOY_STATUSES = new Set([
|
|
1008
|
+
const VALID_DEPLOY_STATUSES = /* @__PURE__ */ new Set([
|
|
991
1009
|
"PROCESSING",
|
|
992
1010
|
"SUCCESS",
|
|
993
1011
|
"FAIL",
|
|
@@ -999,6 +1017,8 @@ function isDeployStatus(value) {
|
|
|
999
1017
|
const DEFAULT_POLL_INTERVAL_MS = 1e3;
|
|
1000
1018
|
const DEFAULT_MAX_RETRIES = 180;
|
|
1001
1019
|
var KintoneAppDeployer = class {
|
|
1020
|
+
client;
|
|
1021
|
+
appId;
|
|
1002
1022
|
pollIntervalMs;
|
|
1003
1023
|
maxRetries;
|
|
1004
1024
|
constructor(client, appId, config) {
|
|
@@ -1062,6 +1082,8 @@ var KintoneAppDeployer = class {
|
|
|
1062
1082
|
* so the `--all` early-skip compares like-with-like against the stored base.
|
|
1063
1083
|
*/
|
|
1064
1084
|
var KintoneAppRevisionReader = class {
|
|
1085
|
+
client;
|
|
1086
|
+
appId;
|
|
1065
1087
|
constructor(client, appId) {
|
|
1066
1088
|
this.client = client;
|
|
1067
1089
|
this.appId = appId;
|
|
@@ -1134,7 +1156,7 @@ const configCodec = {
|
|
|
1134
1156
|
defaultStringType: "PLAIN"
|
|
1135
1157
|
})
|
|
1136
1158
|
};
|
|
1137
|
-
const VALID_SCOPES = new Set([
|
|
1159
|
+
const VALID_SCOPES = /* @__PURE__ */ new Set([
|
|
1138
1160
|
"ALL",
|
|
1139
1161
|
"ADMIN",
|
|
1140
1162
|
"NONE"
|
|
@@ -1142,7 +1164,7 @@ const VALID_SCOPES = new Set([
|
|
|
1142
1164
|
function isCustomizationScope(value) {
|
|
1143
1165
|
return VALID_SCOPES.has(value);
|
|
1144
1166
|
}
|
|
1145
|
-
const VALID_RESOURCE_TYPES = new Set(["FILE", "URL"]);
|
|
1167
|
+
const VALID_RESOURCE_TYPES = /* @__PURE__ */ new Set(["FILE", "URL"]);
|
|
1146
1168
|
function isResourceType(value) {
|
|
1147
1169
|
return VALID_RESOURCE_TYPES.has(value);
|
|
1148
1170
|
}
|
|
@@ -1184,6 +1206,8 @@ function toKintoneResourceList(resources) {
|
|
|
1184
1206
|
return resources.map(toKintoneResource);
|
|
1185
1207
|
}
|
|
1186
1208
|
var KintoneCustomizationConfigurator = class {
|
|
1209
|
+
client;
|
|
1210
|
+
appId;
|
|
1187
1211
|
constructor(client, appId) {
|
|
1188
1212
|
this.client = client;
|
|
1189
1213
|
this.appId = appId;
|
|
@@ -1237,6 +1261,7 @@ var KintoneCustomizationConfigurator = class {
|
|
|
1237
1261
|
//#endregion
|
|
1238
1262
|
//#region src/core/adapters/kintone/fileDownloader.ts
|
|
1239
1263
|
var KintoneFileDownloader = class {
|
|
1264
|
+
client;
|
|
1240
1265
|
constructor(client) {
|
|
1241
1266
|
this.client = client;
|
|
1242
1267
|
}
|
|
@@ -1298,6 +1323,8 @@ function isSafePath(targetPath, baseDir) {
|
|
|
1298
1323
|
//#endregion
|
|
1299
1324
|
//#region src/core/adapters/kintone/fileUploader.ts
|
|
1300
1325
|
var KintoneFileUploader = class {
|
|
1326
|
+
client;
|
|
1327
|
+
baseDir;
|
|
1301
1328
|
constructor(client, baseDir) {
|
|
1302
1329
|
this.client = client;
|
|
1303
1330
|
this.baseDir = baseDir;
|
|
@@ -1364,7 +1391,7 @@ const FieldCode = { create: (code) => {
|
|
|
1364
1391
|
} };
|
|
1365
1392
|
//#endregion
|
|
1366
1393
|
//#region src/core/adapters/kintone/formConfigurator.ts
|
|
1367
|
-
const KNOWN_FIELD_TYPES = new Set([
|
|
1394
|
+
const KNOWN_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
1368
1395
|
"SINGLE_LINE_TEXT",
|
|
1369
1396
|
"MULTI_LINE_TEXT",
|
|
1370
1397
|
"RICH_TEXT",
|
|
@@ -1386,7 +1413,7 @@ const KNOWN_FIELD_TYPES = new Set([
|
|
|
1386
1413
|
"SUBTABLE",
|
|
1387
1414
|
"REFERENCE_TABLE"
|
|
1388
1415
|
]);
|
|
1389
|
-
const SYSTEM_FIELD_TYPES$2 = new Set([
|
|
1416
|
+
const SYSTEM_FIELD_TYPES$2 = /* @__PURE__ */ new Set([
|
|
1390
1417
|
"RECORD_NUMBER",
|
|
1391
1418
|
"CREATOR",
|
|
1392
1419
|
"CREATED_TIME",
|
|
@@ -1396,7 +1423,7 @@ const SYSTEM_FIELD_TYPES$2 = new Set([
|
|
|
1396
1423
|
"STATUS",
|
|
1397
1424
|
"STATUS_ASSIGNEE"
|
|
1398
1425
|
]);
|
|
1399
|
-
const DECORATION_TYPES$1 = new Set([
|
|
1426
|
+
const DECORATION_TYPES$1 = /* @__PURE__ */ new Set([
|
|
1400
1427
|
"LABEL",
|
|
1401
1428
|
"SPACER",
|
|
1402
1429
|
"HR"
|
|
@@ -1478,7 +1505,7 @@ function fromKintoneProperty(prop) {
|
|
|
1478
1505
|
...base,
|
|
1479
1506
|
type: "REFERENCE_TABLE",
|
|
1480
1507
|
properties: { referenceTable: {
|
|
1481
|
-
relatedApp: rt.relatedApp,
|
|
1508
|
+
relatedApp: { app: rt.relatedApp.app },
|
|
1482
1509
|
condition: {
|
|
1483
1510
|
field: FieldCode.create(condition.field),
|
|
1484
1511
|
relatedField: FieldCode.create(condition.relatedField)
|
|
@@ -1690,6 +1717,8 @@ const GET_LAYOUT_FAILURE_MESSAGES = {
|
|
|
1690
1717
|
published: "Failed to get published form layout (the app may not be deployed yet, or the credentials may not be allowed to read it)"
|
|
1691
1718
|
};
|
|
1692
1719
|
var KintoneFormConfigurator = class {
|
|
1720
|
+
client;
|
|
1721
|
+
appId;
|
|
1693
1722
|
revisionTracker;
|
|
1694
1723
|
constructor(client, appId, revisionTracker) {
|
|
1695
1724
|
this.client = client;
|
|
@@ -1807,7 +1836,7 @@ var KintoneFormConfigurator = class {
|
|
|
1807
1836
|
};
|
|
1808
1837
|
//#endregion
|
|
1809
1838
|
//#region src/core/adapters/kintone/recordConverter.ts
|
|
1810
|
-
const SYSTEM_FIELDS = new Set([
|
|
1839
|
+
const SYSTEM_FIELDS = /* @__PURE__ */ new Set([
|
|
1811
1840
|
"$id",
|
|
1812
1841
|
"$revision",
|
|
1813
1842
|
"RECORD_NUMBER",
|
|
@@ -1819,7 +1848,7 @@ const SYSTEM_FIELDS = new Set([
|
|
|
1819
1848
|
"STATUS_ASSIGNEE",
|
|
1820
1849
|
"CATEGORY"
|
|
1821
1850
|
]);
|
|
1822
|
-
const SYSTEM_FIELD_TYPES$1 = new Set([
|
|
1851
|
+
const SYSTEM_FIELD_TYPES$1 = /* @__PURE__ */ new Set([
|
|
1823
1852
|
"RECORD_NUMBER",
|
|
1824
1853
|
"__ID__",
|
|
1825
1854
|
"__REVISION__",
|
|
@@ -1904,6 +1933,8 @@ function extractId(record) {
|
|
|
1904
1933
|
return $id.value;
|
|
1905
1934
|
}
|
|
1906
1935
|
var KintoneRecordManager = class {
|
|
1936
|
+
client;
|
|
1937
|
+
appId;
|
|
1907
1938
|
constructor(client, appId) {
|
|
1908
1939
|
this.client = client;
|
|
1909
1940
|
this.appId = appId;
|
|
@@ -1992,6 +2023,7 @@ var LocalFileContentReader = class {
|
|
|
1992
2023
|
//#endregion
|
|
1993
2024
|
//#region src/core/adapters/local/fileWriter.ts
|
|
1994
2025
|
var LocalFileWriter = class {
|
|
2026
|
+
baseDir;
|
|
1995
2027
|
constructor(baseDir = process.cwd()) {
|
|
1996
2028
|
this.baseDir = baseDir;
|
|
1997
2029
|
}
|
|
@@ -2042,9 +2074,10 @@ function createCliContainer(config) {
|
|
|
2042
2074
|
};
|
|
2043
2075
|
}
|
|
2044
2076
|
function createSeedCliContainer(config) {
|
|
2077
|
+
const client = config.client ?? createKintoneClient(config);
|
|
2045
2078
|
return {
|
|
2046
2079
|
configCodec,
|
|
2047
|
-
recordManager: new KintoneRecordManager(
|
|
2080
|
+
recordManager: new KintoneRecordManager(client, config.appId),
|
|
2048
2081
|
seedStorage: createLocalFileSeedStorage(config.seedFilePath)
|
|
2049
2082
|
};
|
|
2050
2083
|
}
|
|
@@ -2334,7 +2367,7 @@ async function executeMultiApp(plan, executor) {
|
|
|
2334
2367
|
}
|
|
2335
2368
|
//#endregion
|
|
2336
2369
|
//#region src/core/domain/projectConfig/valueObject.ts
|
|
2337
|
-
const INVALID_APP_NAME_CHARS = new Set([
|
|
2370
|
+
const INVALID_APP_NAME_CHARS = /* @__PURE__ */ new Set([
|
|
2338
2371
|
"/",
|
|
2339
2372
|
"\\",
|
|
2340
2373
|
":",
|
|
@@ -2818,9 +2851,7 @@ function printMultiAppResult(result) {
|
|
|
2818
2851
|
case "skipped":
|
|
2819
2852
|
p.log.warn(` ${pc.dim("-")} Skipped: ${r.name}`);
|
|
2820
2853
|
break;
|
|
2821
|
-
default:
|
|
2822
|
-
r.status;
|
|
2823
|
-
break;
|
|
2854
|
+
default: r.status;
|
|
2824
2855
|
}
|
|
2825
2856
|
}
|
|
2826
2857
|
async function confirmAndDeploy(containers, skipConfirm, successMessage = "Deployed to production.") {
|
|
@@ -3485,14 +3516,11 @@ function buildRecordThreeWayDiff(merge, label, extras = [], notes = []) {
|
|
|
3485
3516
|
kind: "remoteOnly"
|
|
3486
3517
|
});
|
|
3487
3518
|
break;
|
|
3488
|
-
case "conflict":
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
});
|
|
3494
|
-
break;
|
|
3495
|
-
default: break;
|
|
3519
|
+
case "conflict": conflicts.push({
|
|
3520
|
+
key: entry.key,
|
|
3521
|
+
label: label(entry),
|
|
3522
|
+
kind: "conflict"
|
|
3523
|
+
});
|
|
3496
3524
|
}
|
|
3497
3525
|
const isEmpty = localChanges.length === 0 && remoteDrift.length === 0 && conflicts.length === 0 && extras.length === 0;
|
|
3498
3526
|
return {
|
|
@@ -3531,13 +3559,10 @@ function buildSingleThreeWayDiff(merge, key) {
|
|
|
3531
3559
|
kind: "remoteOnly"
|
|
3532
3560
|
});
|
|
3533
3561
|
break;
|
|
3534
|
-
case "conflict":
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
});
|
|
3539
|
-
break;
|
|
3540
|
-
default: break;
|
|
3562
|
+
case "conflict": conflicts.push({
|
|
3563
|
+
...entry,
|
|
3564
|
+
kind: "conflict"
|
|
3565
|
+
});
|
|
3541
3566
|
}
|
|
3542
3567
|
return {
|
|
3543
3568
|
mode: "three-way",
|
|
@@ -4128,6 +4153,22 @@ function createPushCommand(config) {
|
|
|
4128
4153
|
});
|
|
4129
4154
|
}
|
|
4130
4155
|
//#endregion
|
|
4156
|
+
//#region src/cli/commands/action/push.ts
|
|
4157
|
+
var push_default$14 = createPushCommand({
|
|
4158
|
+
description: "Push the local action config to kintone (with drift detection)",
|
|
4159
|
+
args: actionArgs,
|
|
4160
|
+
subject: "action config",
|
|
4161
|
+
spinnerStopMessage: "Actions pushed to preview.",
|
|
4162
|
+
createContainer: createActionCliContainer,
|
|
4163
|
+
pushFn: pushAction,
|
|
4164
|
+
toctouMessage: "The remote changed while applying. Run `action pull` and retry.",
|
|
4165
|
+
onResult: (result) => {
|
|
4166
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
4167
|
+
},
|
|
4168
|
+
resolveContainerConfig: resolveActionContainerConfig,
|
|
4169
|
+
resolveAppContainerConfig: resolveActionAppContainerConfig
|
|
4170
|
+
});
|
|
4171
|
+
//#endregion
|
|
4131
4172
|
//#region src/cli/commands/action/index.ts
|
|
4132
4173
|
var action_default = define({
|
|
4133
4174
|
name: "action",
|
|
@@ -4137,20 +4178,7 @@ var action_default = define({
|
|
|
4137
4178
|
capture: capture_default$14,
|
|
4138
4179
|
diff: diff_default$13,
|
|
4139
4180
|
pull: pull_default$13,
|
|
4140
|
-
push:
|
|
4141
|
-
description: "Push the local action config to kintone (with drift detection)",
|
|
4142
|
-
args: actionArgs,
|
|
4143
|
-
subject: "action config",
|
|
4144
|
-
spinnerStopMessage: "Actions pushed to preview.",
|
|
4145
|
-
createContainer: createActionCliContainer,
|
|
4146
|
-
pushFn: pushAction,
|
|
4147
|
-
toctouMessage: "The remote changed while applying. Run `action pull` and retry.",
|
|
4148
|
-
onResult: (result) => {
|
|
4149
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
4150
|
-
},
|
|
4151
|
-
resolveContainerConfig: resolveActionContainerConfig,
|
|
4152
|
-
resolveAppContainerConfig: resolveActionAppContainerConfig
|
|
4153
|
-
})
|
|
4181
|
+
push: push_default$14
|
|
4154
4182
|
},
|
|
4155
4183
|
run: () => {}
|
|
4156
4184
|
});
|
|
@@ -4225,6 +4253,8 @@ async function detectAdminNotesDiff({ container }) {
|
|
|
4225
4253
|
//#endregion
|
|
4226
4254
|
//#region src/core/adapters/kintone/adminNotesConfigurator.ts
|
|
4227
4255
|
var KintoneAdminNotesConfigurator = class {
|
|
4256
|
+
client;
|
|
4257
|
+
appId;
|
|
4228
4258
|
constructor(client, appId) {
|
|
4229
4259
|
this.client = client;
|
|
4230
4260
|
this.appId = appId;
|
|
@@ -4669,6 +4699,22 @@ async function pushAdminNotes({ container, input }) {
|
|
|
4669
4699
|
};
|
|
4670
4700
|
}
|
|
4671
4701
|
//#endregion
|
|
4702
|
+
//#region src/cli/commands/admin-notes/push.ts
|
|
4703
|
+
var push_default$13 = createPushCommand({
|
|
4704
|
+
description: "Push the local admin notes config to kintone (with drift detection)",
|
|
4705
|
+
args: adminNotesArgs,
|
|
4706
|
+
subject: "admin notes config",
|
|
4707
|
+
spinnerStopMessage: "Admin notes pushed to preview.",
|
|
4708
|
+
createContainer: createAdminNotesCliContainer,
|
|
4709
|
+
pushFn: pushAdminNotes,
|
|
4710
|
+
toctouMessage: "The remote changed while applying. Run `admin-notes pull` and retry.",
|
|
4711
|
+
onResult: (result) => {
|
|
4712
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
4713
|
+
},
|
|
4714
|
+
resolveContainerConfig: resolveAdminNotesContainerConfig,
|
|
4715
|
+
resolveAppContainerConfig: resolveAdminNotesAppContainerConfig
|
|
4716
|
+
});
|
|
4717
|
+
//#endregion
|
|
4672
4718
|
//#region src/cli/commands/admin-notes/index.ts
|
|
4673
4719
|
var admin_notes_default = define({
|
|
4674
4720
|
name: "admin-notes",
|
|
@@ -4678,26 +4724,13 @@ var admin_notes_default = define({
|
|
|
4678
4724
|
capture: capture_default$13,
|
|
4679
4725
|
diff: diff_default$12,
|
|
4680
4726
|
pull: pull_default$12,
|
|
4681
|
-
push:
|
|
4682
|
-
description: "Push the local admin notes config to kintone (with drift detection)",
|
|
4683
|
-
args: adminNotesArgs,
|
|
4684
|
-
subject: "admin notes config",
|
|
4685
|
-
spinnerStopMessage: "Admin notes pushed to preview.",
|
|
4686
|
-
createContainer: createAdminNotesCliContainer,
|
|
4687
|
-
pushFn: pushAdminNotes,
|
|
4688
|
-
toctouMessage: "The remote changed while applying. Run `admin-notes pull` and retry.",
|
|
4689
|
-
onResult: (result) => {
|
|
4690
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
4691
|
-
},
|
|
4692
|
-
resolveContainerConfig: resolveAdminNotesContainerConfig,
|
|
4693
|
-
resolveAppContainerConfig: resolveAdminNotesAppContainerConfig
|
|
4694
|
-
})
|
|
4727
|
+
push: push_default$13
|
|
4695
4728
|
},
|
|
4696
4729
|
run: () => {}
|
|
4697
4730
|
});
|
|
4698
4731
|
//#endregion
|
|
4699
4732
|
//#region src/core/domain/appPermission/services/configParser.ts
|
|
4700
|
-
const VALID_ENTITY_TYPES$8 = new Set([
|
|
4733
|
+
const VALID_ENTITY_TYPES$8 = /* @__PURE__ */ new Set([
|
|
4701
4734
|
"USER",
|
|
4702
4735
|
"GROUP",
|
|
4703
4736
|
"ORGANIZATION",
|
|
@@ -4822,7 +4855,7 @@ async function detectAppPermissionDiff({ container }) {
|
|
|
4822
4855
|
}
|
|
4823
4856
|
//#endregion
|
|
4824
4857
|
//#region src/core/adapters/kintone/appPermissionConfigurator.ts
|
|
4825
|
-
const VALID_ENTITY_TYPES$7 = new Set([
|
|
4858
|
+
const VALID_ENTITY_TYPES$7 = /* @__PURE__ */ new Set([
|
|
4826
4859
|
"USER",
|
|
4827
4860
|
"GROUP",
|
|
4828
4861
|
"ORGANIZATION",
|
|
@@ -4869,6 +4902,8 @@ function toKintoneRight$2(right) {
|
|
|
4869
4902
|
};
|
|
4870
4903
|
}
|
|
4871
4904
|
var KintoneAppPermissionConfigurator = class {
|
|
4905
|
+
client;
|
|
4906
|
+
appId;
|
|
4872
4907
|
constructor(client, appId) {
|
|
4873
4908
|
this.client = client;
|
|
4874
4909
|
this.appId = appId;
|
|
@@ -5320,6 +5355,22 @@ async function pushAppPermission({ container, input }) {
|
|
|
5320
5355
|
};
|
|
5321
5356
|
}
|
|
5322
5357
|
//#endregion
|
|
5358
|
+
//#region src/cli/commands/app-acl/push.ts
|
|
5359
|
+
var push_default$12 = createPushCommand({
|
|
5360
|
+
description: "Push the local app permission config to kintone (with drift detection)",
|
|
5361
|
+
args: appAclArgs,
|
|
5362
|
+
subject: "app permission config",
|
|
5363
|
+
spinnerStopMessage: "App permissions pushed to preview.",
|
|
5364
|
+
createContainer: createAppPermissionCliContainer,
|
|
5365
|
+
pushFn: pushAppPermission,
|
|
5366
|
+
toctouMessage: "The remote changed while applying. Run `app-acl pull` and retry.",
|
|
5367
|
+
onResult: (result) => {
|
|
5368
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
5369
|
+
},
|
|
5370
|
+
resolveContainerConfig: resolveAppAclContainerConfig,
|
|
5371
|
+
resolveAppContainerConfig: resolveAppAclAppContainerConfig
|
|
5372
|
+
});
|
|
5373
|
+
//#endregion
|
|
5323
5374
|
//#region src/cli/commands/app-acl/index.ts
|
|
5324
5375
|
var app_acl_default = define({
|
|
5325
5376
|
name: "app-acl",
|
|
@@ -5329,20 +5380,7 @@ var app_acl_default = define({
|
|
|
5329
5380
|
capture: capture_default$12,
|
|
5330
5381
|
diff: diff_default$11,
|
|
5331
5382
|
pull: pull_default$11,
|
|
5332
|
-
push:
|
|
5333
|
-
description: "Push the local app permission config to kintone (with drift detection)",
|
|
5334
|
-
args: appAclArgs,
|
|
5335
|
-
subject: "app permission config",
|
|
5336
|
-
spinnerStopMessage: "App permissions pushed to preview.",
|
|
5337
|
-
createContainer: createAppPermissionCliContainer,
|
|
5338
|
-
pushFn: pushAppPermission,
|
|
5339
|
-
toctouMessage: "The remote changed while applying. Run `app-acl pull` and retry.",
|
|
5340
|
-
onResult: (result) => {
|
|
5341
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
5342
|
-
},
|
|
5343
|
-
resolveContainerConfig: resolveAppAclContainerConfig,
|
|
5344
|
-
resolveAppContainerConfig: resolveAppAclAppContainerConfig
|
|
5345
|
-
})
|
|
5383
|
+
push: push_default$12
|
|
5346
5384
|
},
|
|
5347
5385
|
run: () => {}
|
|
5348
5386
|
});
|
|
@@ -5484,12 +5522,12 @@ async function applyCustomization({ container, input }) {
|
|
|
5484
5522
|
}
|
|
5485
5523
|
//#endregion
|
|
5486
5524
|
//#region src/core/domain/fieldPermission/services/configParser.ts
|
|
5487
|
-
const VALID_ACCESSIBILITIES$1 = new Set([
|
|
5525
|
+
const VALID_ACCESSIBILITIES$1 = /* @__PURE__ */ new Set([
|
|
5488
5526
|
"READ",
|
|
5489
5527
|
"WRITE",
|
|
5490
5528
|
"NONE"
|
|
5491
5529
|
]);
|
|
5492
|
-
const VALID_ENTITY_TYPES$6 = new Set([
|
|
5530
|
+
const VALID_ENTITY_TYPES$6 = /* @__PURE__ */ new Set([
|
|
5493
5531
|
"USER",
|
|
5494
5532
|
"GROUP",
|
|
5495
5533
|
"ORGANIZATION",
|
|
@@ -5608,7 +5646,7 @@ function describePropertiesChanges(before, after) {
|
|
|
5608
5646
|
}
|
|
5609
5647
|
const bProps = before.properties;
|
|
5610
5648
|
const aProps = after.properties;
|
|
5611
|
-
const allKeys = new Set([...Object.keys(bProps), ...Object.keys(aProps)]);
|
|
5649
|
+
const allKeys = /* @__PURE__ */ new Set([...Object.keys(bProps), ...Object.keys(aProps)]);
|
|
5612
5650
|
const propChanges = [];
|
|
5613
5651
|
for (const key of allKeys) if (!deepEqual(bProps[key], aProps[key])) propChanges.push(`${key}: ${formatValue(bProps[key])} -> ${formatValue(aProps[key])}`);
|
|
5614
5652
|
return propChanges;
|
|
@@ -5793,19 +5831,19 @@ async function applySchemaChanges(schema, { container, expectedRevision }) {
|
|
|
5793
5831
|
}
|
|
5794
5832
|
//#endregion
|
|
5795
5833
|
//#region src/core/domain/formSchema/services/schemaValidator.ts
|
|
5796
|
-
const SELECTION_TYPES = new Set([
|
|
5834
|
+
const SELECTION_TYPES = /* @__PURE__ */ new Set([
|
|
5797
5835
|
"CHECK_BOX",
|
|
5798
5836
|
"RADIO_BUTTON",
|
|
5799
5837
|
"MULTI_SELECT",
|
|
5800
5838
|
"DROP_DOWN"
|
|
5801
5839
|
]);
|
|
5802
|
-
const VALID_THUMBNAIL_SIZES = new Set([
|
|
5840
|
+
const VALID_THUMBNAIL_SIZES = /* @__PURE__ */ new Set([
|
|
5803
5841
|
"50",
|
|
5804
5842
|
"150",
|
|
5805
5843
|
"250",
|
|
5806
5844
|
"500"
|
|
5807
5845
|
]);
|
|
5808
|
-
const VALID_REFERENCE_TABLE_SIZES = new Set([
|
|
5846
|
+
const VALID_REFERENCE_TABLE_SIZES = /* @__PURE__ */ new Set([
|
|
5809
5847
|
"1",
|
|
5810
5848
|
"3",
|
|
5811
5849
|
"5",
|
|
@@ -5815,7 +5853,7 @@ const VALID_REFERENCE_TABLE_SIZES = new Set([
|
|
|
5815
5853
|
"40",
|
|
5816
5854
|
"50"
|
|
5817
5855
|
]);
|
|
5818
|
-
const LOOKUP_FIELD_TYPES = new Set([
|
|
5856
|
+
const LOOKUP_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
5819
5857
|
"SINGLE_LINE_TEXT",
|
|
5820
5858
|
"NUMBER",
|
|
5821
5859
|
"LINK"
|
|
@@ -5949,8 +5987,8 @@ const Schema = { create: (fields, layout) => {
|
|
|
5949
5987
|
} };
|
|
5950
5988
|
//#endregion
|
|
5951
5989
|
//#region src/core/domain/formSchema/services/schemaParser.ts
|
|
5952
|
-
const VALID_UNIT_POSITIONS = new Set(["BEFORE", "AFTER"]);
|
|
5953
|
-
const VALID_CALC_FORMATS = new Set([
|
|
5990
|
+
const VALID_UNIT_POSITIONS = /* @__PURE__ */ new Set(["BEFORE", "AFTER"]);
|
|
5991
|
+
const VALID_CALC_FORMATS = /* @__PURE__ */ new Set([
|
|
5954
5992
|
"NUMBER",
|
|
5955
5993
|
"NUMBER_DIGIT",
|
|
5956
5994
|
"DATE",
|
|
@@ -5959,8 +5997,8 @@ const VALID_CALC_FORMATS = new Set([
|
|
|
5959
5997
|
"HOUR_MINUTE",
|
|
5960
5998
|
"DAY_HOUR_MINUTE"
|
|
5961
5999
|
]);
|
|
5962
|
-
const VALID_SELECTION_ALIGNS = new Set(["HORIZONTAL", "VERTICAL"]);
|
|
5963
|
-
const VALID_LINK_PROTOCOLS = new Set([
|
|
6000
|
+
const VALID_SELECTION_ALIGNS = /* @__PURE__ */ new Set(["HORIZONTAL", "VERTICAL"]);
|
|
6001
|
+
const VALID_LINK_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
5964
6002
|
"WEB",
|
|
5965
6003
|
"CALL",
|
|
5966
6004
|
"MAIL"
|
|
@@ -5983,12 +6021,10 @@ function validateFieldProperties(code, fieldType, properties) {
|
|
|
5983
6021
|
case "DROP_DOWN":
|
|
5984
6022
|
validateEnumProperty(code, "align", properties.align, VALID_SELECTION_ALIGNS);
|
|
5985
6023
|
break;
|
|
5986
|
-
case "LINK":
|
|
5987
|
-
validateEnumProperty(code, "protocol", properties.protocol, VALID_LINK_PROTOCOLS);
|
|
5988
|
-
break;
|
|
6024
|
+
case "LINK": validateEnumProperty(code, "protocol", properties.protocol, VALID_LINK_PROTOCOLS);
|
|
5989
6025
|
}
|
|
5990
6026
|
}
|
|
5991
|
-
const VALID_FIELD_TYPES = new Set([
|
|
6027
|
+
const VALID_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
5992
6028
|
"SINGLE_LINE_TEXT",
|
|
5993
6029
|
"MULTI_LINE_TEXT",
|
|
5994
6030
|
"RICH_TEXT",
|
|
@@ -6010,12 +6046,12 @@ const VALID_FIELD_TYPES = new Set([
|
|
|
6010
6046
|
"SUBTABLE",
|
|
6011
6047
|
"REFERENCE_TABLE"
|
|
6012
6048
|
]);
|
|
6013
|
-
const DECORATION_TYPES = new Set([
|
|
6049
|
+
const DECORATION_TYPES = /* @__PURE__ */ new Set([
|
|
6014
6050
|
"LABEL",
|
|
6015
6051
|
"SPACER",
|
|
6016
6052
|
"HR"
|
|
6017
6053
|
]);
|
|
6018
|
-
const SYSTEM_FIELD_TYPES = new Set([
|
|
6054
|
+
const SYSTEM_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
6019
6055
|
"RECORD_NUMBER",
|
|
6020
6056
|
"CREATOR",
|
|
6021
6057
|
"CREATED_TIME",
|
|
@@ -6025,16 +6061,16 @@ const SYSTEM_FIELD_TYPES = new Set([
|
|
|
6025
6061
|
"STATUS",
|
|
6026
6062
|
"STATUS_ASSIGNEE"
|
|
6027
6063
|
]);
|
|
6028
|
-
const BASE_ATTRIBUTES = new Set([
|
|
6064
|
+
const BASE_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
6029
6065
|
"code",
|
|
6030
6066
|
"type",
|
|
6031
6067
|
"label",
|
|
6032
6068
|
"noLabel"
|
|
6033
6069
|
]);
|
|
6034
|
-
const LAYOUT_ATTRIBUTES = new Set(["size"]);
|
|
6035
|
-
const DECORATION_ATTRIBUTES = new Set(["elementId"]);
|
|
6036
|
-
const GROUP_ATTRIBUTES = new Set(["openGroup", "layout"]);
|
|
6037
|
-
const SUBTABLE_ATTRIBUTES = new Set(["fields"]);
|
|
6070
|
+
const LAYOUT_ATTRIBUTES = /* @__PURE__ */ new Set(["size"]);
|
|
6071
|
+
const DECORATION_ATTRIBUTES = /* @__PURE__ */ new Set(["elementId"]);
|
|
6072
|
+
const GROUP_ATTRIBUTES = /* @__PURE__ */ new Set(["openGroup", "layout"]);
|
|
6073
|
+
const SUBTABLE_ATTRIBUTES = /* @__PURE__ */ new Set(["fields"]);
|
|
6038
6074
|
/**
|
|
6039
6075
|
* Parses a raw size object into an ElementSize.
|
|
6040
6076
|
* Returns undefined when no size properties are present, treating an empty
|
|
@@ -6051,7 +6087,7 @@ function parseSize(raw) {
|
|
|
6051
6087
|
...obj.innerHeight !== void 0 ? { innerHeight: String(obj.innerHeight) } : {}
|
|
6052
6088
|
};
|
|
6053
6089
|
}
|
|
6054
|
-
const BOOLEAN_PROPERTIES = new Set([
|
|
6090
|
+
const BOOLEAN_PROPERTIES = /* @__PURE__ */ new Set([
|
|
6055
6091
|
"required",
|
|
6056
6092
|
"unique",
|
|
6057
6093
|
"digit",
|
|
@@ -6440,7 +6476,7 @@ function parseOptionalBoolean(parsed, fieldName) {
|
|
|
6440
6476
|
if (value === void 0 || value === null) return void 0;
|
|
6441
6477
|
return parseStrictBoolean(value, fieldName, "Config", GeneralSettingsErrorCode.GsInvalidBooleanField);
|
|
6442
6478
|
}
|
|
6443
|
-
const VALID_THEMES$1 = new Set([
|
|
6479
|
+
const VALID_THEMES$1 = /* @__PURE__ */ new Set([
|
|
6444
6480
|
"WHITE",
|
|
6445
6481
|
"RED",
|
|
6446
6482
|
"GREEN",
|
|
@@ -6452,9 +6488,9 @@ const VALID_THEMES$1 = new Set([
|
|
|
6452
6488
|
"PENCIL",
|
|
6453
6489
|
"CLIPS"
|
|
6454
6490
|
]);
|
|
6455
|
-
const VALID_ICON_TYPES$1 = new Set(["PRESET", "FILE"]);
|
|
6456
|
-
const VALID_SELECTION_MODES$1 = new Set(["AUTO", "MANUAL"]);
|
|
6457
|
-
const VALID_ROUNDING_MODES$1 = new Set([
|
|
6491
|
+
const VALID_ICON_TYPES$1 = /* @__PURE__ */ new Set(["PRESET", "FILE"]);
|
|
6492
|
+
const VALID_SELECTION_MODES$1 = /* @__PURE__ */ new Set(["AUTO", "MANUAL"]);
|
|
6493
|
+
const VALID_ROUNDING_MODES$1 = /* @__PURE__ */ new Set([
|
|
6458
6494
|
"HALF_EVEN",
|
|
6459
6495
|
"UP",
|
|
6460
6496
|
"DOWN"
|
|
@@ -6555,7 +6591,7 @@ async function applyGeneralSettings({ container }) {
|
|
|
6555
6591
|
notFoundMessage: "General settings config file not found"
|
|
6556
6592
|
});
|
|
6557
6593
|
}
|
|
6558
|
-
const VALID_ENTITY_TYPES$5 = new Set([
|
|
6594
|
+
const VALID_ENTITY_TYPES$5 = /* @__PURE__ */ new Set([
|
|
6559
6595
|
"USER",
|
|
6560
6596
|
"GROUP",
|
|
6561
6597
|
"ORGANIZATION",
|
|
@@ -6776,12 +6812,12 @@ async function applyPlugin({ container }) {
|
|
|
6776
6812
|
}
|
|
6777
6813
|
//#endregion
|
|
6778
6814
|
//#region src/core/domain/processManagement/services/configParser.ts
|
|
6779
|
-
const VALID_ASSIGNEE_TYPES$1 = new Set([
|
|
6815
|
+
const VALID_ASSIGNEE_TYPES$1 = /* @__PURE__ */ new Set([
|
|
6780
6816
|
"ONE",
|
|
6781
6817
|
"ALL",
|
|
6782
6818
|
"ANY"
|
|
6783
6819
|
]);
|
|
6784
|
-
const VALID_ENTITY_TYPES$4 = new Set([
|
|
6820
|
+
const VALID_ENTITY_TYPES$4 = /* @__PURE__ */ new Set([
|
|
6785
6821
|
"USER",
|
|
6786
6822
|
"GROUP",
|
|
6787
6823
|
"ORGANIZATION",
|
|
@@ -6789,7 +6825,7 @@ const VALID_ENTITY_TYPES$4 = new Set([
|
|
|
6789
6825
|
"CREATOR",
|
|
6790
6826
|
"CUSTOM_FIELD"
|
|
6791
6827
|
]);
|
|
6792
|
-
const VALID_ACTION_TYPES$1 = new Set(["PRIMARY", "SECONDARY"]);
|
|
6828
|
+
const VALID_ACTION_TYPES$1 = /* @__PURE__ */ new Set(["PRIMARY", "SECONDARY"]);
|
|
6793
6829
|
function parseProcessEntity(raw, index) {
|
|
6794
6830
|
if (!isRecord(raw)) throw new BusinessRuleError(ProcessManagementErrorCode.PmInvalidConfigStructure, `Entity at index ${index} must be an object`);
|
|
6795
6831
|
const result = { type: parseEnum(raw.type, VALID_ENTITY_TYPES$4, ProcessManagementErrorCode.PmInvalidEntityType, `Entity at index ${index} has invalid type: ${String(raw.type)}. Must be USER, GROUP, ORGANIZATION, FIELD_ENTITY, CREATOR, or CUSTOM_FIELD`) };
|
|
@@ -6895,7 +6931,7 @@ async function applyProcessManagement({ container }) {
|
|
|
6895
6931
|
}
|
|
6896
6932
|
//#endregion
|
|
6897
6933
|
//#region src/core/domain/recordPermission/services/configParser.ts
|
|
6898
|
-
const VALID_ENTITY_TYPES$3 = new Set([
|
|
6934
|
+
const VALID_ENTITY_TYPES$3 = /* @__PURE__ */ new Set([
|
|
6899
6935
|
"USER",
|
|
6900
6936
|
"GROUP",
|
|
6901
6937
|
"ORGANIZATION",
|
|
@@ -6965,7 +7001,7 @@ async function applyRecordPermission({ container }) {
|
|
|
6965
7001
|
notFoundMessage: "Record permission config file not found"
|
|
6966
7002
|
});
|
|
6967
7003
|
}
|
|
6968
|
-
const VALID_CHART_TYPES = new Set([
|
|
7004
|
+
const VALID_CHART_TYPES = /* @__PURE__ */ new Set([
|
|
6969
7005
|
"BAR",
|
|
6970
7006
|
"COLUMN",
|
|
6971
7007
|
"PIE",
|
|
@@ -6979,7 +7015,7 @@ const VALID_CHART_TYPES = new Set([
|
|
|
6979
7015
|
function isChartType(value) {
|
|
6980
7016
|
return VALID_CHART_TYPES.has(value);
|
|
6981
7017
|
}
|
|
6982
|
-
const VALID_CHART_MODES = new Set([
|
|
7018
|
+
const VALID_CHART_MODES = /* @__PURE__ */ new Set([
|
|
6983
7019
|
"NORMAL",
|
|
6984
7020
|
"STACKED",
|
|
6985
7021
|
"PERCENTAGE"
|
|
@@ -6987,7 +7023,7 @@ const VALID_CHART_MODES = new Set([
|
|
|
6987
7023
|
function isChartMode(value) {
|
|
6988
7024
|
return VALID_CHART_MODES.has(value);
|
|
6989
7025
|
}
|
|
6990
|
-
const VALID_GROUP_PERS = new Set([
|
|
7026
|
+
const VALID_GROUP_PERS = /* @__PURE__ */ new Set([
|
|
6991
7027
|
"YEAR",
|
|
6992
7028
|
"QUARTER",
|
|
6993
7029
|
"MONTH",
|
|
@@ -6999,7 +7035,7 @@ const VALID_GROUP_PERS = new Set([
|
|
|
6999
7035
|
function isGroupPer(value) {
|
|
7000
7036
|
return VALID_GROUP_PERS.has(value);
|
|
7001
7037
|
}
|
|
7002
|
-
const VALID_AGGREGATION_TYPES = new Set([
|
|
7038
|
+
const VALID_AGGREGATION_TYPES = /* @__PURE__ */ new Set([
|
|
7003
7039
|
"COUNT",
|
|
7004
7040
|
"SUM",
|
|
7005
7041
|
"AVERAGE",
|
|
@@ -7009,7 +7045,7 @@ const VALID_AGGREGATION_TYPES = new Set([
|
|
|
7009
7045
|
function isAggregationType(value) {
|
|
7010
7046
|
return VALID_AGGREGATION_TYPES.has(value);
|
|
7011
7047
|
}
|
|
7012
|
-
const VALID_SORT_BYS = new Set([
|
|
7048
|
+
const VALID_SORT_BYS = /* @__PURE__ */ new Set([
|
|
7013
7049
|
"TOTAL",
|
|
7014
7050
|
"GROUP1",
|
|
7015
7051
|
"GROUP2",
|
|
@@ -7018,11 +7054,11 @@ const VALID_SORT_BYS = new Set([
|
|
|
7018
7054
|
function isSortBy(value) {
|
|
7019
7055
|
return VALID_SORT_BYS.has(value);
|
|
7020
7056
|
}
|
|
7021
|
-
const VALID_SORT_ORDERS = new Set(["ASC", "DESC"]);
|
|
7057
|
+
const VALID_SORT_ORDERS = /* @__PURE__ */ new Set(["ASC", "DESC"]);
|
|
7022
7058
|
function isSortOrder(value) {
|
|
7023
7059
|
return VALID_SORT_ORDERS.has(value);
|
|
7024
7060
|
}
|
|
7025
|
-
const VALID_PERIODIC_REPORT_EVERYS = new Set([
|
|
7061
|
+
const VALID_PERIODIC_REPORT_EVERYS = /* @__PURE__ */ new Set([
|
|
7026
7062
|
"YEAR",
|
|
7027
7063
|
"QUARTER",
|
|
7028
7064
|
"MONTH",
|
|
@@ -7033,7 +7069,7 @@ const VALID_PERIODIC_REPORT_EVERYS = new Set([
|
|
|
7033
7069
|
function isPeriodicReportEvery(value) {
|
|
7034
7070
|
return VALID_PERIODIC_REPORT_EVERYS.has(value);
|
|
7035
7071
|
}
|
|
7036
|
-
const VALID_PERIODIC_REPORT_PATTERNS = new Set([
|
|
7072
|
+
const VALID_PERIODIC_REPORT_PATTERNS = /* @__PURE__ */ new Set([
|
|
7037
7073
|
"JAN_APR_JUL_OCT",
|
|
7038
7074
|
"FEB_MAY_AUG_NOV",
|
|
7039
7075
|
"MAR_JUN_SEP_DEC"
|
|
@@ -7041,7 +7077,7 @@ const VALID_PERIODIC_REPORT_PATTERNS = new Set([
|
|
|
7041
7077
|
function isPeriodicReportPattern(value) {
|
|
7042
7078
|
return VALID_PERIODIC_REPORT_PATTERNS.has(value);
|
|
7043
7079
|
}
|
|
7044
|
-
const VALID_DAYS_OF_WEEK = new Set([
|
|
7080
|
+
const VALID_DAYS_OF_WEEK = /* @__PURE__ */ new Set([
|
|
7045
7081
|
"SUNDAY",
|
|
7046
7082
|
"MONDAY",
|
|
7047
7083
|
"TUESDAY",
|
|
@@ -7362,7 +7398,7 @@ async function upsertSeed({ container, input }) {
|
|
|
7362
7398
|
total: plan.toAdd.length + plan.toUpdate.length + plan.unchanged
|
|
7363
7399
|
};
|
|
7364
7400
|
}
|
|
7365
|
-
const VALID_VIEW_TYPES = new Set([
|
|
7401
|
+
const VALID_VIEW_TYPES = /* @__PURE__ */ new Set([
|
|
7366
7402
|
"LIST",
|
|
7367
7403
|
"CALENDAR",
|
|
7368
7404
|
"CUSTOM"
|
|
@@ -7370,7 +7406,7 @@ const VALID_VIEW_TYPES = new Set([
|
|
|
7370
7406
|
function isViewType(value) {
|
|
7371
7407
|
return VALID_VIEW_TYPES.has(value);
|
|
7372
7408
|
}
|
|
7373
|
-
const VALID_DEVICE_TYPES = new Set(["DESKTOP", "ANY"]);
|
|
7409
|
+
const VALID_DEVICE_TYPES = /* @__PURE__ */ new Set(["DESKTOP", "ANY"]);
|
|
7374
7410
|
function isDeviceType(value) {
|
|
7375
7411
|
return VALID_DEVICE_TYPES.has(value);
|
|
7376
7412
|
}
|
|
@@ -7755,12 +7791,12 @@ async function applyAllForApp(args) {
|
|
|
7755
7791
|
}
|
|
7756
7792
|
//#endregion
|
|
7757
7793
|
//#region src/core/adapters/kintone/fieldPermissionConfigurator.ts
|
|
7758
|
-
const VALID_ACCESSIBILITIES = new Set([
|
|
7794
|
+
const VALID_ACCESSIBILITIES = /* @__PURE__ */ new Set([
|
|
7759
7795
|
"READ",
|
|
7760
7796
|
"WRITE",
|
|
7761
7797
|
"NONE"
|
|
7762
7798
|
]);
|
|
7763
|
-
const VALID_ENTITY_TYPES$2 = new Set([
|
|
7799
|
+
const VALID_ENTITY_TYPES$2 = /* @__PURE__ */ new Set([
|
|
7764
7800
|
"USER",
|
|
7765
7801
|
"GROUP",
|
|
7766
7802
|
"ORGANIZATION",
|
|
@@ -7806,6 +7842,8 @@ function toKintoneRight$1(right) {
|
|
|
7806
7842
|
};
|
|
7807
7843
|
}
|
|
7808
7844
|
var KintoneFieldPermissionConfigurator = class {
|
|
7845
|
+
client;
|
|
7846
|
+
appId;
|
|
7809
7847
|
constructor(client, appId) {
|
|
7810
7848
|
this.client = client;
|
|
7811
7849
|
this.appId = appId;
|
|
@@ -7870,7 +7908,7 @@ function parseKintoneIntegerField(raw, fieldName) {
|
|
|
7870
7908
|
}
|
|
7871
7909
|
//#endregion
|
|
7872
7910
|
//#region src/core/adapters/kintone/generalSettingsConfigurator.ts
|
|
7873
|
-
const VALID_THEMES = new Set([
|
|
7911
|
+
const VALID_THEMES = /* @__PURE__ */ new Set([
|
|
7874
7912
|
"WHITE",
|
|
7875
7913
|
"RED",
|
|
7876
7914
|
"GREEN",
|
|
@@ -7882,9 +7920,9 @@ const VALID_THEMES = new Set([
|
|
|
7882
7920
|
"PENCIL",
|
|
7883
7921
|
"CLIPS"
|
|
7884
7922
|
]);
|
|
7885
|
-
const VALID_ICON_TYPES = new Set(["PRESET", "FILE"]);
|
|
7886
|
-
const VALID_SELECTION_MODES = new Set(["AUTO", "MANUAL"]);
|
|
7887
|
-
const VALID_ROUNDING_MODES = new Set([
|
|
7923
|
+
const VALID_ICON_TYPES = /* @__PURE__ */ new Set(["PRESET", "FILE"]);
|
|
7924
|
+
const VALID_SELECTION_MODES = /* @__PURE__ */ new Set(["AUTO", "MANUAL"]);
|
|
7925
|
+
const VALID_ROUNDING_MODES = /* @__PURE__ */ new Set([
|
|
7888
7926
|
"HALF_EVEN",
|
|
7889
7927
|
"UP",
|
|
7890
7928
|
"DOWN"
|
|
@@ -7950,11 +7988,13 @@ function toKintoneSettings(config) {
|
|
|
7950
7988
|
if (config.description !== void 0) result.description = config.description;
|
|
7951
7989
|
if (config.icon !== void 0) result.icon = toKintoneIcon(config.icon);
|
|
7952
7990
|
if (config.theme !== void 0) result.theme = config.theme;
|
|
7953
|
-
if (config.titleField !== void 0)
|
|
7954
|
-
selectionMode
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7991
|
+
if (config.titleField !== void 0) {
|
|
7992
|
+
if (config.titleField.selectionMode === "MANUAL") result.titleField = {
|
|
7993
|
+
selectionMode: "MANUAL",
|
|
7994
|
+
code: config.titleField.code
|
|
7995
|
+
};
|
|
7996
|
+
else result.titleField = { selectionMode: "AUTO" };
|
|
7997
|
+
}
|
|
7958
7998
|
if (config.enableThumbnails !== void 0) result.enableThumbnails = config.enableThumbnails;
|
|
7959
7999
|
if (config.enableBulkDeletion !== void 0) result.enableBulkDeletion = config.enableBulkDeletion;
|
|
7960
8000
|
if (config.enableComments !== void 0) result.enableComments = config.enableComments;
|
|
@@ -7969,6 +8009,8 @@ function toKintoneSettings(config) {
|
|
|
7969
8009
|
return result;
|
|
7970
8010
|
}
|
|
7971
8011
|
var KintoneGeneralSettingsConfigurator = class {
|
|
8012
|
+
client;
|
|
8013
|
+
appId;
|
|
7972
8014
|
constructor(client, appId) {
|
|
7973
8015
|
this.client = client;
|
|
7974
8016
|
this.appId = appId;
|
|
@@ -8131,6 +8173,8 @@ function toKintoneReminderNotification(notification) {
|
|
|
8131
8173
|
};
|
|
8132
8174
|
}
|
|
8133
8175
|
var KintoneNotificationConfigurator = class {
|
|
8176
|
+
client;
|
|
8177
|
+
appId;
|
|
8134
8178
|
constructor(client, appId) {
|
|
8135
8179
|
this.client = client;
|
|
8136
8180
|
this.appId = appId;
|
|
@@ -8247,6 +8291,8 @@ function createNotificationCliContainer(config) {
|
|
|
8247
8291
|
//#endregion
|
|
8248
8292
|
//#region src/core/adapters/kintone/pluginConfigurator.ts
|
|
8249
8293
|
var KintonePluginConfigurator = class {
|
|
8294
|
+
client;
|
|
8295
|
+
appId;
|
|
8250
8296
|
constructor(client, appId) {
|
|
8251
8297
|
this.client = client;
|
|
8252
8298
|
this.appId = appId;
|
|
@@ -8307,12 +8353,12 @@ function createPluginCliContainer(config) {
|
|
|
8307
8353
|
}
|
|
8308
8354
|
//#endregion
|
|
8309
8355
|
//#region src/core/adapters/kintone/processManagementConfigurator.ts
|
|
8310
|
-
const VALID_ASSIGNEE_TYPES = new Set([
|
|
8356
|
+
const VALID_ASSIGNEE_TYPES = /* @__PURE__ */ new Set([
|
|
8311
8357
|
"ONE",
|
|
8312
8358
|
"ALL",
|
|
8313
8359
|
"ANY"
|
|
8314
8360
|
]);
|
|
8315
|
-
const VALID_ENTITY_TYPES$1 = new Set([
|
|
8361
|
+
const VALID_ENTITY_TYPES$1 = /* @__PURE__ */ new Set([
|
|
8316
8362
|
"USER",
|
|
8317
8363
|
"GROUP",
|
|
8318
8364
|
"ORGANIZATION",
|
|
@@ -8320,7 +8366,7 @@ const VALID_ENTITY_TYPES$1 = new Set([
|
|
|
8320
8366
|
"CREATOR",
|
|
8321
8367
|
"CUSTOM_FIELD"
|
|
8322
8368
|
]);
|
|
8323
|
-
const VALID_ACTION_TYPES = new Set(["PRIMARY", "SECONDARY"]);
|
|
8369
|
+
const VALID_ACTION_TYPES = /* @__PURE__ */ new Set(["PRIMARY", "SECONDARY"]);
|
|
8324
8370
|
function fromKintoneEntity$1(raw) {
|
|
8325
8371
|
if (!VALID_ENTITY_TYPES$1.has(raw.entity.type)) throw new SystemError(SystemErrorCode.ExternalApiError, `Unexpected entity type from kintone API: ${raw.entity.type}`);
|
|
8326
8372
|
const result = { type: raw.entity.type };
|
|
@@ -8393,6 +8439,8 @@ function toKintoneAction(action) {
|
|
|
8393
8439
|
return result;
|
|
8394
8440
|
}
|
|
8395
8441
|
var KintoneProcessManagementConfigurator = class {
|
|
8442
|
+
client;
|
|
8443
|
+
appId;
|
|
8396
8444
|
constructor(client, appId) {
|
|
8397
8445
|
this.client = client;
|
|
8398
8446
|
this.appId = appId;
|
|
@@ -8462,7 +8510,7 @@ function createProcessManagementCliContainer(config) {
|
|
|
8462
8510
|
}
|
|
8463
8511
|
//#endregion
|
|
8464
8512
|
//#region src/core/adapters/kintone/recordPermissionConfigurator.ts
|
|
8465
|
-
const VALID_ENTITY_TYPES = new Set([
|
|
8513
|
+
const VALID_ENTITY_TYPES = /* @__PURE__ */ new Set([
|
|
8466
8514
|
"USER",
|
|
8467
8515
|
"GROUP",
|
|
8468
8516
|
"ORGANIZATION",
|
|
@@ -8506,6 +8554,8 @@ function toKintoneRight(right) {
|
|
|
8506
8554
|
};
|
|
8507
8555
|
}
|
|
8508
8556
|
var KintoneRecordPermissionConfigurator = class {
|
|
8557
|
+
client;
|
|
8558
|
+
appId;
|
|
8509
8559
|
constructor(client, appId) {
|
|
8510
8560
|
this.client = client;
|
|
8511
8561
|
this.appId = appId;
|
|
@@ -8595,11 +8645,13 @@ function fromKintonePeriodicReportPeriod(raw) {
|
|
|
8595
8645
|
if (!isPeriodicReportEvery(raw.every)) throw new SystemError(SystemErrorCode.ExternalApiError, `Unexpected periodicReport every value from kintone API: ${raw.every}`);
|
|
8596
8646
|
if (raw.pattern !== void 0 && !isPeriodicReportPattern(raw.pattern)) throw new SystemError(SystemErrorCode.ExternalApiError, `Unexpected periodicReport pattern value from kintone API: ${raw.pattern}`);
|
|
8597
8647
|
let dayOfMonth;
|
|
8598
|
-
if (raw.dayOfMonth !== void 0)
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8648
|
+
if (raw.dayOfMonth !== void 0) {
|
|
8649
|
+
if (String(raw.dayOfMonth) === "END_OF_MONTH") dayOfMonth = "END_OF_MONTH";
|
|
8650
|
+
else {
|
|
8651
|
+
const parsed = Number(raw.dayOfMonth);
|
|
8652
|
+
if (!Number.isFinite(parsed) || !Number.isInteger(parsed)) throw new SystemError(SystemErrorCode.ExternalApiError, `Unexpected periodicReport dayOfMonth value from kintone API: ${String(raw.dayOfMonth)}`);
|
|
8653
|
+
dayOfMonth = parsed;
|
|
8654
|
+
}
|
|
8603
8655
|
}
|
|
8604
8656
|
return {
|
|
8605
8657
|
every: raw.every,
|
|
@@ -8694,6 +8746,8 @@ function toKintoneReportConfig(config) {
|
|
|
8694
8746
|
return result;
|
|
8695
8747
|
}
|
|
8696
8748
|
var KintoneReportConfigurator = class {
|
|
8749
|
+
client;
|
|
8750
|
+
appId;
|
|
8697
8751
|
constructor(client, appId) {
|
|
8698
8752
|
this.client = client;
|
|
8699
8753
|
this.appId = appId;
|
|
@@ -8796,6 +8850,8 @@ function toKintoneView(config) {
|
|
|
8796
8850
|
return result;
|
|
8797
8851
|
}
|
|
8798
8852
|
var KintoneViewConfigurator = class {
|
|
8853
|
+
client;
|
|
8854
|
+
appId;
|
|
8799
8855
|
constructor(client, appId) {
|
|
8800
8856
|
this.client = client;
|
|
8801
8857
|
this.appId = appId;
|
|
@@ -10116,10 +10172,7 @@ function printSuccessResult(result) {
|
|
|
10116
10172
|
case "admin-notes":
|
|
10117
10173
|
printAdminNotesDiffResult(result.result);
|
|
10118
10174
|
break;
|
|
10119
|
-
case "plugin":
|
|
10120
|
-
printPluginDiffResult(result.result);
|
|
10121
|
-
break;
|
|
10122
|
-
default:
|
|
10175
|
+
case "plugin": printPluginDiffResult(result.result);
|
|
10123
10176
|
}
|
|
10124
10177
|
}
|
|
10125
10178
|
function isResultEmpty(result) {
|
|
@@ -12005,7 +12058,7 @@ function difference(keys, digests) {
|
|
|
12005
12058
|
return new Set([...keys].filter((key) => !digests.has(key)));
|
|
12006
12059
|
}
|
|
12007
12060
|
function union(a, b) {
|
|
12008
|
-
return new Set([...a, ...b]);
|
|
12061
|
+
return /* @__PURE__ */ new Set([...a, ...b]);
|
|
12009
12062
|
}
|
|
12010
12063
|
function intersect(a, b) {
|
|
12011
12064
|
const result = /* @__PURE__ */ new Set();
|
|
@@ -12742,6 +12795,40 @@ async function runPush(containerConfig, force, skipConfirm) {
|
|
|
12742
12795
|
p.log.success("Push completed successfully.");
|
|
12743
12796
|
await confirmAndDeploy([container], skipConfirm);
|
|
12744
12797
|
}
|
|
12798
|
+
var push_default$11 = define({
|
|
12799
|
+
name: "push",
|
|
12800
|
+
description: "Push the local customization config to kintone (with drift detection)",
|
|
12801
|
+
args: {
|
|
12802
|
+
...customizeArgs,
|
|
12803
|
+
...confirmArgs,
|
|
12804
|
+
force: {
|
|
12805
|
+
type: "boolean",
|
|
12806
|
+
description: "Skip drift detection and overwrite remote"
|
|
12807
|
+
}
|
|
12808
|
+
},
|
|
12809
|
+
run: async (ctx) => {
|
|
12810
|
+
try {
|
|
12811
|
+
const values = ctx.values;
|
|
12812
|
+
const force = ctx.values.force === true;
|
|
12813
|
+
const skipConfirm = values.yes === true;
|
|
12814
|
+
const notSupportedAll = new ValidationError(ValidationErrorCode.InvalidInput, "customize push does not support --all yet. Use --app <name> or a single app.");
|
|
12815
|
+
if (values.all === true) throw notSupportedAll;
|
|
12816
|
+
await routeMultiApp(values, {
|
|
12817
|
+
singleLegacy: async () => {
|
|
12818
|
+
await runPush(resolveCustomizeConfig(values), force, skipConfirm);
|
|
12819
|
+
},
|
|
12820
|
+
singleApp: async (app, projectConfig) => {
|
|
12821
|
+
await runPush(resolveCustomizeAppConfig(app, projectConfig, values), force, skipConfirm);
|
|
12822
|
+
},
|
|
12823
|
+
multiApp: async () => {
|
|
12824
|
+
throw notSupportedAll;
|
|
12825
|
+
}
|
|
12826
|
+
});
|
|
12827
|
+
} catch (error) {
|
|
12828
|
+
handleCliError(error);
|
|
12829
|
+
}
|
|
12830
|
+
}
|
|
12831
|
+
});
|
|
12745
12832
|
//#endregion
|
|
12746
12833
|
//#region src/cli/commands/customize/index.ts
|
|
12747
12834
|
var customize_default = define({
|
|
@@ -12752,40 +12839,7 @@ var customize_default = define({
|
|
|
12752
12839
|
capture: capture_default$10,
|
|
12753
12840
|
diff: diff_default$10,
|
|
12754
12841
|
pull: pull_default$10,
|
|
12755
|
-
push:
|
|
12756
|
-
name: "push",
|
|
12757
|
-
description: "Push the local customization config to kintone (with drift detection)",
|
|
12758
|
-
args: {
|
|
12759
|
-
...customizeArgs,
|
|
12760
|
-
...confirmArgs,
|
|
12761
|
-
force: {
|
|
12762
|
-
type: "boolean",
|
|
12763
|
-
description: "Skip drift detection and overwrite remote"
|
|
12764
|
-
}
|
|
12765
|
-
},
|
|
12766
|
-
run: async (ctx) => {
|
|
12767
|
-
try {
|
|
12768
|
-
const values = ctx.values;
|
|
12769
|
-
const force = ctx.values.force === true;
|
|
12770
|
-
const skipConfirm = values.yes === true;
|
|
12771
|
-
const notSupportedAll = new ValidationError(ValidationErrorCode.InvalidInput, "customize push does not support --all yet. Use --app <name> or a single app.");
|
|
12772
|
-
if (values.all === true) throw notSupportedAll;
|
|
12773
|
-
await routeMultiApp(values, {
|
|
12774
|
-
singleLegacy: async () => {
|
|
12775
|
-
await runPush(resolveCustomizeConfig(values), force, skipConfirm);
|
|
12776
|
-
},
|
|
12777
|
-
singleApp: async (app, projectConfig) => {
|
|
12778
|
-
await runPush(resolveCustomizeAppConfig(app, projectConfig, values), force, skipConfirm);
|
|
12779
|
-
},
|
|
12780
|
-
multiApp: async () => {
|
|
12781
|
-
throw notSupportedAll;
|
|
12782
|
-
}
|
|
12783
|
-
});
|
|
12784
|
-
} catch (error) {
|
|
12785
|
-
handleCliError(error);
|
|
12786
|
-
}
|
|
12787
|
-
}
|
|
12788
|
-
})
|
|
12842
|
+
push: push_default$11
|
|
12789
12843
|
},
|
|
12790
12844
|
run: () => {}
|
|
12791
12845
|
});
|
|
@@ -13301,6 +13355,22 @@ async function pushFieldPermission({ container, input }) {
|
|
|
13301
13355
|
};
|
|
13302
13356
|
}
|
|
13303
13357
|
//#endregion
|
|
13358
|
+
//#region src/cli/commands/field-acl/push.ts
|
|
13359
|
+
var push_default$10 = createPushCommand({
|
|
13360
|
+
description: "Push the local field permission config to kintone (with drift detection)",
|
|
13361
|
+
args: fieldAclArgs,
|
|
13362
|
+
subject: "field permission config",
|
|
13363
|
+
spinnerStopMessage: "Field permissions pushed to preview.",
|
|
13364
|
+
createContainer: createFieldPermissionCliContainer,
|
|
13365
|
+
pushFn: pushFieldPermission,
|
|
13366
|
+
toctouMessage: "The remote changed while applying. Run `field-acl pull` and retry.",
|
|
13367
|
+
onResult: (result) => {
|
|
13368
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
13369
|
+
},
|
|
13370
|
+
resolveContainerConfig: resolveFieldAclContainerConfig,
|
|
13371
|
+
resolveAppContainerConfig: resolveFieldAclAppContainerConfig
|
|
13372
|
+
});
|
|
13373
|
+
//#endregion
|
|
13304
13374
|
//#region src/cli/commands/field-acl/index.ts
|
|
13305
13375
|
var field_acl_default = define({
|
|
13306
13376
|
name: "field-acl",
|
|
@@ -13310,20 +13380,7 @@ var field_acl_default = define({
|
|
|
13310
13380
|
capture: capture_default$9,
|
|
13311
13381
|
diff: diff_default$8,
|
|
13312
13382
|
pull: pull_default$9,
|
|
13313
|
-
push:
|
|
13314
|
-
description: "Push the local field permission config to kintone (with drift detection)",
|
|
13315
|
-
args: fieldAclArgs,
|
|
13316
|
-
subject: "field permission config",
|
|
13317
|
-
spinnerStopMessage: "Field permissions pushed to preview.",
|
|
13318
|
-
createContainer: createFieldPermissionCliContainer,
|
|
13319
|
-
pushFn: pushFieldPermission,
|
|
13320
|
-
toctouMessage: "The remote changed while applying. Run `field-acl pull` and retry.",
|
|
13321
|
-
onResult: (result) => {
|
|
13322
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
13323
|
-
},
|
|
13324
|
-
resolveContainerConfig: resolveFieldAclContainerConfig,
|
|
13325
|
-
resolveAppContainerConfig: resolveFieldAclAppContainerConfig
|
|
13326
|
-
})
|
|
13383
|
+
push: push_default$10
|
|
13327
13384
|
},
|
|
13328
13385
|
run: () => {}
|
|
13329
13386
|
});
|
|
@@ -13332,6 +13389,7 @@ var field_acl_default = define({
|
|
|
13332
13389
|
const PAGE_LIMIT = 100;
|
|
13333
13390
|
const MAX_PAGES = 1e3;
|
|
13334
13391
|
var KintoneAppLister = class {
|
|
13392
|
+
client;
|
|
13335
13393
|
constructor(client) {
|
|
13336
13394
|
this.client = client;
|
|
13337
13395
|
}
|
|
@@ -13378,6 +13436,7 @@ var KintoneAppLister = class {
|
|
|
13378
13436
|
* @see https://kintone.dev/en/docs/kintone/rest-api/spaces/get-space/
|
|
13379
13437
|
*/
|
|
13380
13438
|
var KintoneSpaceReader = class {
|
|
13439
|
+
client;
|
|
13381
13440
|
constructor(client) {
|
|
13382
13441
|
this.client = client;
|
|
13383
13442
|
}
|
|
@@ -13952,13 +14011,10 @@ function pushScalar(scalar, key, label, localChanges, remoteDrift, conflicts, ex
|
|
|
13952
14011
|
kind: "conflict"
|
|
13953
14012
|
});
|
|
13954
14013
|
break;
|
|
13955
|
-
case "bothSame":
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
|
|
13959
|
-
});
|
|
13960
|
-
break;
|
|
13961
|
-
default: break;
|
|
14014
|
+
case "bothSame": extras.push({
|
|
14015
|
+
key,
|
|
14016
|
+
kind: "change"
|
|
14017
|
+
});
|
|
13962
14018
|
}
|
|
13963
14019
|
}
|
|
13964
14020
|
function buildThreeWay(merge) {
|
|
@@ -13984,13 +14040,10 @@ function buildThreeWay(merge) {
|
|
|
13984
14040
|
kind: "remoteOnly"
|
|
13985
14041
|
});
|
|
13986
14042
|
break;
|
|
13987
|
-
case "conflict":
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
});
|
|
13992
|
-
break;
|
|
13993
|
-
default: break;
|
|
14043
|
+
case "conflict": conflicts.push({
|
|
14044
|
+
...base,
|
|
14045
|
+
kind: "conflict"
|
|
14046
|
+
});
|
|
13994
14047
|
}
|
|
13995
14048
|
}
|
|
13996
14049
|
pushScalar(merge.generalScalar, "general:notifyToCommenter", "notifyToCommenter", localChanges, remoteDrift, conflicts, extras);
|
|
@@ -14256,6 +14309,22 @@ async function pushNotification({ container, input }) {
|
|
|
14256
14309
|
};
|
|
14257
14310
|
}
|
|
14258
14311
|
//#endregion
|
|
14312
|
+
//#region src/cli/commands/notification/push.ts
|
|
14313
|
+
var push_default$9 = createPushCommand({
|
|
14314
|
+
description: "Push the local notification config to kintone (with drift detection)",
|
|
14315
|
+
args: notificationArgs,
|
|
14316
|
+
subject: "notification config",
|
|
14317
|
+
spinnerStopMessage: "Notifications pushed to preview.",
|
|
14318
|
+
createContainer: createNotificationCliContainer,
|
|
14319
|
+
pushFn: pushNotification,
|
|
14320
|
+
toctouMessage: "The remote changed while applying. Run `notification pull` and retry.",
|
|
14321
|
+
onResult: (result) => {
|
|
14322
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
14323
|
+
},
|
|
14324
|
+
resolveContainerConfig: resolveNotificationContainerConfig,
|
|
14325
|
+
resolveAppContainerConfig: resolveNotificationAppContainerConfig
|
|
14326
|
+
});
|
|
14327
|
+
//#endregion
|
|
14259
14328
|
//#region src/cli/commands/notification/index.ts
|
|
14260
14329
|
var notification_default = define({
|
|
14261
14330
|
name: "notification",
|
|
@@ -14265,20 +14334,7 @@ var notification_default = define({
|
|
|
14265
14334
|
capture: capture_default$8,
|
|
14266
14335
|
diff: diff_default$7,
|
|
14267
14336
|
pull: pull_default$8,
|
|
14268
|
-
push:
|
|
14269
|
-
description: "Push the local notification config to kintone (with drift detection)",
|
|
14270
|
-
args: notificationArgs,
|
|
14271
|
-
subject: "notification config",
|
|
14272
|
-
spinnerStopMessage: "Notifications pushed to preview.",
|
|
14273
|
-
createContainer: createNotificationCliContainer,
|
|
14274
|
-
pushFn: pushNotification,
|
|
14275
|
-
toctouMessage: "The remote changed while applying. Run `notification pull` and retry.",
|
|
14276
|
-
onResult: (result) => {
|
|
14277
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
14278
|
-
},
|
|
14279
|
-
resolveContainerConfig: resolveNotificationContainerConfig,
|
|
14280
|
-
resolveAppContainerConfig: resolveNotificationAppContainerConfig
|
|
14281
|
-
})
|
|
14337
|
+
push: push_default$9
|
|
14282
14338
|
},
|
|
14283
14339
|
run: () => {}
|
|
14284
14340
|
});
|
|
@@ -14617,12 +14673,13 @@ function partitionPushOps(local, remoteById, localById, remotePlugins) {
|
|
|
14617
14673
|
const skipped = [];
|
|
14618
14674
|
for (const localPlugin of local.plugins) {
|
|
14619
14675
|
const remotePlugin = remoteById.get(localPlugin.id);
|
|
14620
|
-
if (remotePlugin === void 0)
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14676
|
+
if (remotePlugin === void 0) {
|
|
14677
|
+
if (localPlugin.enabled) idsToAdd.push(localPlugin.id);
|
|
14678
|
+
else skipped.push({
|
|
14679
|
+
pluginId: localPlugin.id,
|
|
14680
|
+
reason: "add-disabled"
|
|
14681
|
+
});
|
|
14682
|
+
} else if (remotePlugin.name !== localPlugin.name || remotePlugin.enabled !== localPlugin.enabled) skipped.push({
|
|
14626
14683
|
pluginId: localPlugin.id,
|
|
14627
14684
|
reason: "modify"
|
|
14628
14685
|
});
|
|
@@ -14692,6 +14749,29 @@ async function pushPlugin({ container, input }) {
|
|
|
14692
14749
|
};
|
|
14693
14750
|
}
|
|
14694
14751
|
//#endregion
|
|
14752
|
+
//#region src/cli/commands/plugin/push.ts
|
|
14753
|
+
var push_default$8 = createPushCommand({
|
|
14754
|
+
description: "Push the local plugin config to kintone (add-only, with drift detection)",
|
|
14755
|
+
args: pluginArgs,
|
|
14756
|
+
subject: "plugin config",
|
|
14757
|
+
spinnerStopMessage: "Plugins pushed to preview.",
|
|
14758
|
+
createContainer: createPluginCliContainer,
|
|
14759
|
+
pushFn: pushPlugin,
|
|
14760
|
+
toctouMessage: "The remote changed while applying. Run `plugin pull` and retry.",
|
|
14761
|
+
onResult: (result) => {
|
|
14762
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
14763
|
+
if (result.addedPluginIds.length > 0) p.log.info(`Added plugins: ${result.addedPluginIds.join(", ")}`);
|
|
14764
|
+
const deletions = result.skipped.filter((o) => o.reason === "delete").map((o) => o.pluginId);
|
|
14765
|
+
const modifications = result.skipped.filter((o) => o.reason === "modify").map((o) => o.pluginId);
|
|
14766
|
+
const addDisabled = result.skipped.filter((o) => o.reason === "add-disabled").map((o) => o.pluginId);
|
|
14767
|
+
if (deletions.length > 0) p.log.warn(`Cannot remove plugins via the kintone API (add-only); left on the app: ${deletions.join(", ")}`);
|
|
14768
|
+
if (modifications.length > 0) p.log.warn(`Cannot modify existing plugins (name/enabled) via the kintone API (add-only); unchanged: ${modifications.join(", ")}`);
|
|
14769
|
+
if (addDisabled.length > 0) p.log.warn(`Cannot add plugins in a disabled state via the kintone API (add-only; adding would force-enable them); not added — set enabled: false manually in the kintone admin UI: ${addDisabled.join(", ")}`);
|
|
14770
|
+
},
|
|
14771
|
+
resolveContainerConfig: resolvePluginContainerConfig,
|
|
14772
|
+
resolveAppContainerConfig: resolvePluginAppContainerConfig
|
|
14773
|
+
});
|
|
14774
|
+
//#endregion
|
|
14695
14775
|
//#region src/cli/commands/plugin/index.ts
|
|
14696
14776
|
var plugin_default = define({
|
|
14697
14777
|
name: "plugin",
|
|
@@ -14701,27 +14781,7 @@ var plugin_default = define({
|
|
|
14701
14781
|
capture: capture_default$7,
|
|
14702
14782
|
diff: diff_default$6,
|
|
14703
14783
|
pull: pull_default$7,
|
|
14704
|
-
push:
|
|
14705
|
-
description: "Push the local plugin config to kintone (add-only, with drift detection)",
|
|
14706
|
-
args: pluginArgs,
|
|
14707
|
-
subject: "plugin config",
|
|
14708
|
-
spinnerStopMessage: "Plugins pushed to preview.",
|
|
14709
|
-
createContainer: createPluginCliContainer,
|
|
14710
|
-
pushFn: pushPlugin,
|
|
14711
|
-
toctouMessage: "The remote changed while applying. Run `plugin pull` and retry.",
|
|
14712
|
-
onResult: (result) => {
|
|
14713
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
14714
|
-
if (result.addedPluginIds.length > 0) p.log.info(`Added plugins: ${result.addedPluginIds.join(", ")}`);
|
|
14715
|
-
const deletions = result.skipped.filter((o) => o.reason === "delete").map((o) => o.pluginId);
|
|
14716
|
-
const modifications = result.skipped.filter((o) => o.reason === "modify").map((o) => o.pluginId);
|
|
14717
|
-
const addDisabled = result.skipped.filter((o) => o.reason === "add-disabled").map((o) => o.pluginId);
|
|
14718
|
-
if (deletions.length > 0) p.log.warn(`Cannot remove plugins via the kintone API (add-only); left on the app: ${deletions.join(", ")}`);
|
|
14719
|
-
if (modifications.length > 0) p.log.warn(`Cannot modify existing plugins (name/enabled) via the kintone API (add-only); unchanged: ${modifications.join(", ")}`);
|
|
14720
|
-
if (addDisabled.length > 0) p.log.warn(`Cannot add plugins in a disabled state via the kintone API (add-only; adding would force-enable them); not added — set enabled: false manually in the kintone admin UI: ${addDisabled.join(", ")}`);
|
|
14721
|
-
},
|
|
14722
|
-
resolveContainerConfig: resolvePluginContainerConfig,
|
|
14723
|
-
resolveAppContainerConfig: resolvePluginAppContainerConfig
|
|
14724
|
-
})
|
|
14784
|
+
push: push_default$8
|
|
14725
14785
|
},
|
|
14726
14786
|
run: () => {}
|
|
14727
14787
|
});
|
|
@@ -15052,6 +15112,22 @@ async function pushProcessManagement({ container, input }) {
|
|
|
15052
15112
|
};
|
|
15053
15113
|
}
|
|
15054
15114
|
//#endregion
|
|
15115
|
+
//#region src/cli/commands/process/push.ts
|
|
15116
|
+
var push_default$7 = createPushCommand({
|
|
15117
|
+
description: "Push the local process management config to kintone (with drift detection)",
|
|
15118
|
+
args: processArgs,
|
|
15119
|
+
subject: "process management config",
|
|
15120
|
+
spinnerStopMessage: "Process management pushed to preview.",
|
|
15121
|
+
createContainer: createProcessManagementCliContainer,
|
|
15122
|
+
pushFn: pushProcessManagement,
|
|
15123
|
+
toctouMessage: "The remote changed while applying. Run `process pull` and retry.",
|
|
15124
|
+
onResult: (result) => {
|
|
15125
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
15126
|
+
},
|
|
15127
|
+
resolveContainerConfig: resolveProcessContainerConfig,
|
|
15128
|
+
resolveAppContainerConfig: resolveProcessAppContainerConfig
|
|
15129
|
+
});
|
|
15130
|
+
//#endregion
|
|
15055
15131
|
//#region src/cli/commands/process/index.ts
|
|
15056
15132
|
var process_default = define({
|
|
15057
15133
|
name: "process",
|
|
@@ -15061,20 +15137,7 @@ var process_default = define({
|
|
|
15061
15137
|
capture: capture_default$6,
|
|
15062
15138
|
diff: diff_default$5,
|
|
15063
15139
|
pull: pull_default$6,
|
|
15064
|
-
push:
|
|
15065
|
-
description: "Push the local process management config to kintone (with drift detection)",
|
|
15066
|
-
args: processArgs,
|
|
15067
|
-
subject: "process management config",
|
|
15068
|
-
spinnerStopMessage: "Process management pushed to preview.",
|
|
15069
|
-
createContainer: createProcessManagementCliContainer,
|
|
15070
|
-
pushFn: pushProcessManagement,
|
|
15071
|
-
toctouMessage: "The remote changed while applying. Run `process pull` and retry.",
|
|
15072
|
-
onResult: (result) => {
|
|
15073
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
15074
|
-
},
|
|
15075
|
-
resolveContainerConfig: resolveProcessContainerConfig,
|
|
15076
|
-
resolveAppContainerConfig: resolveProcessAppContainerConfig
|
|
15077
|
-
})
|
|
15140
|
+
push: push_default$7
|
|
15078
15141
|
},
|
|
15079
15142
|
run: () => {}
|
|
15080
15143
|
});
|
|
@@ -15122,11 +15185,12 @@ function computeThreeWayMerge(base, local, remote) {
|
|
|
15122
15185
|
let layoutConflict = false;
|
|
15123
15186
|
let mergedLayout;
|
|
15124
15187
|
let layoutAutoSide;
|
|
15125
|
-
if (layoutLocalChanged && layoutRemoteChanged)
|
|
15126
|
-
|
|
15127
|
-
|
|
15128
|
-
|
|
15129
|
-
|
|
15188
|
+
if (layoutLocalChanged && layoutRemoteChanged) {
|
|
15189
|
+
if (isLayoutEqual(enrichedLocalLayout, enrichedRemoteLayout)) {
|
|
15190
|
+
mergedLayout = enrichedLocalLayout;
|
|
15191
|
+
layoutAutoSide = "local";
|
|
15192
|
+
} else layoutConflict = true;
|
|
15193
|
+
} else if (layoutLocalChanged) {
|
|
15130
15194
|
mergedLayout = enrichedLocalLayout;
|
|
15131
15195
|
layoutAutoSide = "local";
|
|
15132
15196
|
} else if (layoutRemoteChanged) {
|
|
@@ -15227,9 +15291,7 @@ function collectLayoutFieldCodes(layout) {
|
|
|
15227
15291
|
placed.add(item.code);
|
|
15228
15292
|
collectElements(item.fields);
|
|
15229
15293
|
break;
|
|
15230
|
-
case "REFERENCE_TABLE":
|
|
15231
|
-
placed.add(item.code);
|
|
15232
|
-
break;
|
|
15294
|
+
case "REFERENCE_TABLE": placed.add(item.code);
|
|
15233
15295
|
}
|
|
15234
15296
|
return {
|
|
15235
15297
|
placed,
|
|
@@ -17355,6 +17417,84 @@ async function runDiff$4(containerConfig) {
|
|
|
17355
17417
|
s.stop("Comparison complete.");
|
|
17356
17418
|
printThreeWayDiffResult(result, printRecordPermissionDiffResult);
|
|
17357
17419
|
}
|
|
17420
|
+
var diff_default$4 = define({
|
|
17421
|
+
name: "diff",
|
|
17422
|
+
description: "Compare local record permission config with remote kintone app (3-way)",
|
|
17423
|
+
args: recordAclArgs,
|
|
17424
|
+
run: async (ctx) => {
|
|
17425
|
+
try {
|
|
17426
|
+
await routeMultiApp(ctx.values, {
|
|
17427
|
+
singleLegacy: async () => {
|
|
17428
|
+
await runDiff$4(resolveRecordAclContainerConfig(ctx.values));
|
|
17429
|
+
},
|
|
17430
|
+
singleApp: async (app, projectConfig) => {
|
|
17431
|
+
await runDiff$4(resolveRecordAclAppContainerConfig(app, projectConfig, ctx.values));
|
|
17432
|
+
},
|
|
17433
|
+
multiApp: async (plan, projectConfig) => {
|
|
17434
|
+
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
17435
|
+
printAppHeader(app.name, app.appId);
|
|
17436
|
+
await runDiff$4(resolveRecordAclAppContainerConfig(app, projectConfig, ctx.values));
|
|
17437
|
+
}, "All record permission diffs completed successfully.");
|
|
17438
|
+
}
|
|
17439
|
+
});
|
|
17440
|
+
} catch (error) {
|
|
17441
|
+
handleCliError(error);
|
|
17442
|
+
}
|
|
17443
|
+
}
|
|
17444
|
+
});
|
|
17445
|
+
//#endregion
|
|
17446
|
+
//#region src/cli/commands/record-acl/pull.ts
|
|
17447
|
+
var pull_default$4 = createPullCommand({
|
|
17448
|
+
description: "Pull remote record permissions into the local record-acl config (3-way merge)",
|
|
17449
|
+
args: recordAclArgs,
|
|
17450
|
+
subject: "record permission config",
|
|
17451
|
+
conflictNoun: "record permission",
|
|
17452
|
+
createContainer: createRecordPermissionCliContainer,
|
|
17453
|
+
pullFn: async ({ container, input }) => {
|
|
17454
|
+
const result = await pullRecordPermission({
|
|
17455
|
+
container,
|
|
17456
|
+
input
|
|
17457
|
+
});
|
|
17458
|
+
if (result.mode === "merged") return {
|
|
17459
|
+
mode: "merged",
|
|
17460
|
+
merged: result
|
|
17461
|
+
};
|
|
17462
|
+
return { mode: result.mode };
|
|
17463
|
+
},
|
|
17464
|
+
getMergeView: (merged) => ({
|
|
17465
|
+
hasConflict: merged.merge.hasConflict,
|
|
17466
|
+
conflicts: merged.merge.conflicts
|
|
17467
|
+
}),
|
|
17468
|
+
applyMerge: async ({ container, merged, resolution }) => {
|
|
17469
|
+
await applyPulledRecordPermissionMerge({
|
|
17470
|
+
container,
|
|
17471
|
+
input: {
|
|
17472
|
+
merge: merged.merge,
|
|
17473
|
+
resolution,
|
|
17474
|
+
remoteConfig: merged.remoteConfig,
|
|
17475
|
+
remoteRevision: merged.remoteRevision
|
|
17476
|
+
}
|
|
17477
|
+
});
|
|
17478
|
+
},
|
|
17479
|
+
resolveContainerConfig: resolveRecordAclContainerConfig,
|
|
17480
|
+
resolveAppContainerConfig: resolveRecordAclAppContainerConfig
|
|
17481
|
+
});
|
|
17482
|
+
//#endregion
|
|
17483
|
+
//#region src/cli/commands/record-acl/push.ts
|
|
17484
|
+
var push_default$5 = createPushCommand({
|
|
17485
|
+
description: "Push the local record permission config to kintone (with drift detection)",
|
|
17486
|
+
args: recordAclArgs,
|
|
17487
|
+
subject: "record permission config",
|
|
17488
|
+
spinnerStopMessage: "Record permissions pushed to preview.",
|
|
17489
|
+
createContainer: createRecordPermissionCliContainer,
|
|
17490
|
+
pushFn: pushRecordPermission,
|
|
17491
|
+
toctouMessage: "The remote changed while applying. Run `record-acl pull` and retry.",
|
|
17492
|
+
onResult: (result) => {
|
|
17493
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
17494
|
+
},
|
|
17495
|
+
resolveContainerConfig: resolveRecordAclContainerConfig,
|
|
17496
|
+
resolveAppContainerConfig: resolveRecordAclAppContainerConfig
|
|
17497
|
+
});
|
|
17358
17498
|
//#endregion
|
|
17359
17499
|
//#region src/cli/commands/record-acl/index.ts
|
|
17360
17500
|
var record_acl_default = define({
|
|
@@ -17363,80 +17503,9 @@ var record_acl_default = define({
|
|
|
17363
17503
|
subCommands: {
|
|
17364
17504
|
apply: apply_default$4,
|
|
17365
17505
|
capture: capture_default$5,
|
|
17366
|
-
diff:
|
|
17367
|
-
|
|
17368
|
-
|
|
17369
|
-
args: recordAclArgs,
|
|
17370
|
-
run: async (ctx) => {
|
|
17371
|
-
try {
|
|
17372
|
-
await routeMultiApp(ctx.values, {
|
|
17373
|
-
singleLegacy: async () => {
|
|
17374
|
-
await runDiff$4(resolveRecordAclContainerConfig(ctx.values));
|
|
17375
|
-
},
|
|
17376
|
-
singleApp: async (app, projectConfig) => {
|
|
17377
|
-
await runDiff$4(resolveRecordAclAppContainerConfig(app, projectConfig, ctx.values));
|
|
17378
|
-
},
|
|
17379
|
-
multiApp: async (plan, projectConfig) => {
|
|
17380
|
-
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
17381
|
-
printAppHeader(app.name, app.appId);
|
|
17382
|
-
await runDiff$4(resolveRecordAclAppContainerConfig(app, projectConfig, ctx.values));
|
|
17383
|
-
}, "All record permission diffs completed successfully.");
|
|
17384
|
-
}
|
|
17385
|
-
});
|
|
17386
|
-
} catch (error) {
|
|
17387
|
-
handleCliError(error);
|
|
17388
|
-
}
|
|
17389
|
-
}
|
|
17390
|
-
}),
|
|
17391
|
-
pull: createPullCommand({
|
|
17392
|
-
description: "Pull remote record permissions into the local record-acl config (3-way merge)",
|
|
17393
|
-
args: recordAclArgs,
|
|
17394
|
-
subject: "record permission config",
|
|
17395
|
-
conflictNoun: "record permission",
|
|
17396
|
-
createContainer: createRecordPermissionCliContainer,
|
|
17397
|
-
pullFn: async ({ container, input }) => {
|
|
17398
|
-
const result = await pullRecordPermission({
|
|
17399
|
-
container,
|
|
17400
|
-
input
|
|
17401
|
-
});
|
|
17402
|
-
if (result.mode === "merged") return {
|
|
17403
|
-
mode: "merged",
|
|
17404
|
-
merged: result
|
|
17405
|
-
};
|
|
17406
|
-
return { mode: result.mode };
|
|
17407
|
-
},
|
|
17408
|
-
getMergeView: (merged) => ({
|
|
17409
|
-
hasConflict: merged.merge.hasConflict,
|
|
17410
|
-
conflicts: merged.merge.conflicts
|
|
17411
|
-
}),
|
|
17412
|
-
applyMerge: async ({ container, merged, resolution }) => {
|
|
17413
|
-
await applyPulledRecordPermissionMerge({
|
|
17414
|
-
container,
|
|
17415
|
-
input: {
|
|
17416
|
-
merge: merged.merge,
|
|
17417
|
-
resolution,
|
|
17418
|
-
remoteConfig: merged.remoteConfig,
|
|
17419
|
-
remoteRevision: merged.remoteRevision
|
|
17420
|
-
}
|
|
17421
|
-
});
|
|
17422
|
-
},
|
|
17423
|
-
resolveContainerConfig: resolveRecordAclContainerConfig,
|
|
17424
|
-
resolveAppContainerConfig: resolveRecordAclAppContainerConfig
|
|
17425
|
-
}),
|
|
17426
|
-
push: createPushCommand({
|
|
17427
|
-
description: "Push the local record permission config to kintone (with drift detection)",
|
|
17428
|
-
args: recordAclArgs,
|
|
17429
|
-
subject: "record permission config",
|
|
17430
|
-
spinnerStopMessage: "Record permissions pushed to preview.",
|
|
17431
|
-
createContainer: createRecordPermissionCliContainer,
|
|
17432
|
-
pushFn: pushRecordPermission,
|
|
17433
|
-
toctouMessage: "The remote changed while applying. Run `record-acl pull` and retry.",
|
|
17434
|
-
onResult: (result) => {
|
|
17435
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
17436
|
-
},
|
|
17437
|
-
resolveContainerConfig: resolveRecordAclContainerConfig,
|
|
17438
|
-
resolveAppContainerConfig: resolveRecordAclAppContainerConfig
|
|
17439
|
-
})
|
|
17506
|
+
diff: diff_default$4,
|
|
17507
|
+
pull: pull_default$4,
|
|
17508
|
+
push: push_default$5
|
|
17440
17509
|
},
|
|
17441
17510
|
run: () => {}
|
|
17442
17511
|
});
|
|
@@ -17541,88 +17610,95 @@ async function runDiff$3(containerConfig) {
|
|
|
17541
17610
|
s.stop("Comparison complete.");
|
|
17542
17611
|
printThreeWayDiffResult(result, printReportDiffResult);
|
|
17543
17612
|
}
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
|
|
17550
|
-
|
|
17551
|
-
|
|
17552
|
-
|
|
17553
|
-
|
|
17554
|
-
|
|
17555
|
-
|
|
17556
|
-
|
|
17557
|
-
|
|
17558
|
-
await
|
|
17559
|
-
|
|
17560
|
-
|
|
17561
|
-
|
|
17562
|
-
singleApp: async (app, projectConfig) => {
|
|
17563
|
-
await runDiff$3(resolveReportAppContainerConfig(app, projectConfig, ctx.values));
|
|
17564
|
-
},
|
|
17565
|
-
multiApp: async (plan, projectConfig) => {
|
|
17566
|
-
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
17567
|
-
printAppHeader(app.name, app.appId);
|
|
17568
|
-
await runDiff$3(resolveReportAppContainerConfig(app, projectConfig, ctx.values));
|
|
17569
|
-
}, "All report diffs completed successfully.");
|
|
17570
|
-
}
|
|
17571
|
-
});
|
|
17572
|
-
} catch (error) {
|
|
17573
|
-
handleCliError(error);
|
|
17613
|
+
var diff_default$3 = define({
|
|
17614
|
+
name: "diff",
|
|
17615
|
+
description: "Compare local report config with remote kintone app (3-way)",
|
|
17616
|
+
args: reportArgs,
|
|
17617
|
+
run: async (ctx) => {
|
|
17618
|
+
try {
|
|
17619
|
+
await routeMultiApp(ctx.values, {
|
|
17620
|
+
singleLegacy: async () => {
|
|
17621
|
+
await runDiff$3(resolveReportContainerConfig(ctx.values));
|
|
17622
|
+
},
|
|
17623
|
+
singleApp: async (app, projectConfig) => {
|
|
17624
|
+
await runDiff$3(resolveReportAppContainerConfig(app, projectConfig, ctx.values));
|
|
17625
|
+
},
|
|
17626
|
+
multiApp: async (plan, projectConfig) => {
|
|
17627
|
+
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
17628
|
+
printAppHeader(app.name, app.appId);
|
|
17629
|
+
await runDiff$3(resolveReportAppContainerConfig(app, projectConfig, ctx.values));
|
|
17630
|
+
}, "All report diffs completed successfully.");
|
|
17574
17631
|
}
|
|
17632
|
+
});
|
|
17633
|
+
} catch (error) {
|
|
17634
|
+
handleCliError(error);
|
|
17635
|
+
}
|
|
17636
|
+
}
|
|
17637
|
+
});
|
|
17638
|
+
//#endregion
|
|
17639
|
+
//#region src/cli/commands/report/pull.ts
|
|
17640
|
+
var pull_default$3 = createPullCommand({
|
|
17641
|
+
description: "Pull remote reports into the local report config (3-way merge)",
|
|
17642
|
+
args: reportArgs,
|
|
17643
|
+
subject: "report config",
|
|
17644
|
+
conflictNoun: "report",
|
|
17645
|
+
createContainer: createReportCliContainer,
|
|
17646
|
+
pullFn: async ({ container, input }) => {
|
|
17647
|
+
const result = await pullReport({
|
|
17648
|
+
container,
|
|
17649
|
+
input
|
|
17650
|
+
});
|
|
17651
|
+
if (result.mode === "merged") return {
|
|
17652
|
+
mode: "merged",
|
|
17653
|
+
merged: result
|
|
17654
|
+
};
|
|
17655
|
+
return { mode: result.mode };
|
|
17656
|
+
},
|
|
17657
|
+
getMergeView: (merged) => ({
|
|
17658
|
+
hasConflict: merged.merge.hasConflict,
|
|
17659
|
+
conflicts: merged.merge.conflicts
|
|
17660
|
+
}),
|
|
17661
|
+
applyMerge: async ({ container, merged, resolution }) => {
|
|
17662
|
+
await applyPulledReportMerge({
|
|
17663
|
+
container,
|
|
17664
|
+
input: {
|
|
17665
|
+
merge: merged.merge,
|
|
17666
|
+
resolution,
|
|
17667
|
+
remoteConfig: merged.remoteConfig,
|
|
17668
|
+
remoteRevision: merged.remoteRevision
|
|
17575
17669
|
}
|
|
17576
|
-
})
|
|
17577
|
-
|
|
17578
|
-
|
|
17579
|
-
|
|
17580
|
-
|
|
17581
|
-
|
|
17582
|
-
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
|
|
17588
|
-
|
|
17589
|
-
|
|
17590
|
-
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17594
|
-
|
|
17595
|
-
|
|
17596
|
-
|
|
17597
|
-
|
|
17598
|
-
|
|
17599
|
-
|
|
17600
|
-
|
|
17601
|
-
|
|
17602
|
-
|
|
17603
|
-
|
|
17604
|
-
|
|
17605
|
-
|
|
17606
|
-
|
|
17607
|
-
|
|
17608
|
-
},
|
|
17609
|
-
resolveContainerConfig: resolveReportContainerConfig,
|
|
17610
|
-
resolveAppContainerConfig: resolveReportAppContainerConfig
|
|
17611
|
-
}),
|
|
17612
|
-
push: createPushCommand({
|
|
17613
|
-
description: "Push the local report config to kintone (with drift detection)",
|
|
17614
|
-
args: reportArgs,
|
|
17615
|
-
subject: "report config",
|
|
17616
|
-
spinnerStopMessage: "Reports pushed to preview.",
|
|
17617
|
-
createContainer: createReportCliContainer,
|
|
17618
|
-
pushFn: pushReport,
|
|
17619
|
-
toctouMessage: "The remote changed while applying. Run `report pull` and retry.",
|
|
17620
|
-
onResult: (result) => {
|
|
17621
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
17622
|
-
},
|
|
17623
|
-
resolveContainerConfig: resolveReportContainerConfig,
|
|
17624
|
-
resolveAppContainerConfig: resolveReportAppContainerConfig
|
|
17625
|
-
})
|
|
17670
|
+
});
|
|
17671
|
+
},
|
|
17672
|
+
resolveContainerConfig: resolveReportContainerConfig,
|
|
17673
|
+
resolveAppContainerConfig: resolveReportAppContainerConfig
|
|
17674
|
+
});
|
|
17675
|
+
//#endregion
|
|
17676
|
+
//#region src/cli/commands/report/push.ts
|
|
17677
|
+
var push_default$4 = createPushCommand({
|
|
17678
|
+
description: "Push the local report config to kintone (with drift detection)",
|
|
17679
|
+
args: reportArgs,
|
|
17680
|
+
subject: "report config",
|
|
17681
|
+
spinnerStopMessage: "Reports pushed to preview.",
|
|
17682
|
+
createContainer: createReportCliContainer,
|
|
17683
|
+
pushFn: pushReport,
|
|
17684
|
+
toctouMessage: "The remote changed while applying. Run `report pull` and retry.",
|
|
17685
|
+
onResult: (result) => {
|
|
17686
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
17687
|
+
},
|
|
17688
|
+
resolveContainerConfig: resolveReportContainerConfig,
|
|
17689
|
+
resolveAppContainerConfig: resolveReportAppContainerConfig
|
|
17690
|
+
});
|
|
17691
|
+
//#endregion
|
|
17692
|
+
//#region src/cli/commands/report/index.ts
|
|
17693
|
+
var report_default = define({
|
|
17694
|
+
name: "report",
|
|
17695
|
+
description: "Manage kintone report settings",
|
|
17696
|
+
subCommands: {
|
|
17697
|
+
apply: apply_default$3,
|
|
17698
|
+
capture: capture_default$4,
|
|
17699
|
+
diff: diff_default$3,
|
|
17700
|
+
pull: pull_default$3,
|
|
17701
|
+
push: push_default$4
|
|
17626
17702
|
},
|
|
17627
17703
|
run: () => {}
|
|
17628
17704
|
});
|
|
@@ -17715,14 +17791,11 @@ async function detectThreeWayDiff({ container }) {
|
|
|
17715
17791
|
kind: "remoteOnly"
|
|
17716
17792
|
});
|
|
17717
17793
|
break;
|
|
17718
|
-
case "conflict":
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
});
|
|
17724
|
-
break;
|
|
17725
|
-
default: break;
|
|
17794
|
+
case "conflict": conflicts.push({
|
|
17795
|
+
key: entry.key,
|
|
17796
|
+
label,
|
|
17797
|
+
kind: "conflict"
|
|
17798
|
+
});
|
|
17726
17799
|
}
|
|
17727
17800
|
}
|
|
17728
17801
|
const enrichedBaseLayout = enrichLayoutWithFields(state.schema.layout, state.schema.fields);
|
|
@@ -17838,6 +17911,8 @@ const GET_RAW_FORM_DATA_FAILURE_MESSAGES = {
|
|
|
17838
17911
|
published: "Failed to fetch published raw form data for dump (the app may not be deployed yet, or the credentials may not be allowed to read it)"
|
|
17839
17912
|
};
|
|
17840
17913
|
var KintoneFormDumpReader = class {
|
|
17914
|
+
client;
|
|
17915
|
+
appId;
|
|
17841
17916
|
constructor(client, appId) {
|
|
17842
17917
|
this.client = client;
|
|
17843
17918
|
this.appId = appId;
|
|
@@ -17864,6 +17939,8 @@ var KintoneFormDumpReader = class {
|
|
|
17864
17939
|
//#endregion
|
|
17865
17940
|
//#region src/core/adapters/local/dumpStorage.ts
|
|
17866
17941
|
var LocalFileDumpStorage = class {
|
|
17942
|
+
filePrefix;
|
|
17943
|
+
baseDir;
|
|
17867
17944
|
constructor(filePrefix, baseDir = process.cwd()) {
|
|
17868
17945
|
this.filePrefix = filePrefix;
|
|
17869
17946
|
this.baseDir = baseDir;
|
|
@@ -18284,21 +18361,23 @@ async function resolveConflicts(merge, options) {
|
|
|
18284
18361
|
fields.set(conflict.key, choice);
|
|
18285
18362
|
}
|
|
18286
18363
|
let layout = "noConflict";
|
|
18287
|
-
if (merge.layoutConflict)
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
|
|
18297
|
-
|
|
18298
|
-
|
|
18299
|
-
|
|
18300
|
-
|
|
18301
|
-
|
|
18364
|
+
if (merge.layoutConflict) {
|
|
18365
|
+
if (options.ours) layout = "local";
|
|
18366
|
+
else if (options.theirs) layout = "remote";
|
|
18367
|
+
else {
|
|
18368
|
+
const selected = await p.select({
|
|
18369
|
+
message: "Conflict on layout. Keep which side?",
|
|
18370
|
+
options: [{
|
|
18371
|
+
value: "local",
|
|
18372
|
+
label: "local (ours)"
|
|
18373
|
+
}, {
|
|
18374
|
+
value: "remote",
|
|
18375
|
+
label: "remote (theirs)"
|
|
18376
|
+
}]
|
|
18377
|
+
});
|
|
18378
|
+
if (p.isCancel(selected)) return;
|
|
18379
|
+
layout = selected;
|
|
18380
|
+
}
|
|
18302
18381
|
}
|
|
18303
18382
|
return {
|
|
18304
18383
|
fields,
|
|
@@ -18500,6 +18579,41 @@ async function runValidate(schemaFilePath) {
|
|
|
18500
18579
|
function resolveSchemaFilePath(values, appSchemaFile) {
|
|
18501
18580
|
return values["schema-file"] ?? process.env.SCHEMA_FILE_PATH ?? appSchemaFile ?? "schema.yaml";
|
|
18502
18581
|
}
|
|
18582
|
+
var validate_default = define({
|
|
18583
|
+
name: "validate",
|
|
18584
|
+
description: "Validate schema file without connecting to kintone",
|
|
18585
|
+
args: validateArgs,
|
|
18586
|
+
run: async (ctx) => {
|
|
18587
|
+
try {
|
|
18588
|
+
const values = ctx.values;
|
|
18589
|
+
await routeMultiApp(values, {
|
|
18590
|
+
singleLegacy: async () => {
|
|
18591
|
+
if (!await runValidate(resolveSchemaFilePath(values))) {
|
|
18592
|
+
p.outro("Validation failed.");
|
|
18593
|
+
process.exit(1);
|
|
18594
|
+
}
|
|
18595
|
+
p.outro("Validation passed.");
|
|
18596
|
+
},
|
|
18597
|
+
singleApp: async (app) => {
|
|
18598
|
+
if (!await runValidate(resolveSchemaFilePath(values, app.schemaFile))) {
|
|
18599
|
+
p.outro("Validation failed.");
|
|
18600
|
+
process.exit(1);
|
|
18601
|
+
}
|
|
18602
|
+
p.outro("Validation passed.");
|
|
18603
|
+
},
|
|
18604
|
+
multiApp: async (plan) => {
|
|
18605
|
+
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
18606
|
+
printAppHeader(app.name, app.appId);
|
|
18607
|
+
const schemaFilePath = resolveSchemaFilePath(values, app.schemaFile);
|
|
18608
|
+
if (!printValidationResult(await validateSchema({ container: createValidateCliContainer({ schemaFilePath }) }), schemaFilePath)) throw new ValidationError(ValidationErrorCode.InvalidInput, `Validation failed for app "${app.name}"`);
|
|
18609
|
+
}, "All validations passed.");
|
|
18610
|
+
}
|
|
18611
|
+
});
|
|
18612
|
+
} catch (error) {
|
|
18613
|
+
handleCliError(error);
|
|
18614
|
+
}
|
|
18615
|
+
}
|
|
18616
|
+
});
|
|
18503
18617
|
//#endregion
|
|
18504
18618
|
//#region src/cli/commands/schema/index.ts
|
|
18505
18619
|
var schema_default = define({
|
|
@@ -18510,41 +18624,7 @@ var schema_default = define({
|
|
|
18510
18624
|
migrate: migrate_default,
|
|
18511
18625
|
override: override_default,
|
|
18512
18626
|
capture: capture_default$3,
|
|
18513
|
-
validate:
|
|
18514
|
-
name: "validate",
|
|
18515
|
-
description: "Validate schema file without connecting to kintone",
|
|
18516
|
-
args: validateArgs,
|
|
18517
|
-
run: async (ctx) => {
|
|
18518
|
-
try {
|
|
18519
|
-
const values = ctx.values;
|
|
18520
|
-
await routeMultiApp(values, {
|
|
18521
|
-
singleLegacy: async () => {
|
|
18522
|
-
if (!await runValidate(resolveSchemaFilePath(values))) {
|
|
18523
|
-
p.outro("Validation failed.");
|
|
18524
|
-
process.exit(1);
|
|
18525
|
-
}
|
|
18526
|
-
p.outro("Validation passed.");
|
|
18527
|
-
},
|
|
18528
|
-
singleApp: async (app) => {
|
|
18529
|
-
if (!await runValidate(resolveSchemaFilePath(values, app.schemaFile))) {
|
|
18530
|
-
p.outro("Validation failed.");
|
|
18531
|
-
process.exit(1);
|
|
18532
|
-
}
|
|
18533
|
-
p.outro("Validation passed.");
|
|
18534
|
-
},
|
|
18535
|
-
multiApp: async (plan) => {
|
|
18536
|
-
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
18537
|
-
printAppHeader(app.name, app.appId);
|
|
18538
|
-
const schemaFilePath = resolveSchemaFilePath(values, app.schemaFile);
|
|
18539
|
-
if (!printValidationResult(await validateSchema({ container: createValidateCliContainer({ schemaFilePath }) }), schemaFilePath)) throw new ValidationError(ValidationErrorCode.InvalidInput, `Validation failed for app "${app.name}"`);
|
|
18540
|
-
}, "All validations passed.");
|
|
18541
|
-
}
|
|
18542
|
-
});
|
|
18543
|
-
} catch (error) {
|
|
18544
|
-
handleCliError(error);
|
|
18545
|
-
}
|
|
18546
|
-
}
|
|
18547
|
-
}),
|
|
18627
|
+
validate: validate_default,
|
|
18548
18628
|
dump: dump_default,
|
|
18549
18629
|
pull: pull_default$2,
|
|
18550
18630
|
push: push_default$3
|
|
@@ -18704,6 +18784,34 @@ async function runSeedCapture(config, keyField) {
|
|
|
18704
18784
|
if (!keyField) p.log.info("No key field specified. All records will be added on apply.");
|
|
18705
18785
|
if (result.hasExistingSeed) p.log.warn("Existing seed file was overwritten.");
|
|
18706
18786
|
}
|
|
18787
|
+
var capture_default$2 = define({
|
|
18788
|
+
name: "capture",
|
|
18789
|
+
description: "Capture records from kintone app to seed file",
|
|
18790
|
+
args: seedCaptureArgs,
|
|
18791
|
+
run: async (ctx) => {
|
|
18792
|
+
try {
|
|
18793
|
+
const values = ctx.values;
|
|
18794
|
+
const keyField = values["key-field"];
|
|
18795
|
+
await routeMultiApp(values, {
|
|
18796
|
+
singleLegacy: async () => {
|
|
18797
|
+
await runSeedCapture(resolveSeedConfig(values), keyField);
|
|
18798
|
+
},
|
|
18799
|
+
singleApp: async (app, projectConfig) => {
|
|
18800
|
+
await runSeedCapture(resolveSeedAppConfig(app, projectConfig, values), keyField);
|
|
18801
|
+
},
|
|
18802
|
+
multiApp: async (plan, projectConfig) => {
|
|
18803
|
+
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
18804
|
+
const config = resolveSeedAppConfig(app, projectConfig, values);
|
|
18805
|
+
printAppHeader(app.name, app.appId);
|
|
18806
|
+
await runSeedCapture(config, keyField);
|
|
18807
|
+
}, "All captures completed successfully.");
|
|
18808
|
+
}
|
|
18809
|
+
});
|
|
18810
|
+
} catch (error) {
|
|
18811
|
+
handleCliError(error);
|
|
18812
|
+
}
|
|
18813
|
+
}
|
|
18814
|
+
});
|
|
18707
18815
|
//#endregion
|
|
18708
18816
|
//#region src/cli/commands/seed/index.ts
|
|
18709
18817
|
var seed_default = define({
|
|
@@ -18712,34 +18820,7 @@ var seed_default = define({
|
|
|
18712
18820
|
subCommands: {
|
|
18713
18821
|
push: push_default$2,
|
|
18714
18822
|
apply: apply_default$2,
|
|
18715
|
-
capture:
|
|
18716
|
-
name: "capture",
|
|
18717
|
-
description: "Capture records from kintone app to seed file",
|
|
18718
|
-
args: seedCaptureArgs,
|
|
18719
|
-
run: async (ctx) => {
|
|
18720
|
-
try {
|
|
18721
|
-
const values = ctx.values;
|
|
18722
|
-
const keyField = values["key-field"];
|
|
18723
|
-
await routeMultiApp(values, {
|
|
18724
|
-
singleLegacy: async () => {
|
|
18725
|
-
await runSeedCapture(resolveSeedConfig(values), keyField);
|
|
18726
|
-
},
|
|
18727
|
-
singleApp: async (app, projectConfig) => {
|
|
18728
|
-
await runSeedCapture(resolveSeedAppConfig(app, projectConfig, values), keyField);
|
|
18729
|
-
},
|
|
18730
|
-
multiApp: async (plan, projectConfig) => {
|
|
18731
|
-
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
18732
|
-
const config = resolveSeedAppConfig(app, projectConfig, values);
|
|
18733
|
-
printAppHeader(app.name, app.appId);
|
|
18734
|
-
await runSeedCapture(config, keyField);
|
|
18735
|
-
}, "All captures completed successfully.");
|
|
18736
|
-
}
|
|
18737
|
-
});
|
|
18738
|
-
} catch (error) {
|
|
18739
|
-
handleCliError(error);
|
|
18740
|
-
}
|
|
18741
|
-
}
|
|
18742
|
-
})
|
|
18823
|
+
capture: capture_default$2
|
|
18743
18824
|
},
|
|
18744
18825
|
run: () => {}
|
|
18745
18826
|
});
|
|
@@ -18873,6 +18954,57 @@ var diff_default$1 = define({
|
|
|
18873
18954
|
//#region src/cli/commands/settings/pull.ts
|
|
18874
18955
|
/** Fixed conflict key for the single (whole-entity) settings config. */
|
|
18875
18956
|
const SETTINGS_CONFLICT_KEY = "settings";
|
|
18957
|
+
var pull_default$1 = createPullCommand({
|
|
18958
|
+
description: "Pull remote general settings into the local settings config (3-way merge)",
|
|
18959
|
+
args: settingsArgs,
|
|
18960
|
+
subject: "general settings config",
|
|
18961
|
+
conflictNoun: "settings",
|
|
18962
|
+
createContainer: createGeneralSettingsCliContainer,
|
|
18963
|
+
pullFn: async ({ container, input }) => {
|
|
18964
|
+
const result = await pullGeneralSettings({
|
|
18965
|
+
container,
|
|
18966
|
+
input
|
|
18967
|
+
});
|
|
18968
|
+
if (result.mode === "merged") return {
|
|
18969
|
+
mode: "merged",
|
|
18970
|
+
merged: result
|
|
18971
|
+
};
|
|
18972
|
+
return { mode: result.mode };
|
|
18973
|
+
},
|
|
18974
|
+
getMergeView: (merged) => ({
|
|
18975
|
+
hasConflict: merged.merge.hasConflict,
|
|
18976
|
+
conflicts: merged.merge.hasConflict ? [{ key: SETTINGS_CONFLICT_KEY }] : []
|
|
18977
|
+
}),
|
|
18978
|
+
applyMerge: async ({ container, merged, resolution }) => {
|
|
18979
|
+
await applyPulledGeneralSettingsMerge({
|
|
18980
|
+
container,
|
|
18981
|
+
input: {
|
|
18982
|
+
merge: merged.merge,
|
|
18983
|
+
resolution: resolution.get(SETTINGS_CONFLICT_KEY),
|
|
18984
|
+
remoteConfig: merged.remoteConfig,
|
|
18985
|
+
remoteRevision: merged.remoteRevision
|
|
18986
|
+
}
|
|
18987
|
+
});
|
|
18988
|
+
},
|
|
18989
|
+
resolveContainerConfig: resolveSettingsContainerConfig,
|
|
18990
|
+
resolveAppContainerConfig: resolveSettingsAppContainerConfig
|
|
18991
|
+
});
|
|
18992
|
+
//#endregion
|
|
18993
|
+
//#region src/cli/commands/settings/push.ts
|
|
18994
|
+
var push_default$1 = createPushCommand({
|
|
18995
|
+
description: "Push the local general settings config to kintone (with drift detection)",
|
|
18996
|
+
args: settingsArgs,
|
|
18997
|
+
subject: "general settings config",
|
|
18998
|
+
spinnerStopMessage: "General settings pushed to preview.",
|
|
18999
|
+
createContainer: createGeneralSettingsCliContainer,
|
|
19000
|
+
pushFn: pushGeneralSettings,
|
|
19001
|
+
toctouMessage: "The remote changed while applying. Run `settings pull` and retry.",
|
|
19002
|
+
onResult: (result) => {
|
|
19003
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
19004
|
+
},
|
|
19005
|
+
resolveContainerConfig: resolveSettingsContainerConfig,
|
|
19006
|
+
resolveAppContainerConfig: resolveSettingsAppContainerConfig
|
|
19007
|
+
});
|
|
18876
19008
|
//#endregion
|
|
18877
19009
|
//#region src/cli/commands/settings/index.ts
|
|
18878
19010
|
var settings_default = define({
|
|
@@ -18882,55 +19014,8 @@ var settings_default = define({
|
|
|
18882
19014
|
apply: apply_default$1,
|
|
18883
19015
|
capture: capture_default$1,
|
|
18884
19016
|
diff: diff_default$1,
|
|
18885
|
-
pull:
|
|
18886
|
-
|
|
18887
|
-
args: settingsArgs,
|
|
18888
|
-
subject: "general settings config",
|
|
18889
|
-
conflictNoun: "settings",
|
|
18890
|
-
createContainer: createGeneralSettingsCliContainer,
|
|
18891
|
-
pullFn: async ({ container, input }) => {
|
|
18892
|
-
const result = await pullGeneralSettings({
|
|
18893
|
-
container,
|
|
18894
|
-
input
|
|
18895
|
-
});
|
|
18896
|
-
if (result.mode === "merged") return {
|
|
18897
|
-
mode: "merged",
|
|
18898
|
-
merged: result
|
|
18899
|
-
};
|
|
18900
|
-
return { mode: result.mode };
|
|
18901
|
-
},
|
|
18902
|
-
getMergeView: (merged) => ({
|
|
18903
|
-
hasConflict: merged.merge.hasConflict,
|
|
18904
|
-
conflicts: merged.merge.hasConflict ? [{ key: SETTINGS_CONFLICT_KEY }] : []
|
|
18905
|
-
}),
|
|
18906
|
-
applyMerge: async ({ container, merged, resolution }) => {
|
|
18907
|
-
await applyPulledGeneralSettingsMerge({
|
|
18908
|
-
container,
|
|
18909
|
-
input: {
|
|
18910
|
-
merge: merged.merge,
|
|
18911
|
-
resolution: resolution.get(SETTINGS_CONFLICT_KEY),
|
|
18912
|
-
remoteConfig: merged.remoteConfig,
|
|
18913
|
-
remoteRevision: merged.remoteRevision
|
|
18914
|
-
}
|
|
18915
|
-
});
|
|
18916
|
-
},
|
|
18917
|
-
resolveContainerConfig: resolveSettingsContainerConfig,
|
|
18918
|
-
resolveAppContainerConfig: resolveSettingsAppContainerConfig
|
|
18919
|
-
}),
|
|
18920
|
-
push: createPushCommand({
|
|
18921
|
-
description: "Push the local general settings config to kintone (with drift detection)",
|
|
18922
|
-
args: settingsArgs,
|
|
18923
|
-
subject: "general settings config",
|
|
18924
|
-
spinnerStopMessage: "General settings pushed to preview.",
|
|
18925
|
-
createContainer: createGeneralSettingsCliContainer,
|
|
18926
|
-
pushFn: pushGeneralSettings,
|
|
18927
|
-
toctouMessage: "The remote changed while applying. Run `settings pull` and retry.",
|
|
18928
|
-
onResult: (result) => {
|
|
18929
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
18930
|
-
},
|
|
18931
|
-
resolveContainerConfig: resolveSettingsContainerConfig,
|
|
18932
|
-
resolveAppContainerConfig: resolveSettingsAppContainerConfig
|
|
18933
|
-
})
|
|
19017
|
+
pull: pull_default$1,
|
|
19018
|
+
push: push_default$1
|
|
18934
19019
|
},
|
|
18935
19020
|
run: () => {}
|
|
18936
19021
|
});
|
|
@@ -19038,6 +19123,85 @@ async function runDiff(containerConfig) {
|
|
|
19038
19123
|
s.stop("Comparison complete.");
|
|
19039
19124
|
printThreeWayDiffResult(result, printViewDiffResult);
|
|
19040
19125
|
}
|
|
19126
|
+
var diff_default = define({
|
|
19127
|
+
name: "diff",
|
|
19128
|
+
description: "Compare local view config with remote kintone app (3-way)",
|
|
19129
|
+
args: viewArgs,
|
|
19130
|
+
run: async (ctx) => {
|
|
19131
|
+
try {
|
|
19132
|
+
await routeMultiApp(ctx.values, {
|
|
19133
|
+
singleLegacy: async () => {
|
|
19134
|
+
await runDiff(resolveViewContainerConfig(ctx.values));
|
|
19135
|
+
},
|
|
19136
|
+
singleApp: async (app, projectConfig) => {
|
|
19137
|
+
await runDiff(resolveViewAppContainerConfig(app, projectConfig, ctx.values));
|
|
19138
|
+
},
|
|
19139
|
+
multiApp: async (plan, projectConfig) => {
|
|
19140
|
+
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
19141
|
+
printAppHeader(app.name, app.appId);
|
|
19142
|
+
await runDiff(resolveViewAppContainerConfig(app, projectConfig, ctx.values));
|
|
19143
|
+
}, "All view diffs completed successfully.");
|
|
19144
|
+
}
|
|
19145
|
+
});
|
|
19146
|
+
} catch (error) {
|
|
19147
|
+
handleCliError(error);
|
|
19148
|
+
}
|
|
19149
|
+
}
|
|
19150
|
+
});
|
|
19151
|
+
//#endregion
|
|
19152
|
+
//#region src/cli/commands/view/pull.ts
|
|
19153
|
+
var pull_default = createPullCommand({
|
|
19154
|
+
description: "Pull remote views into the local view config (3-way merge)",
|
|
19155
|
+
args: viewArgs,
|
|
19156
|
+
subject: "view config",
|
|
19157
|
+
conflictNoun: "view",
|
|
19158
|
+
createContainer: createViewCliContainer,
|
|
19159
|
+
pullFn: async ({ container, input }) => {
|
|
19160
|
+
const result = await pullView({
|
|
19161
|
+
container,
|
|
19162
|
+
input
|
|
19163
|
+
});
|
|
19164
|
+
if (result.mode === "merged") return {
|
|
19165
|
+
mode: "merged",
|
|
19166
|
+
merged: result
|
|
19167
|
+
};
|
|
19168
|
+
return { mode: result.mode };
|
|
19169
|
+
},
|
|
19170
|
+
getMergeView: (merged) => ({
|
|
19171
|
+
hasConflict: merged.merge.hasConflict,
|
|
19172
|
+
conflicts: merged.merge.conflicts
|
|
19173
|
+
}),
|
|
19174
|
+
applyMerge: async ({ container, merged, resolution }) => {
|
|
19175
|
+
await applyPulledViewMerge({
|
|
19176
|
+
container,
|
|
19177
|
+
input: {
|
|
19178
|
+
merge: merged.merge,
|
|
19179
|
+
resolution,
|
|
19180
|
+
remoteConfig: merged.remoteConfig,
|
|
19181
|
+
remoteRevision: merged.remoteRevision
|
|
19182
|
+
}
|
|
19183
|
+
});
|
|
19184
|
+
},
|
|
19185
|
+
resolveContainerConfig: resolveViewContainerConfig,
|
|
19186
|
+
resolveAppContainerConfig: resolveViewAppContainerConfig
|
|
19187
|
+
});
|
|
19188
|
+
//#endregion
|
|
19189
|
+
//#region src/cli/commands/view/push.ts
|
|
19190
|
+
var push_default = createPushCommand({
|
|
19191
|
+
description: "Push the local view config to kintone (with drift detection)",
|
|
19192
|
+
args: viewArgs,
|
|
19193
|
+
subject: "view config",
|
|
19194
|
+
spinnerStopMessage: "Views pushed to preview.",
|
|
19195
|
+
createContainer: createViewCliContainer,
|
|
19196
|
+
pushFn: pushView,
|
|
19197
|
+
toctouMessage: "The remote changed while applying. Run `view pull` and retry.",
|
|
19198
|
+
onResult: (result) => {
|
|
19199
|
+
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
19200
|
+
if (result.skippedBuiltinViews.length > 0) p.log.warn(`Skipped builtin views (cannot be updated): ${result.skippedBuiltinViews.join(", ")}`);
|
|
19201
|
+
},
|
|
19202
|
+
resolveContainerConfig: resolveViewContainerConfig,
|
|
19203
|
+
resolveAppContainerConfig: resolveViewAppContainerConfig
|
|
19204
|
+
});
|
|
19041
19205
|
//#endregion
|
|
19042
19206
|
//#region src/cli/commands/view/index.ts
|
|
19043
19207
|
var view_default = define({
|
|
@@ -19046,81 +19210,9 @@ var view_default = define({
|
|
|
19046
19210
|
subCommands: {
|
|
19047
19211
|
apply: apply_default,
|
|
19048
19212
|
capture: capture_default,
|
|
19049
|
-
diff:
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
args: viewArgs,
|
|
19053
|
-
run: async (ctx) => {
|
|
19054
|
-
try {
|
|
19055
|
-
await routeMultiApp(ctx.values, {
|
|
19056
|
-
singleLegacy: async () => {
|
|
19057
|
-
await runDiff(resolveViewContainerConfig(ctx.values));
|
|
19058
|
-
},
|
|
19059
|
-
singleApp: async (app, projectConfig) => {
|
|
19060
|
-
await runDiff(resolveViewAppContainerConfig(app, projectConfig, ctx.values));
|
|
19061
|
-
},
|
|
19062
|
-
multiApp: async (plan, projectConfig) => {
|
|
19063
|
-
await runMultiAppWithFailCheck(plan, async (app) => {
|
|
19064
|
-
printAppHeader(app.name, app.appId);
|
|
19065
|
-
await runDiff(resolveViewAppContainerConfig(app, projectConfig, ctx.values));
|
|
19066
|
-
}, "All view diffs completed successfully.");
|
|
19067
|
-
}
|
|
19068
|
-
});
|
|
19069
|
-
} catch (error) {
|
|
19070
|
-
handleCliError(error);
|
|
19071
|
-
}
|
|
19072
|
-
}
|
|
19073
|
-
}),
|
|
19074
|
-
pull: createPullCommand({
|
|
19075
|
-
description: "Pull remote views into the local view config (3-way merge)",
|
|
19076
|
-
args: viewArgs,
|
|
19077
|
-
subject: "view config",
|
|
19078
|
-
conflictNoun: "view",
|
|
19079
|
-
createContainer: createViewCliContainer,
|
|
19080
|
-
pullFn: async ({ container, input }) => {
|
|
19081
|
-
const result = await pullView({
|
|
19082
|
-
container,
|
|
19083
|
-
input
|
|
19084
|
-
});
|
|
19085
|
-
if (result.mode === "merged") return {
|
|
19086
|
-
mode: "merged",
|
|
19087
|
-
merged: result
|
|
19088
|
-
};
|
|
19089
|
-
return { mode: result.mode };
|
|
19090
|
-
},
|
|
19091
|
-
getMergeView: (merged) => ({
|
|
19092
|
-
hasConflict: merged.merge.hasConflict,
|
|
19093
|
-
conflicts: merged.merge.conflicts
|
|
19094
|
-
}),
|
|
19095
|
-
applyMerge: async ({ container, merged, resolution }) => {
|
|
19096
|
-
await applyPulledViewMerge({
|
|
19097
|
-
container,
|
|
19098
|
-
input: {
|
|
19099
|
-
merge: merged.merge,
|
|
19100
|
-
resolution,
|
|
19101
|
-
remoteConfig: merged.remoteConfig,
|
|
19102
|
-
remoteRevision: merged.remoteRevision
|
|
19103
|
-
}
|
|
19104
|
-
});
|
|
19105
|
-
},
|
|
19106
|
-
resolveContainerConfig: resolveViewContainerConfig,
|
|
19107
|
-
resolveAppContainerConfig: resolveViewAppContainerConfig
|
|
19108
|
-
}),
|
|
19109
|
-
push: createPushCommand({
|
|
19110
|
-
description: "Push the local view config to kintone (with drift detection)",
|
|
19111
|
-
args: viewArgs,
|
|
19112
|
-
subject: "view config",
|
|
19113
|
-
spinnerStopMessage: "Views pushed to preview.",
|
|
19114
|
-
createContainer: createViewCliContainer,
|
|
19115
|
-
pushFn: pushView,
|
|
19116
|
-
toctouMessage: "The remote changed while applying. Run `view pull` and retry.",
|
|
19117
|
-
onResult: (result) => {
|
|
19118
|
-
if (result.mode === "firstTime") p.log.warn("No base snapshot found. Applied without drift guard and initialized state.");
|
|
19119
|
-
if (result.skippedBuiltinViews.length > 0) p.log.warn(`Skipped builtin views (cannot be updated): ${result.skippedBuiltinViews.join(", ")}`);
|
|
19120
|
-
},
|
|
19121
|
-
resolveContainerConfig: resolveViewContainerConfig,
|
|
19122
|
-
resolveAppContainerConfig: resolveViewAppContainerConfig
|
|
19123
|
-
})
|
|
19213
|
+
diff: diff_default,
|
|
19214
|
+
pull: pull_default,
|
|
19215
|
+
push: push_default
|
|
19124
19216
|
},
|
|
19125
19217
|
run: () => {}
|
|
19126
19218
|
});
|