kintone-migrator 0.21.4 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -625,31 +625,36 @@ function isNodeError(error) {
625
625
  }
626
626
 
627
627
  //#endregion
628
- //#region src/core/adapters/local/actionStorage.ts
629
- var LocalFileActionStorage = class {
630
- constructor(filePath) {
631
- this.filePath = filePath;
632
- }
633
- async get() {
634
- try {
635
- return {
636
- exists: true,
637
- content: await readFile(this.filePath, "utf-8")
638
- };
639
- } catch (error) {
640
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
641
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read action file: ${this.filePath}`, error);
642
- }
643
- }
644
- async update(content) {
645
- try {
646
- await mkdir(dirname(this.filePath), { recursive: true });
647
- await writeFile(this.filePath, content, "utf-8");
648
- } catch (error) {
649
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write action file: ${this.filePath}`, error);
628
+ //#region src/core/adapters/local/storage.ts
629
+ function createLocalFileStorage(filePath, label = "file") {
630
+ return {
631
+ async get() {
632
+ try {
633
+ return {
634
+ exists: true,
635
+ content: await readFile(filePath, "utf-8")
636
+ };
637
+ } catch (error) {
638
+ if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
639
+ throw new SystemError(SystemErrorCode.StorageError, `Failed to read ${label}: ${filePath}`, error);
640
+ }
641
+ },
642
+ async update(content) {
643
+ try {
644
+ await mkdir(dirname(filePath), { recursive: true });
645
+ await writeFile(filePath, content, "utf-8");
646
+ } catch (error) {
647
+ throw new SystemError(SystemErrorCode.StorageError, `Failed to write ${label}: ${filePath}`, error);
648
+ }
650
649
  }
651
- }
652
- };
650
+ };
651
+ }
652
+
653
+ //#endregion
654
+ //#region src/core/adapters/local/actionStorage.ts
655
+ function createLocalFileActionStorage(filePath) {
656
+ return createLocalFileStorage(filePath, "action file");
657
+ }
653
658
 
654
659
  //#endregion
655
660
  //#region src/core/adapters/kintone/customizationConfigurator.ts
@@ -1379,30 +1384,9 @@ var KintoneRecordManager = class {
1379
1384
 
1380
1385
  //#endregion
1381
1386
  //#region src/core/adapters/local/customizationStorage.ts
1382
- var LocalFileCustomizationStorage = class {
1383
- constructor(filePath) {
1384
- this.filePath = filePath;
1385
- }
1386
- async get() {
1387
- try {
1388
- return {
1389
- exists: true,
1390
- content: await readFile(this.filePath, "utf-8")
1391
- };
1392
- } catch (error) {
1393
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
1394
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read customization config file: ${this.filePath}`, error);
1395
- }
1396
- }
1397
- async update(content) {
1398
- try {
1399
- await mkdir(dirname(this.filePath), { recursive: true });
1400
- await writeFile(this.filePath, content, "utf-8");
1401
- } catch (error) {
1402
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write customization config file: ${this.filePath}`, error);
1403
- }
1404
- }
1405
- };
1387
+ function createLocalFileCustomizationStorage(filePath) {
1388
+ return createLocalFileStorage(filePath, "customization config file");
1389
+ }
1406
1390
 
1407
1391
  //#endregion
1408
1392
  //#region src/core/adapters/local/fileWriter.ts
@@ -1419,57 +1403,15 @@ var LocalFileWriter = class {
1419
1403
 
1420
1404
  //#endregion
1421
1405
  //#region src/core/adapters/local/schemaStorage.ts
1422
- var LocalFileSchemaStorage = class {
1423
- constructor(filePath) {
1424
- this.filePath = filePath;
1425
- }
1426
- async get() {
1427
- try {
1428
- return {
1429
- exists: true,
1430
- content: await readFile(this.filePath, "utf-8")
1431
- };
1432
- } catch (error) {
1433
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
1434
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read schema file: ${this.filePath}`, error);
1435
- }
1436
- }
1437
- async update(content) {
1438
- try {
1439
- await mkdir(dirname(this.filePath), { recursive: true });
1440
- await writeFile(this.filePath, content, "utf-8");
1441
- } catch (error) {
1442
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write schema file: ${this.filePath}`, error);
1443
- }
1444
- }
1445
- };
1406
+ function createLocalFileSchemaStorage(filePath) {
1407
+ return createLocalFileStorage(filePath, "schema file");
1408
+ }
1446
1409
 
1447
1410
  //#endregion
1448
1411
  //#region src/core/adapters/local/seedStorage.ts
1449
- var LocalFileSeedStorage = class {
1450
- constructor(filePath) {
1451
- this.filePath = filePath;
1452
- }
1453
- async get() {
1454
- try {
1455
- return {
1456
- exists: true,
1457
- content: await readFile(this.filePath, "utf-8")
1458
- };
1459
- } catch (error) {
1460
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
1461
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read seed file: ${this.filePath}`, error);
1462
- }
1463
- }
1464
- async update(content) {
1465
- try {
1466
- await mkdir(dirname(this.filePath), { recursive: true });
1467
- await writeFile(this.filePath, content, "utf-8");
1468
- } catch (error) {
1469
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write seed file: ${this.filePath}`, error);
1470
- }
1471
- }
1472
- };
1412
+ function createLocalFileSeedStorage(filePath) {
1413
+ return createLocalFileStorage(filePath, "seed file");
1414
+ }
1473
1415
 
1474
1416
  //#endregion
1475
1417
  //#region src/core/application/container/cli.ts
@@ -1488,7 +1430,7 @@ function createCliContainer(config) {
1488
1430
  });
1489
1431
  return {
1490
1432
  formConfigurator: new KintoneFormConfigurator(client, config.appId),
1491
- schemaStorage: new LocalFileSchemaStorage(config.schemaFilePath),
1433
+ schemaStorage: createLocalFileSchemaStorage(config.schemaFilePath),
1492
1434
  appDeployer: new KintoneAppDeployer(client, config.appId)
1493
1435
  };
1494
1436
  }
@@ -1499,7 +1441,7 @@ function createSeedCliContainer(config) {
1499
1441
  auth: buildKintoneAuth(config.auth),
1500
1442
  guestSpaceId: config.guestSpaceId
1501
1443
  }), config.appId),
1502
- seedStorage: new LocalFileSeedStorage(config.seedFilePath)
1444
+ seedStorage: createLocalFileSeedStorage(config.seedFilePath)
1503
1445
  };
1504
1446
  }
1505
1447
  function createCustomizationCliContainer(config) {
@@ -1510,7 +1452,7 @@ function createCustomizationCliContainer(config) {
1510
1452
  });
1511
1453
  return {
1512
1454
  customizationConfigurator: new KintoneCustomizationConfigurator(client, config.appId),
1513
- customizationStorage: new LocalFileCustomizationStorage(config.customizeFilePath),
1455
+ customizationStorage: createLocalFileCustomizationStorage(config.customizeFilePath),
1514
1456
  fileUploader: new KintoneFileUploader(client),
1515
1457
  fileDownloader: new KintoneFileDownloader(client),
1516
1458
  fileWriter: new LocalFileWriter(),
@@ -1528,7 +1470,7 @@ function createActionCliContainer(config) {
1528
1470
  });
1529
1471
  return {
1530
1472
  actionConfigurator: new KintoneActionConfigurator(client, config.appId),
1531
- actionStorage: new LocalFileActionStorage(config.actionFilePath),
1473
+ actionStorage: createLocalFileActionStorage(config.actionFilePath),
1532
1474
  appDeployer: new KintoneAppDeployer(client, config.appId)
1533
1475
  };
1534
1476
  }
@@ -2237,6 +2179,55 @@ function resolveFilePath(options) {
2237
2179
  return options.cliValue ?? options.envVar ?? (options.app && options.appFileField?.(options.app)) ?? (options.app ? join(options.defaultDir, `${options.app.name}.yaml`) : options.defaultFileName);
2238
2180
  }
2239
2181
 
2182
+ //#endregion
2183
+ //#region src/cli/createDomainConfigResolver.ts
2184
+ /**
2185
+ * Factory that eliminates per-domain boilerplate for CLI config resolution.
2186
+ *
2187
+ * Returns three functions — `resolveFilePath`, `resolveContainerConfig`, and
2188
+ * `resolveAppContainerConfig` — whose behavior is driven by the supplied
2189
+ * domain-specific options.
2190
+ *
2191
+ * `envVar` is a thunk (not a plain value) so that `process.env` look-ups
2192
+ * happen at call time rather than at module-load time, which keeps tests
2193
+ * deterministic and respects runtime env overrides.
2194
+ */
2195
+ function createDomainConfigResolver(options) {
2196
+ function resolveDomainFilePath(cliValues, app) {
2197
+ return resolveFilePath({
2198
+ cliValue: cliValues[options.fileArgKey],
2199
+ envVar: options.envVar(),
2200
+ appFileField: options.appFileField,
2201
+ app,
2202
+ defaultDir: options.defaultDir,
2203
+ defaultFileName: options.defaultFileName
2204
+ });
2205
+ }
2206
+ function resolveContainerConfig(cliValues) {
2207
+ const config = resolveConfig(cliValues);
2208
+ return options.buildConfig({
2209
+ baseUrl: config.baseUrl,
2210
+ auth: config.auth,
2211
+ appId: config.appId,
2212
+ guestSpaceId: config.guestSpaceId
2213
+ }, resolveDomainFilePath(cliValues));
2214
+ }
2215
+ function resolveAppContainerConfig(app, projectConfig, cliValues) {
2216
+ const config = resolveAppCliConfig(app, projectConfig, cliValues);
2217
+ return options.buildConfig({
2218
+ baseUrl: config.baseUrl,
2219
+ auth: config.auth,
2220
+ appId: config.appId,
2221
+ guestSpaceId: config.guestSpaceId
2222
+ }, resolveDomainFilePath(cliValues, app));
2223
+ }
2224
+ return {
2225
+ resolveFilePath: resolveDomainFilePath,
2226
+ resolveContainerConfig,
2227
+ resolveAppContainerConfig
2228
+ };
2229
+ }
2230
+
2240
2231
  //#endregion
2241
2232
  //#region src/cli/actionConfig.ts
2242
2233
  const actionArgs = {
@@ -2247,36 +2238,17 @@ const actionArgs = {
2247
2238
  description: "Action file path (default: actions.yaml)"
2248
2239
  }
2249
2240
  };
2250
- function resolveActionFilePath(cliValues, app) {
2251
- return resolveFilePath({
2252
- cliValue: cliValues["action-file"],
2253
- envVar: process.env.ACTION_FILE_PATH,
2254
- appFileField: (a) => a.actionFile,
2255
- app,
2256
- defaultDir: "action",
2257
- defaultFileName: "actions.yaml"
2258
- });
2259
- }
2260
- function resolveActionContainerConfig(cliValues) {
2261
- const config = resolveConfig(cliValues);
2262
- return {
2263
- baseUrl: config.baseUrl,
2264
- auth: config.auth,
2265
- appId: config.appId,
2266
- guestSpaceId: config.guestSpaceId,
2267
- actionFilePath: resolveActionFilePath(cliValues)
2268
- };
2269
- }
2270
- function resolveActionAppContainerConfig(app, projectConfig, cliValues) {
2271
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
2272
- return {
2273
- baseUrl: config.baseUrl,
2274
- auth: config.auth,
2275
- appId: config.appId,
2276
- guestSpaceId: config.guestSpaceId,
2277
- actionFilePath: resolveActionFilePath(cliValues, app)
2278
- };
2279
- }
2241
+ const { resolveFilePath: resolveActionFilePath, resolveContainerConfig: resolveActionContainerConfig, resolveAppContainerConfig: resolveActionAppContainerConfig } = createDomainConfigResolver({
2242
+ fileArgKey: "action-file",
2243
+ envVar: () => process.env.ACTION_FILE_PATH,
2244
+ appFileField: (a) => a.actionFile,
2245
+ defaultDir: "action",
2246
+ defaultFileName: "actions.yaml",
2247
+ buildConfig: (base, filePath) => ({
2248
+ ...base,
2249
+ actionFilePath: filePath
2250
+ })
2251
+ });
2280
2252
 
2281
2253
  //#endregion
2282
2254
  //#region src/cli/commands/action/apply.ts
@@ -2522,30 +2494,9 @@ var KintoneAdminNotesConfigurator = class {
2522
2494
 
2523
2495
  //#endregion
2524
2496
  //#region src/core/adapters/local/adminNotesStorage.ts
2525
- var LocalFileAdminNotesStorage = class {
2526
- constructor(filePath) {
2527
- this.filePath = filePath;
2528
- }
2529
- async get() {
2530
- try {
2531
- return {
2532
- exists: true,
2533
- content: await readFile(this.filePath, "utf-8")
2534
- };
2535
- } catch (error) {
2536
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
2537
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read admin notes file: ${this.filePath}`, error);
2538
- }
2539
- }
2540
- async update(content) {
2541
- try {
2542
- await mkdir(dirname(this.filePath), { recursive: true });
2543
- await writeFile(this.filePath, content, "utf-8");
2544
- } catch (error) {
2545
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write admin notes file: ${this.filePath}`, error);
2546
- }
2547
- }
2548
- };
2497
+ function createLocalFileAdminNotesStorage(filePath) {
2498
+ return createLocalFileStorage(filePath, "admin notes file");
2499
+ }
2549
2500
 
2550
2501
  //#endregion
2551
2502
  //#region src/core/application/container/adminNotesCli.ts
@@ -2557,7 +2508,7 @@ function createAdminNotesCliContainer(config) {
2557
2508
  });
2558
2509
  return {
2559
2510
  adminNotesConfigurator: new KintoneAdminNotesConfigurator(client, config.appId),
2560
- adminNotesStorage: new LocalFileAdminNotesStorage(config.adminNotesFilePath),
2511
+ adminNotesStorage: createLocalFileAdminNotesStorage(config.adminNotesFilePath),
2561
2512
  appDeployer: new KintoneAppDeployer(client, config.appId)
2562
2513
  };
2563
2514
  }
@@ -2572,36 +2523,17 @@ const adminNotesArgs = {
2572
2523
  description: "Admin notes file path (default: admin-notes.yaml)"
2573
2524
  }
2574
2525
  };
2575
- function resolveAdminNotesFilePath(cliValues, app) {
2576
- return resolveFilePath({
2577
- cliValue: cliValues["admin-notes-file"],
2578
- envVar: process.env.ADMIN_NOTES_FILE_PATH,
2579
- appFileField: (a) => a.adminNotesFile,
2580
- app,
2581
- defaultDir: "admin-notes",
2582
- defaultFileName: "admin-notes.yaml"
2583
- });
2584
- }
2585
- function resolveAdminNotesContainerConfig(cliValues) {
2586
- const config = resolveConfig(cliValues);
2587
- return {
2588
- baseUrl: config.baseUrl,
2589
- auth: config.auth,
2590
- appId: config.appId,
2591
- guestSpaceId: config.guestSpaceId,
2592
- adminNotesFilePath: resolveAdminNotesFilePath(cliValues)
2593
- };
2594
- }
2595
- function resolveAdminNotesAppContainerConfig(app, projectConfig, cliValues) {
2596
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
2597
- return {
2598
- baseUrl: config.baseUrl,
2599
- auth: config.auth,
2600
- appId: config.appId,
2601
- guestSpaceId: config.guestSpaceId,
2602
- adminNotesFilePath: resolveAdminNotesFilePath(cliValues, app)
2603
- };
2604
- }
2526
+ const { resolveFilePath: resolveAdminNotesFilePath, resolveContainerConfig: resolveAdminNotesContainerConfig, resolveAppContainerConfig: resolveAdminNotesAppContainerConfig } = createDomainConfigResolver({
2527
+ fileArgKey: "admin-notes-file",
2528
+ envVar: () => process.env.ADMIN_NOTES_FILE_PATH,
2529
+ appFileField: (a) => a.adminNotesFile,
2530
+ defaultDir: "admin-notes",
2531
+ defaultFileName: "admin-notes.yaml",
2532
+ buildConfig: (base, filePath) => ({
2533
+ ...base,
2534
+ adminNotesFilePath: filePath
2535
+ })
2536
+ });
2605
2537
 
2606
2538
  //#endregion
2607
2539
  //#region src/cli/commands/admin-notes/apply.ts
@@ -2903,30 +2835,9 @@ var KintoneAppPermissionConfigurator = class {
2903
2835
 
2904
2836
  //#endregion
2905
2837
  //#region src/core/adapters/local/appPermissionStorage.ts
2906
- var LocalFileAppPermissionStorage = class {
2907
- constructor(filePath) {
2908
- this.filePath = filePath;
2909
- }
2910
- async get() {
2911
- try {
2912
- return {
2913
- exists: true,
2914
- content: await readFile(this.filePath, "utf-8")
2915
- };
2916
- } catch (error) {
2917
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
2918
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read app permission file: ${this.filePath}`, error);
2919
- }
2920
- }
2921
- async update(content) {
2922
- try {
2923
- await mkdir(dirname(this.filePath), { recursive: true });
2924
- await writeFile(this.filePath, content, "utf-8");
2925
- } catch (error) {
2926
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write app permission file: ${this.filePath}`, error);
2927
- }
2928
- }
2929
- };
2838
+ function createLocalFileAppPermissionStorage(filePath) {
2839
+ return createLocalFileStorage(filePath, "app permission file");
2840
+ }
2930
2841
 
2931
2842
  //#endregion
2932
2843
  //#region src/core/application/container/appPermissionCli.ts
@@ -2938,7 +2849,7 @@ function createAppPermissionCliContainer(config) {
2938
2849
  });
2939
2850
  return {
2940
2851
  appPermissionConfigurator: new KintoneAppPermissionConfigurator(client, config.appId),
2941
- appPermissionStorage: new LocalFileAppPermissionStorage(config.appAclFilePath),
2852
+ appPermissionStorage: createLocalFileAppPermissionStorage(config.appAclFilePath),
2942
2853
  appDeployer: new KintoneAppDeployer(client, config.appId)
2943
2854
  };
2944
2855
  }
@@ -2953,36 +2864,17 @@ const appAclArgs = {
2953
2864
  description: "App ACL file path (default: app-acl.yaml)"
2954
2865
  }
2955
2866
  };
2956
- function resolveAppAclFilePath(cliValues, app) {
2957
- return resolveFilePath({
2958
- cliValue: cliValues["app-acl-file"],
2959
- envVar: process.env.APP_ACL_FILE_PATH,
2960
- appFileField: (a) => a.appAclFile,
2961
- app,
2962
- defaultDir: "app-acl",
2963
- defaultFileName: "app-acl.yaml"
2964
- });
2965
- }
2966
- function resolveAppAclContainerConfig(cliValues) {
2967
- const config = resolveConfig(cliValues);
2968
- return {
2969
- baseUrl: config.baseUrl,
2970
- auth: config.auth,
2971
- appId: config.appId,
2972
- guestSpaceId: config.guestSpaceId,
2973
- appAclFilePath: resolveAppAclFilePath(cliValues)
2974
- };
2975
- }
2976
- function resolveAppAclAppContainerConfig(app, projectConfig, cliValues) {
2977
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
2978
- return {
2979
- baseUrl: config.baseUrl,
2980
- auth: config.auth,
2981
- appId: config.appId,
2982
- guestSpaceId: config.guestSpaceId,
2983
- appAclFilePath: resolveAppAclFilePath(cliValues, app)
2984
- };
2985
- }
2867
+ const { resolveFilePath: resolveAppAclFilePath, resolveContainerConfig: resolveAppAclContainerConfig, resolveAppContainerConfig: resolveAppAclAppContainerConfig } = createDomainConfigResolver({
2868
+ fileArgKey: "app-acl-file",
2869
+ envVar: () => process.env.APP_ACL_FILE_PATH,
2870
+ appFileField: (a) => a.appAclFile,
2871
+ defaultDir: "app-acl",
2872
+ defaultFileName: "app-acl.yaml",
2873
+ buildConfig: (base, filePath) => ({
2874
+ ...base,
2875
+ appAclFilePath: filePath
2876
+ })
2877
+ });
2986
2878
 
2987
2879
  //#endregion
2988
2880
  //#region src/cli/commands/app-acl/apply.ts
@@ -3292,36 +3184,17 @@ const customizeArgs = {
3292
3184
  description: "Customization config file path (default: customize.yaml)"
3293
3185
  }
3294
3186
  };
3295
- function resolveCustomizeFilePath(cliValues, app) {
3296
- return resolveFilePath({
3297
- cliValue: cliValues["customize-file"],
3298
- envVar: process.env.CUSTOMIZE_FILE_PATH,
3299
- appFileField: (a) => a.customizeFile,
3300
- app,
3301
- defaultDir: "customize",
3302
- defaultFileName: "customize.yaml"
3303
- });
3304
- }
3305
- function resolveCustomizeConfig(cliValues) {
3306
- const config = resolveConfig(cliValues);
3307
- return {
3308
- baseUrl: config.baseUrl,
3309
- auth: config.auth,
3310
- appId: config.appId,
3311
- guestSpaceId: config.guestSpaceId,
3312
- customizeFilePath: resolveCustomizeFilePath(cliValues)
3313
- };
3314
- }
3315
- function resolveCustomizeAppConfig(app, projectConfig, cliValues) {
3316
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
3317
- return {
3318
- baseUrl: config.baseUrl,
3319
- auth: config.auth,
3320
- appId: config.appId,
3321
- guestSpaceId: config.guestSpaceId,
3322
- customizeFilePath: resolveCustomizeFilePath(cliValues, app)
3323
- };
3324
- }
3187
+ const { resolveFilePath: resolveCustomizeFilePath, resolveContainerConfig: resolveCustomizeConfig, resolveAppContainerConfig: resolveCustomizeAppConfig } = createDomainConfigResolver({
3188
+ fileArgKey: "customize-file",
3189
+ envVar: () => process.env.CUSTOMIZE_FILE_PATH,
3190
+ appFileField: (a) => a.customizeFile,
3191
+ defaultDir: "customize",
3192
+ defaultFileName: "customize.yaml",
3193
+ buildConfig: (base, filePath) => ({
3194
+ ...base,
3195
+ customizeFilePath: filePath
3196
+ })
3197
+ });
3325
3198
 
3326
3199
  //#endregion
3327
3200
  //#region src/core/domain/customization/services/configSerializer.ts
@@ -3720,30 +3593,9 @@ var KintoneFieldPermissionConfigurator = class {
3720
3593
 
3721
3594
  //#endregion
3722
3595
  //#region src/core/adapters/local/fieldPermissionStorage.ts
3723
- var LocalFileFieldPermissionStorage = class {
3724
- constructor(filePath) {
3725
- this.filePath = filePath;
3726
- }
3727
- async get() {
3728
- try {
3729
- return {
3730
- exists: true,
3731
- content: await readFile(this.filePath, "utf-8")
3732
- };
3733
- } catch (error) {
3734
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
3735
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read field permission file: ${this.filePath}`, error);
3736
- }
3737
- }
3738
- async update(content) {
3739
- try {
3740
- await mkdir(dirname(this.filePath), { recursive: true });
3741
- await writeFile(this.filePath, content, "utf-8");
3742
- } catch (error) {
3743
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write field permission file: ${this.filePath}`, error);
3744
- }
3745
- }
3746
- };
3596
+ function createLocalFileFieldPermissionStorage(filePath) {
3597
+ return createLocalFileStorage(filePath, "field permission file");
3598
+ }
3747
3599
 
3748
3600
  //#endregion
3749
3601
  //#region src/core/application/container/fieldPermissionCli.ts
@@ -3755,7 +3607,7 @@ function createFieldPermissionCliContainer(config) {
3755
3607
  });
3756
3608
  return {
3757
3609
  fieldPermissionConfigurator: new KintoneFieldPermissionConfigurator(client, config.appId),
3758
- fieldPermissionStorage: new LocalFileFieldPermissionStorage(config.fieldAclFilePath),
3610
+ fieldPermissionStorage: createLocalFileFieldPermissionStorage(config.fieldAclFilePath),
3759
3611
  appDeployer: new KintoneAppDeployer(client, config.appId)
3760
3612
  };
3761
3613
  }
@@ -3858,36 +3710,17 @@ const fieldAclArgs = {
3858
3710
  description: "Field ACL file path (default: field-acl.yaml)"
3859
3711
  }
3860
3712
  };
3861
- function resolveFieldAclFilePath(cliValues, app) {
3862
- return resolveFilePath({
3863
- cliValue: cliValues["field-acl-file"],
3864
- envVar: process.env.FIELD_ACL_FILE_PATH,
3865
- appFileField: (a) => a.fieldAclFile,
3866
- app,
3867
- defaultDir: "field-acl",
3868
- defaultFileName: "field-acl.yaml"
3869
- });
3870
- }
3871
- function resolveFieldAclContainerConfig(cliValues) {
3872
- const config = resolveConfig(cliValues);
3873
- return {
3874
- baseUrl: config.baseUrl,
3875
- auth: config.auth,
3876
- appId: config.appId,
3877
- guestSpaceId: config.guestSpaceId,
3878
- fieldAclFilePath: resolveFieldAclFilePath(cliValues)
3879
- };
3880
- }
3881
- function resolveFieldAclAppContainerConfig(app, projectConfig, cliValues) {
3882
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
3883
- return {
3884
- baseUrl: config.baseUrl,
3885
- auth: config.auth,
3886
- appId: config.appId,
3887
- guestSpaceId: config.guestSpaceId,
3888
- fieldAclFilePath: resolveFieldAclFilePath(cliValues, app)
3889
- };
3890
- }
3713
+ const { resolveFilePath: resolveFieldAclFilePath, resolveContainerConfig: resolveFieldAclContainerConfig, resolveAppContainerConfig: resolveFieldAclAppContainerConfig } = createDomainConfigResolver({
3714
+ fileArgKey: "field-acl-file",
3715
+ envVar: () => process.env.FIELD_ACL_FILE_PATH,
3716
+ appFileField: (a) => a.fieldAclFile,
3717
+ defaultDir: "field-acl",
3718
+ defaultFileName: "field-acl.yaml",
3719
+ buildConfig: (base, filePath) => ({
3720
+ ...base,
3721
+ fieldAclFilePath: filePath
3722
+ })
3723
+ });
3891
3724
 
3892
3725
  //#endregion
3893
3726
  //#region src/cli/commands/field-acl/apply.ts
@@ -4169,30 +4002,9 @@ var KintoneGeneralSettingsConfigurator = class {
4169
4002
 
4170
4003
  //#endregion
4171
4004
  //#region src/core/adapters/local/generalSettingsStorage.ts
4172
- var LocalFileGeneralSettingsStorage = class {
4173
- constructor(filePath) {
4174
- this.filePath = filePath;
4175
- }
4176
- async get() {
4177
- try {
4178
- return {
4179
- exists: true,
4180
- content: await readFile(this.filePath, "utf-8")
4181
- };
4182
- } catch (error) {
4183
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
4184
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read general settings file: ${this.filePath}`, error);
4185
- }
4186
- }
4187
- async update(content) {
4188
- try {
4189
- await mkdir(dirname(this.filePath), { recursive: true });
4190
- await writeFile(this.filePath, content, "utf-8");
4191
- } catch (error) {
4192
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write general settings file: ${this.filePath}`, error);
4193
- }
4194
- }
4195
- };
4005
+ function createLocalFileGeneralSettingsStorage(filePath) {
4006
+ return createLocalFileStorage(filePath, "general settings file");
4007
+ }
4196
4008
 
4197
4009
  //#endregion
4198
4010
  //#region src/core/application/container/generalSettingsCli.ts
@@ -4204,7 +4016,7 @@ function createGeneralSettingsCliContainer(config) {
4204
4016
  });
4205
4017
  return {
4206
4018
  generalSettingsConfigurator: new KintoneGeneralSettingsConfigurator(client, config.appId),
4207
- generalSettingsStorage: new LocalFileGeneralSettingsStorage(config.settingsFilePath),
4019
+ generalSettingsStorage: createLocalFileGeneralSettingsStorage(config.settingsFilePath),
4208
4020
  appDeployer: new KintoneAppDeployer(client, config.appId)
4209
4021
  };
4210
4022
  }
@@ -4438,30 +4250,9 @@ var KintoneNotificationConfigurator = class {
4438
4250
 
4439
4251
  //#endregion
4440
4252
  //#region src/core/adapters/local/notificationStorage.ts
4441
- var LocalFileNotificationStorage = class {
4442
- constructor(filePath) {
4443
- this.filePath = filePath;
4444
- }
4445
- async get() {
4446
- try {
4447
- return {
4448
- exists: true,
4449
- content: await readFile(this.filePath, "utf-8")
4450
- };
4451
- } catch (error) {
4452
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
4453
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read notification file: ${this.filePath}`, error);
4454
- }
4455
- }
4456
- async update(content) {
4457
- try {
4458
- await mkdir(dirname(this.filePath), { recursive: true });
4459
- await writeFile(this.filePath, content, "utf-8");
4460
- } catch (error) {
4461
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write notification file: ${this.filePath}`, error);
4462
- }
4463
- }
4464
- };
4253
+ function createLocalFileNotificationStorage(filePath) {
4254
+ return createLocalFileStorage(filePath, "notification file");
4255
+ }
4465
4256
 
4466
4257
  //#endregion
4467
4258
  //#region src/core/application/container/notificationCli.ts
@@ -4473,7 +4264,7 @@ function createNotificationCliContainer(config) {
4473
4264
  });
4474
4265
  return {
4475
4266
  notificationConfigurator: new KintoneNotificationConfigurator(client, config.appId),
4476
- notificationStorage: new LocalFileNotificationStorage(config.notificationFilePath),
4267
+ notificationStorage: createLocalFileNotificationStorage(config.notificationFilePath),
4477
4268
  appDeployer: new KintoneAppDeployer(client, config.appId)
4478
4269
  };
4479
4270
  }
@@ -4522,30 +4313,9 @@ var KintonePluginConfigurator = class {
4522
4313
 
4523
4314
  //#endregion
4524
4315
  //#region src/core/adapters/local/pluginStorage.ts
4525
- var LocalFilePluginStorage = class {
4526
- constructor(filePath) {
4527
- this.filePath = filePath;
4528
- }
4529
- async get() {
4530
- try {
4531
- return {
4532
- exists: true,
4533
- content: await readFile(this.filePath, "utf-8")
4534
- };
4535
- } catch (error) {
4536
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
4537
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read plugin file: ${this.filePath}`, error);
4538
- }
4539
- }
4540
- async update(content) {
4541
- try {
4542
- await mkdir(dirname(this.filePath), { recursive: true });
4543
- await writeFile(this.filePath, content, "utf-8");
4544
- } catch (error) {
4545
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write plugin file: ${this.filePath}`, error);
4546
- }
4547
- }
4548
- };
4316
+ function createLocalFilePluginStorage(filePath) {
4317
+ return createLocalFileStorage(filePath, "plugin file");
4318
+ }
4549
4319
 
4550
4320
  //#endregion
4551
4321
  //#region src/core/application/container/pluginCli.ts
@@ -4557,7 +4327,7 @@ function createPluginCliContainer(config) {
4557
4327
  });
4558
4328
  return {
4559
4329
  pluginConfigurator: new KintonePluginConfigurator(client, config.appId),
4560
- pluginStorage: new LocalFilePluginStorage(config.pluginFilePath),
4330
+ pluginStorage: createLocalFilePluginStorage(config.pluginFilePath),
4561
4331
  appDeployer: new KintoneAppDeployer(client, config.appId)
4562
4332
  };
4563
4333
  }
@@ -4700,30 +4470,9 @@ var KintoneProcessManagementConfigurator = class {
4700
4470
 
4701
4471
  //#endregion
4702
4472
  //#region src/core/adapters/local/processManagementStorage.ts
4703
- var LocalFileProcessManagementStorage = class {
4704
- constructor(filePath) {
4705
- this.filePath = filePath;
4706
- }
4707
- async get() {
4708
- try {
4709
- return {
4710
- exists: true,
4711
- content: await readFile(this.filePath, "utf-8")
4712
- };
4713
- } catch (error) {
4714
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
4715
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read process management file: ${this.filePath}`, error);
4716
- }
4717
- }
4718
- async update(content) {
4719
- try {
4720
- await mkdir(dirname(this.filePath), { recursive: true });
4721
- await writeFile(this.filePath, content, "utf-8");
4722
- } catch (error) {
4723
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write process management file: ${this.filePath}`, error);
4724
- }
4725
- }
4726
- };
4473
+ function createLocalFileProcessManagementStorage(filePath) {
4474
+ return createLocalFileStorage(filePath, "process management file");
4475
+ }
4727
4476
 
4728
4477
  //#endregion
4729
4478
  //#region src/core/application/container/processManagementCli.ts
@@ -4735,7 +4484,7 @@ function createProcessManagementCliContainer(config) {
4735
4484
  });
4736
4485
  return {
4737
4486
  processManagementConfigurator: new KintoneProcessManagementConfigurator(client, config.appId),
4738
- processManagementStorage: new LocalFileProcessManagementStorage(config.processFilePath),
4487
+ processManagementStorage: createLocalFileProcessManagementStorage(config.processFilePath),
4739
4488
  appDeployer: new KintoneAppDeployer(client, config.appId)
4740
4489
  };
4741
4490
  }
@@ -4824,30 +4573,9 @@ var KintoneRecordPermissionConfigurator = class {
4824
4573
 
4825
4574
  //#endregion
4826
4575
  //#region src/core/adapters/local/recordPermissionStorage.ts
4827
- var LocalFileRecordPermissionStorage = class {
4828
- constructor(filePath) {
4829
- this.filePath = filePath;
4830
- }
4831
- async get() {
4832
- try {
4833
- return {
4834
- exists: true,
4835
- content: await readFile(this.filePath, "utf-8")
4836
- };
4837
- } catch (error) {
4838
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
4839
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read record permission file: ${this.filePath}`, error);
4840
- }
4841
- }
4842
- async update(content) {
4843
- try {
4844
- await mkdir(dirname(this.filePath), { recursive: true });
4845
- await writeFile(this.filePath, content, "utf-8");
4846
- } catch (error) {
4847
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write record permission file: ${this.filePath}`, error);
4848
- }
4849
- }
4850
- };
4576
+ function createLocalFileRecordPermissionStorage(filePath) {
4577
+ return createLocalFileStorage(filePath, "record permission file");
4578
+ }
4851
4579
 
4852
4580
  //#endregion
4853
4581
  //#region src/core/application/container/recordPermissionCli.ts
@@ -4859,7 +4587,7 @@ function createRecordPermissionCliContainer(config) {
4859
4587
  });
4860
4588
  return {
4861
4589
  recordPermissionConfigurator: new KintoneRecordPermissionConfigurator(client, config.appId),
4862
- recordPermissionStorage: new LocalFileRecordPermissionStorage(config.recordAclFilePath),
4590
+ recordPermissionStorage: createLocalFileRecordPermissionStorage(config.recordAclFilePath),
4863
4591
  appDeployer: new KintoneAppDeployer(client, config.appId)
4864
4592
  };
4865
4593
  }
@@ -5081,30 +4809,9 @@ var KintoneReportConfigurator = class {
5081
4809
 
5082
4810
  //#endregion
5083
4811
  //#region src/core/adapters/local/reportStorage.ts
5084
- var LocalFileReportStorage = class {
5085
- constructor(filePath) {
5086
- this.filePath = filePath;
5087
- }
5088
- async get() {
5089
- try {
5090
- return {
5091
- exists: true,
5092
- content: await readFile(this.filePath, "utf-8")
5093
- };
5094
- } catch (error) {
5095
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
5096
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read report file: ${this.filePath}`, error);
5097
- }
5098
- }
5099
- async update(content) {
5100
- try {
5101
- await mkdir(dirname(this.filePath), { recursive: true });
5102
- await writeFile(this.filePath, content, "utf-8");
5103
- } catch (error) {
5104
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write report file: ${this.filePath}`, error);
5105
- }
5106
- }
5107
- };
4812
+ function createLocalFileReportStorage(filePath) {
4813
+ return createLocalFileStorage(filePath, "report file");
4814
+ }
5108
4815
 
5109
4816
  //#endregion
5110
4817
  //#region src/core/application/container/reportCli.ts
@@ -5116,7 +4823,7 @@ function createReportCliContainer(config) {
5116
4823
  });
5117
4824
  return {
5118
4825
  reportConfigurator: new KintoneReportConfigurator(client, config.appId),
5119
- reportStorage: new LocalFileReportStorage(config.reportFilePath),
4826
+ reportStorage: createLocalFileReportStorage(config.reportFilePath),
5120
4827
  appDeployer: new KintoneAppDeployer(client, config.appId)
5121
4828
  };
5122
4829
  }
@@ -5216,30 +4923,9 @@ var KintoneViewConfigurator = class {
5216
4923
 
5217
4924
  //#endregion
5218
4925
  //#region src/core/adapters/local/viewStorage.ts
5219
- var LocalFileViewStorage = class {
5220
- constructor(filePath) {
5221
- this.filePath = filePath;
5222
- }
5223
- async get() {
5224
- try {
5225
- return {
5226
- exists: true,
5227
- content: await readFile(this.filePath, "utf-8")
5228
- };
5229
- } catch (error) {
5230
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
5231
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read view file: ${this.filePath}`, error);
5232
- }
5233
- }
5234
- async update(content) {
5235
- try {
5236
- await mkdir(dirname(this.filePath), { recursive: true });
5237
- await writeFile(this.filePath, content, "utf-8");
5238
- } catch (error) {
5239
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write view file: ${this.filePath}`, error);
5240
- }
5241
- }
5242
- };
4926
+ function createLocalFileViewStorage(filePath) {
4927
+ return createLocalFileStorage(filePath, "view file");
4928
+ }
5243
4929
 
5244
4930
  //#endregion
5245
4931
  //#region src/core/application/container/viewCli.ts
@@ -5251,7 +4937,7 @@ function createViewCliContainer(config) {
5251
4937
  });
5252
4938
  return {
5253
4939
  viewConfigurator: new KintoneViewConfigurator(client, config.appId),
5254
- viewStorage: new LocalFileViewStorage(config.viewFilePath),
4940
+ viewStorage: createLocalFileViewStorage(config.viewFilePath),
5255
4941
  appDeployer: new KintoneAppDeployer(client, config.appId)
5256
4942
  };
5257
4943
  }
@@ -5376,30 +5062,9 @@ var KintoneSpaceReader = class {
5376
5062
 
5377
5063
  //#endregion
5378
5064
  //#region src/core/adapters/local/projectConfigStorage.ts
5379
- var LocalFileProjectConfigStorage = class {
5380
- constructor(filePath) {
5381
- this.filePath = filePath;
5382
- }
5383
- async get() {
5384
- try {
5385
- return {
5386
- exists: true,
5387
- content: await readFile(this.filePath, "utf-8")
5388
- };
5389
- } catch (error) {
5390
- if (isNodeError(error) && error.code === "ENOENT") return { exists: false };
5391
- throw new SystemError(SystemErrorCode.StorageError, `Failed to read project config file: ${this.filePath}`, error);
5392
- }
5393
- }
5394
- async update(content) {
5395
- try {
5396
- await mkdir(dirname(this.filePath), { recursive: true });
5397
- await writeFile(this.filePath, content, "utf-8");
5398
- } catch (error) {
5399
- throw new SystemError(SystemErrorCode.StorageError, `Failed to write project config file: ${this.filePath}`, error);
5400
- }
5401
- }
5402
- };
5065
+ function createLocalFileProjectConfigStorage(filePath) {
5066
+ return createLocalFileStorage(filePath, "project config file");
5067
+ }
5403
5068
 
5404
5069
  //#endregion
5405
5070
  //#region src/core/application/container/initCli.ts
@@ -5410,7 +5075,7 @@ function createInitCliContainer(config) {
5410
5075
  auth: buildKintoneAuth(config.auth),
5411
5076
  guestSpaceId: config.guestSpaceId
5412
5077
  })),
5413
- projectConfigStorage: new LocalFileProjectConfigStorage(config.configFilePath)
5078
+ projectConfigStorage: createLocalFileProjectConfigStorage(config.configFilePath)
5414
5079
  };
5415
5080
  }
5416
5081
 
@@ -6534,36 +6199,17 @@ const notificationArgs = {
6534
6199
  description: "Notification file path (default: notification.yaml)"
6535
6200
  }
6536
6201
  };
6537
- function resolveNotificationFilePath(cliValues, app) {
6538
- return resolveFilePath({
6539
- cliValue: cliValues["notification-file"],
6540
- envVar: process.env.NOTIFICATION_FILE_PATH,
6541
- appFileField: (a) => a.notificationFile,
6542
- app,
6543
- defaultDir: "notification",
6544
- defaultFileName: "notification.yaml"
6545
- });
6546
- }
6547
- function resolveNotificationContainerConfig(cliValues) {
6548
- const config = resolveConfig(cliValues);
6549
- return {
6550
- baseUrl: config.baseUrl,
6551
- auth: config.auth,
6552
- appId: config.appId,
6553
- guestSpaceId: config.guestSpaceId,
6554
- notificationFilePath: resolveNotificationFilePath(cliValues)
6555
- };
6556
- }
6557
- function resolveNotificationAppContainerConfig(app, projectConfig, cliValues) {
6558
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
6559
- return {
6560
- baseUrl: config.baseUrl,
6561
- auth: config.auth,
6562
- appId: config.appId,
6563
- guestSpaceId: config.guestSpaceId,
6564
- notificationFilePath: resolveNotificationFilePath(cliValues, app)
6565
- };
6566
- }
6202
+ const { resolveFilePath: resolveNotificationFilePath, resolveContainerConfig: resolveNotificationContainerConfig, resolveAppContainerConfig: resolveNotificationAppContainerConfig } = createDomainConfigResolver({
6203
+ fileArgKey: "notification-file",
6204
+ envVar: () => process.env.NOTIFICATION_FILE_PATH,
6205
+ appFileField: (a) => a.notificationFile,
6206
+ defaultDir: "notification",
6207
+ defaultFileName: "notification.yaml",
6208
+ buildConfig: (base, filePath) => ({
6209
+ ...base,
6210
+ notificationFilePath: filePath
6211
+ })
6212
+ });
6567
6213
 
6568
6214
  //#endregion
6569
6215
  //#region src/cli/commands/notification/apply.ts
@@ -6723,36 +6369,17 @@ const pluginArgs = {
6723
6369
  description: "Plugin file path (default: plugins.yaml)"
6724
6370
  }
6725
6371
  };
6726
- function resolvePluginFilePath(cliValues, app) {
6727
- return resolveFilePath({
6728
- cliValue: cliValues["plugin-file"],
6729
- envVar: process.env.PLUGIN_FILE_PATH,
6730
- appFileField: (a) => a.pluginFile,
6731
- app,
6732
- defaultDir: "plugin",
6733
- defaultFileName: "plugins.yaml"
6734
- });
6735
- }
6736
- function resolvePluginContainerConfig(cliValues) {
6737
- const config = resolveConfig(cliValues);
6738
- return {
6739
- baseUrl: config.baseUrl,
6740
- auth: config.auth,
6741
- appId: config.appId,
6742
- guestSpaceId: config.guestSpaceId,
6743
- pluginFilePath: resolvePluginFilePath(cliValues)
6744
- };
6745
- }
6746
- function resolvePluginAppContainerConfig(app, projectConfig, cliValues) {
6747
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
6748
- return {
6749
- baseUrl: config.baseUrl,
6750
- auth: config.auth,
6751
- appId: config.appId,
6752
- guestSpaceId: config.guestSpaceId,
6753
- pluginFilePath: resolvePluginFilePath(cliValues, app)
6754
- };
6755
- }
6372
+ const { resolveFilePath: resolvePluginFilePath, resolveContainerConfig: resolvePluginContainerConfig, resolveAppContainerConfig: resolvePluginAppContainerConfig } = createDomainConfigResolver({
6373
+ fileArgKey: "plugin-file",
6374
+ envVar: () => process.env.PLUGIN_FILE_PATH,
6375
+ appFileField: (a) => a.pluginFile,
6376
+ defaultDir: "plugin",
6377
+ defaultFileName: "plugins.yaml",
6378
+ buildConfig: (base, filePath) => ({
6379
+ ...base,
6380
+ pluginFilePath: filePath
6381
+ })
6382
+ });
6756
6383
 
6757
6384
  //#endregion
6758
6385
  //#region src/cli/commands/plugin/apply.ts
@@ -6998,36 +6625,17 @@ const processArgs = {
6998
6625
  description: "Process management file path (default: process.yaml)"
6999
6626
  }
7000
6627
  };
7001
- function resolveProcessFilePath(cliValues, app) {
7002
- return resolveFilePath({
7003
- cliValue: cliValues["process-file"],
7004
- envVar: process.env.PROCESS_FILE_PATH,
7005
- appFileField: (a) => a.processFile,
7006
- app,
7007
- defaultDir: "process",
7008
- defaultFileName: "process.yaml"
7009
- });
7010
- }
7011
- function resolveProcessContainerConfig(cliValues) {
7012
- const config = resolveConfig(cliValues);
7013
- return {
7014
- baseUrl: config.baseUrl,
7015
- auth: config.auth,
7016
- appId: config.appId,
7017
- guestSpaceId: config.guestSpaceId,
7018
- processFilePath: resolveProcessFilePath(cliValues)
7019
- };
7020
- }
7021
- function resolveProcessAppContainerConfig(app, projectConfig, cliValues) {
7022
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
7023
- return {
7024
- baseUrl: config.baseUrl,
7025
- auth: config.auth,
7026
- appId: config.appId,
7027
- guestSpaceId: config.guestSpaceId,
7028
- processFilePath: resolveProcessFilePath(cliValues, app)
7029
- };
7030
- }
6628
+ const { resolveFilePath: resolveProcessFilePath, resolveContainerConfig: resolveProcessContainerConfig, resolveAppContainerConfig: resolveProcessAppContainerConfig } = createDomainConfigResolver({
6629
+ fileArgKey: "process-file",
6630
+ envVar: () => process.env.PROCESS_FILE_PATH,
6631
+ appFileField: (a) => a.processFile,
6632
+ defaultDir: "process",
6633
+ defaultFileName: "process.yaml",
6634
+ buildConfig: (base, filePath) => ({
6635
+ ...base,
6636
+ processFilePath: filePath
6637
+ })
6638
+ });
7031
6639
 
7032
6640
  //#endregion
7033
6641
  //#region src/cli/commands/process/apply.ts
@@ -7377,36 +6985,17 @@ const recordAclArgs = {
7377
6985
  description: "Record ACL file path (default: record-acl.yaml)"
7378
6986
  }
7379
6987
  };
7380
- function resolveRecordAclFilePath(cliValues, app) {
7381
- return resolveFilePath({
7382
- cliValue: cliValues["record-acl-file"],
7383
- envVar: process.env.RECORD_ACL_FILE_PATH,
7384
- appFileField: (a) => a.recordAclFile,
7385
- app,
7386
- defaultDir: "record-acl",
7387
- defaultFileName: "record-acl.yaml"
7388
- });
7389
- }
7390
- function resolveRecordAclContainerConfig(cliValues) {
7391
- const config = resolveConfig(cliValues);
7392
- return {
7393
- baseUrl: config.baseUrl,
7394
- auth: config.auth,
7395
- appId: config.appId,
7396
- guestSpaceId: config.guestSpaceId,
7397
- recordAclFilePath: resolveRecordAclFilePath(cliValues)
7398
- };
7399
- }
7400
- function resolveRecordAclAppContainerConfig(app, projectConfig, cliValues) {
7401
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
7402
- return {
7403
- baseUrl: config.baseUrl,
7404
- auth: config.auth,
7405
- appId: config.appId,
7406
- guestSpaceId: config.guestSpaceId,
7407
- recordAclFilePath: resolveRecordAclFilePath(cliValues, app)
7408
- };
7409
- }
6988
+ const { resolveFilePath: resolveRecordAclFilePath, resolveContainerConfig: resolveRecordAclContainerConfig, resolveAppContainerConfig: resolveRecordAclAppContainerConfig } = createDomainConfigResolver({
6989
+ fileArgKey: "record-acl-file",
6990
+ envVar: () => process.env.RECORD_ACL_FILE_PATH,
6991
+ appFileField: (a) => a.recordAclFile,
6992
+ defaultDir: "record-acl",
6993
+ defaultFileName: "record-acl.yaml",
6994
+ buildConfig: (base, filePath) => ({
6995
+ ...base,
6996
+ recordAclFilePath: filePath
6997
+ })
6998
+ });
7410
6999
 
7411
7000
  //#endregion
7412
7001
  //#region src/cli/commands/record-acl/apply.ts
@@ -7745,36 +7334,17 @@ const reportArgs = {
7745
7334
  description: "Report file path (default: reports.yaml)"
7746
7335
  }
7747
7336
  };
7748
- function resolveReportFilePath(cliValues, app) {
7749
- return resolveFilePath({
7750
- cliValue: cliValues["report-file"],
7751
- envVar: process.env.REPORT_FILE_PATH,
7752
- appFileField: (a) => a.reportFile,
7753
- app,
7754
- defaultDir: "report",
7755
- defaultFileName: "reports.yaml"
7756
- });
7757
- }
7758
- function resolveReportContainerConfig(cliValues) {
7759
- const config = resolveConfig(cliValues);
7760
- return {
7761
- baseUrl: config.baseUrl,
7762
- auth: config.auth,
7763
- appId: config.appId,
7764
- guestSpaceId: config.guestSpaceId,
7765
- reportFilePath: resolveReportFilePath(cliValues)
7766
- };
7767
- }
7768
- function resolveReportAppContainerConfig(app, projectConfig, cliValues) {
7769
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
7770
- return {
7771
- baseUrl: config.baseUrl,
7772
- auth: config.auth,
7773
- appId: config.appId,
7774
- guestSpaceId: config.guestSpaceId,
7775
- reportFilePath: resolveReportFilePath(cliValues, app)
7776
- };
7777
- }
7337
+ const { resolveFilePath: resolveReportFilePath, resolveContainerConfig: resolveReportContainerConfig, resolveAppContainerConfig: resolveReportAppContainerConfig } = createDomainConfigResolver({
7338
+ fileArgKey: "report-file",
7339
+ envVar: () => process.env.REPORT_FILE_PATH,
7340
+ appFileField: (a) => a.reportFile,
7341
+ defaultDir: "report",
7342
+ defaultFileName: "reports.yaml",
7343
+ buildConfig: (base, filePath) => ({
7344
+ ...base,
7345
+ reportFilePath: filePath
7346
+ })
7347
+ });
7778
7348
 
7779
7349
  //#endregion
7780
7350
  //#region src/cli/commands/report/apply.ts
@@ -9166,45 +8736,10 @@ var override_default = define({
9166
8736
  }
9167
8737
  });
9168
8738
 
9169
- //#endregion
9170
- //#region src/core/adapters/empty/appDeployer.ts
9171
- var EmptyAppDeployer = class {
9172
- async deploy() {
9173
- throw new SystemError(SystemErrorCode.InternalServerError, "EmptyAppDeployer.deploy not implemented");
9174
- }
9175
- };
9176
-
9177
- //#endregion
9178
- //#region src/core/adapters/empty/formConfigurator.ts
9179
- var EmptyFormConfigurator = class {
9180
- async getFields() {
9181
- throw new SystemError(SystemErrorCode.InternalServerError, "EmptyFormConfigurator.getFields not implemented");
9182
- }
9183
- async addFields(_fields) {
9184
- throw new SystemError(SystemErrorCode.InternalServerError, "EmptyFormConfigurator.addFields not implemented");
9185
- }
9186
- async updateFields(_fields) {
9187
- throw new SystemError(SystemErrorCode.InternalServerError, "EmptyFormConfigurator.updateFields not implemented");
9188
- }
9189
- async deleteFields(_fieldCodes) {
9190
- throw new SystemError(SystemErrorCode.InternalServerError, "EmptyFormConfigurator.deleteFields not implemented");
9191
- }
9192
- async getLayout() {
9193
- throw new SystemError(SystemErrorCode.InternalServerError, "EmptyFormConfigurator.getLayout not implemented");
9194
- }
9195
- async updateLayout(_layout) {
9196
- throw new SystemError(SystemErrorCode.InternalServerError, "EmptyFormConfigurator.updateLayout not implemented");
9197
- }
9198
- };
9199
-
9200
8739
  //#endregion
9201
8740
  //#region src/core/application/container/validateCli.ts
9202
8741
  function createValidateCliContainer(config) {
9203
- return {
9204
- formConfigurator: new EmptyFormConfigurator(),
9205
- schemaStorage: new LocalFileSchemaStorage(config.schemaFilePath),
9206
- appDeployer: new EmptyAppDeployer()
9207
- };
8742
+ return { schemaStorage: createLocalFileSchemaStorage(config.schemaFilePath) };
9208
8743
  }
9209
8744
 
9210
8745
  //#endregion
@@ -9494,36 +9029,17 @@ async function upsertSeed({ container, input }) {
9494
9029
 
9495
9030
  //#endregion
9496
9031
  //#region src/cli/commands/seed/config.ts
9497
- function resolveSeedFilePath(cliValues, app) {
9498
- return resolveFilePath({
9499
- cliValue: cliValues["seed-file"],
9500
- envVar: process.env.SEED_FILE_PATH,
9501
- appFileField: (a) => a.seedFile,
9502
- app,
9503
- defaultDir: "seeds",
9504
- defaultFileName: "seed.yaml"
9505
- });
9506
- }
9507
- function resolveSeedConfig(cliValues) {
9508
- const config = resolveConfig(cliValues);
9509
- return {
9510
- baseUrl: config.baseUrl,
9511
- auth: config.auth,
9512
- appId: config.appId,
9513
- guestSpaceId: config.guestSpaceId,
9514
- seedFilePath: resolveSeedFilePath(cliValues)
9515
- };
9516
- }
9517
- function resolveSeedAppConfig(app, projectConfig, cliValues) {
9518
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
9519
- return {
9520
- baseUrl: config.baseUrl,
9521
- auth: config.auth,
9522
- appId: config.appId,
9523
- guestSpaceId: config.guestSpaceId,
9524
- seedFilePath: resolveSeedFilePath(cliValues, app)
9525
- };
9526
- }
9032
+ const { resolveFilePath: resolveSeedFilePath, resolveContainerConfig: resolveSeedConfig, resolveAppContainerConfig: resolveSeedAppConfig } = createDomainConfigResolver({
9033
+ fileArgKey: "seed-file",
9034
+ envVar: () => process.env.SEED_FILE_PATH,
9035
+ appFileField: (a) => a.seedFile,
9036
+ defaultDir: "seeds",
9037
+ defaultFileName: "seed.yaml",
9038
+ buildConfig: (base, filePath) => ({
9039
+ ...base,
9040
+ seedFilePath: filePath
9041
+ })
9042
+ });
9527
9043
 
9528
9044
  //#endregion
9529
9045
  //#region src/cli/commands/seed/apply.ts
@@ -9831,36 +9347,17 @@ const settingsArgs = {
9831
9347
  description: "General settings file path (default: settings.yaml)"
9832
9348
  }
9833
9349
  };
9834
- function resolveSettingsFilePath(cliValues, app) {
9835
- return resolveFilePath({
9836
- cliValue: cliValues["settings-file"],
9837
- envVar: process.env.SETTINGS_FILE_PATH,
9838
- appFileField: (a) => a.settingsFile,
9839
- app,
9840
- defaultDir: "settings",
9841
- defaultFileName: "settings.yaml"
9842
- });
9843
- }
9844
- function resolveSettingsContainerConfig(cliValues) {
9845
- const config = resolveConfig(cliValues);
9846
- return {
9847
- baseUrl: config.baseUrl,
9848
- auth: config.auth,
9849
- appId: config.appId,
9850
- guestSpaceId: config.guestSpaceId,
9851
- settingsFilePath: resolveSettingsFilePath(cliValues)
9852
- };
9853
- }
9854
- function resolveSettingsAppContainerConfig(app, projectConfig, cliValues) {
9855
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
9856
- return {
9857
- baseUrl: config.baseUrl,
9858
- auth: config.auth,
9859
- appId: config.appId,
9860
- guestSpaceId: config.guestSpaceId,
9861
- settingsFilePath: resolveSettingsFilePath(cliValues, app)
9862
- };
9863
- }
9350
+ const { resolveFilePath: resolveSettingsFilePath, resolveContainerConfig: resolveSettingsContainerConfig, resolveAppContainerConfig: resolveSettingsAppContainerConfig } = createDomainConfigResolver({
9351
+ fileArgKey: "settings-file",
9352
+ envVar: () => process.env.SETTINGS_FILE_PATH,
9353
+ appFileField: (a) => a.settingsFile,
9354
+ defaultDir: "settings",
9355
+ defaultFileName: "settings.yaml",
9356
+ buildConfig: (base, filePath) => ({
9357
+ ...base,
9358
+ settingsFilePath: filePath
9359
+ })
9360
+ });
9864
9361
 
9865
9362
  //#endregion
9866
9363
  //#region src/cli/commands/settings/apply.ts
@@ -10043,36 +9540,17 @@ const viewArgs = {
10043
9540
  description: "View file path (default: views.yaml)"
10044
9541
  }
10045
9542
  };
10046
- function resolveViewFilePath(cliValues, app) {
10047
- return resolveFilePath({
10048
- cliValue: cliValues["view-file"],
10049
- envVar: process.env.VIEW_FILE_PATH,
10050
- appFileField: (a) => a.viewFile,
10051
- app,
10052
- defaultDir: "view",
10053
- defaultFileName: "views.yaml"
10054
- });
10055
- }
10056
- function resolveViewContainerConfig(cliValues) {
10057
- const config = resolveConfig(cliValues);
10058
- return {
10059
- baseUrl: config.baseUrl,
10060
- auth: config.auth,
10061
- appId: config.appId,
10062
- guestSpaceId: config.guestSpaceId,
10063
- viewFilePath: resolveViewFilePath(cliValues)
10064
- };
10065
- }
10066
- function resolveViewAppContainerConfig(app, projectConfig, cliValues) {
10067
- const config = resolveAppCliConfig(app, projectConfig, cliValues);
10068
- return {
10069
- baseUrl: config.baseUrl,
10070
- auth: config.auth,
10071
- appId: config.appId,
10072
- guestSpaceId: config.guestSpaceId,
10073
- viewFilePath: resolveViewFilePath(cliValues, app)
10074
- };
10075
- }
9543
+ const { resolveFilePath: resolveViewFilePath, resolveContainerConfig: resolveViewContainerConfig, resolveAppContainerConfig: resolveViewAppContainerConfig } = createDomainConfigResolver({
9544
+ fileArgKey: "view-file",
9545
+ envVar: () => process.env.VIEW_FILE_PATH,
9546
+ appFileField: (a) => a.viewFile,
9547
+ defaultDir: "view",
9548
+ defaultFileName: "views.yaml",
9549
+ buildConfig: (base, filePath) => ({
9550
+ ...base,
9551
+ viewFilePath: filePath
9552
+ })
9553
+ });
10076
9554
 
10077
9555
  //#endregion
10078
9556
  //#region src/cli/commands/view/apply.ts