@uniformdev/cli 20.66.3-alpha.6 → 20.66.5-alpha.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 CHANGED
@@ -5,20 +5,23 @@ import {
5
5
  applyDefaultSyncConfiguration,
6
6
  emitWithFormat,
7
7
  getDirectoryOrFilename,
8
+ getEntityBatchSize,
8
9
  getEntityOption,
10
+ isPaginatedSyncEntity,
9
11
  isPathAPackageFile,
10
12
  nodeFetchProxy,
11
13
  package_default,
12
14
  paginateAsync,
13
15
  readFileToObject,
14
16
  withApiOptions,
17
+ withBatchSizeOptions,
15
18
  withConfiguration,
16
19
  withDebugOptions,
17
20
  withDiffOptions,
18
21
  withFormatOptions,
19
22
  withProjectOptions,
20
23
  withTeamOptions
21
- } from "./chunk-XOZ6UMXP.mjs";
24
+ } from "./chunk-JWPMHLJX.mjs";
22
25
 
23
26
  // src/index.ts
24
27
  import * as dotenv from "dotenv";
@@ -2639,16 +2642,11 @@ var replaceLocalUrlsWithRemoteReferences = async ({
2639
2642
  fileUrlReplacementQueue.add(async () => {
2640
2643
  try {
2641
2644
  const hash = urlToHash(fileUrl);
2642
- fileUrlReplacementQueue.add(async () => {
2643
- try {
2644
- const file = await fileClient.get({ sourceId: hash }).catch(() => null);
2645
- if (!file) {
2646
- return;
2647
- }
2648
- entityAsString = entityAsString.replaceAll(`"${fileUrl}"`, `"${file.url}"`);
2649
- } catch {
2650
- }
2651
- });
2645
+ const file = await fileClient.get({ sourceId: hash }).catch(() => null);
2646
+ if (!file) {
2647
+ return;
2648
+ }
2649
+ entityAsString = entityAsString.replaceAll(`"${fileUrl}"`, `"${file.url}"`);
2652
2650
  } catch {
2653
2651
  }
2654
2652
  });
@@ -2714,20 +2712,16 @@ function convertStateOption(state) {
2714
2712
  // src/commands/canvas/assetEngineDataSource.ts
2715
2713
  function createAssetEngineDataSource({
2716
2714
  client,
2717
- verbose
2715
+ verbose,
2716
+ batchSize
2718
2717
  }) {
2719
2718
  async function* getObjects() {
2720
2719
  const assets = paginateAsync(
2721
- async (offset, limit2) => {
2722
- if (verbose) {
2723
- console.log(`Fetching all assets from offset ${offset} with limit ${limit2}`);
2724
- }
2725
- return (await client.get({
2726
- limit: limit2,
2727
- offset
2728
- })).assets;
2729
- },
2730
- { pageSize: 50 }
2720
+ async (offset, limit2) => (await client.get({
2721
+ limit: limit2,
2722
+ offset
2723
+ })).assets,
2724
+ { pageSize: batchSize ?? 50, verbose, entityName: "assets" }
2731
2725
  );
2732
2726
  for await (const e of assets) {
2733
2727
  const result = {
@@ -2777,22 +2771,25 @@ var AssetPullModule = {
2777
2771
  withDebugOptions(
2778
2772
  withProjectOptions(
2779
2773
  withDiffOptions(
2780
- yargs43.positional("directory", {
2781
- describe: "Directory to save the assets to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2782
- type: "string"
2783
- }).option("format", {
2784
- alias: ["f"],
2785
- describe: "Output format",
2786
- default: "yaml",
2787
- choices: ["yaml", "json"],
2788
- type: "string"
2789
- }).option("mode", {
2790
- alias: ["m"],
2791
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2792
- choices: ["create", "createOrUpdate", "mirror"],
2793
- default: "mirror",
2794
- type: "string"
2795
- })
2774
+ withBatchSizeOptions(
2775
+ yargs43.positional("directory", {
2776
+ describe: "Directory to save the assets to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2777
+ type: "string"
2778
+ }).option("format", {
2779
+ alias: ["f"],
2780
+ describe: "Output format",
2781
+ default: "yaml",
2782
+ choices: ["yaml", "json"],
2783
+ type: "string"
2784
+ }).option("mode", {
2785
+ alias: ["m"],
2786
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2787
+ choices: ["create", "createOrUpdate", "mirror"],
2788
+ default: "mirror",
2789
+ type: "string"
2790
+ }),
2791
+ "asset"
2792
+ )
2796
2793
  )
2797
2794
  )
2798
2795
  )
@@ -2809,7 +2806,8 @@ var AssetPullModule = {
2809
2806
  whatIf,
2810
2807
  project: projectId,
2811
2808
  diff: diffMode,
2812
- allowEmptySource
2809
+ allowEmptySource,
2810
+ resolvedBatchSize
2813
2811
  }) => {
2814
2812
  const fetch2 = nodeFetchProxy(proxy, verbose);
2815
2813
  const client = getAssetClient({
@@ -2819,7 +2817,11 @@ var AssetPullModule = {
2819
2817
  projectId
2820
2818
  });
2821
2819
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
2822
- const source = createAssetEngineDataSource({ client, verbose });
2820
+ const source = createAssetEngineDataSource({
2821
+ client,
2822
+ verbose,
2823
+ batchSize: resolvedBatchSize
2824
+ });
2823
2825
  let target;
2824
2826
  const isPackage = isPathAPackageFile(directory);
2825
2827
  const onBeforeDeleteObject = async (id, object4) => {
@@ -2894,16 +2896,19 @@ var AssetPushModule = {
2894
2896
  withDebugOptions(
2895
2897
  withProjectOptions(
2896
2898
  withDiffOptions(
2897
- yargs43.positional("directory", {
2898
- describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
2899
- type: "string"
2900
- }).option("mode", {
2901
- alias: ["m"],
2902
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2903
- choices: ["create", "createOrUpdate", "mirror"],
2904
- default: "mirror",
2905
- type: "string"
2906
- })
2899
+ withBatchSizeOptions(
2900
+ yargs43.positional("directory", {
2901
+ describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
2902
+ type: "string"
2903
+ }).option("mode", {
2904
+ alias: ["m"],
2905
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2906
+ choices: ["create", "createOrUpdate", "mirror"],
2907
+ default: "mirror",
2908
+ type: "string"
2909
+ }),
2910
+ "asset"
2911
+ )
2907
2912
  )
2908
2913
  )
2909
2914
  )
@@ -2919,7 +2924,8 @@ var AssetPushModule = {
2919
2924
  project: projectId,
2920
2925
  diff: diffMode,
2921
2926
  allowEmptySource,
2922
- verbose
2927
+ verbose,
2928
+ resolvedBatchSize
2923
2929
  }) => {
2924
2930
  const fetch2 = nodeFetchProxy(proxy, verbose);
2925
2931
  const client = getAssetClient({
@@ -2946,7 +2952,11 @@ var AssetPushModule = {
2946
2952
  verbose
2947
2953
  });
2948
2954
  }
2949
- const target = createAssetEngineDataSource({ client, verbose });
2955
+ const target = createAssetEngineDataSource({
2956
+ client,
2957
+ verbose,
2958
+ batchSize: resolvedBatchSize
2959
+ });
2950
2960
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
2951
2961
  await syncEngine({
2952
2962
  source,
@@ -3139,10 +3149,8 @@ function createCategoriesEngineDataSource({
3139
3149
  client
3140
3150
  }) {
3141
3151
  async function* getObjects() {
3142
- const categories = paginateAsync(async () => (await client.getCategories()).categories, {
3143
- pageSize: 100
3144
- });
3145
- for await (const def of categories) {
3152
+ const categories = (await client.getCategories()).categories;
3153
+ for (const def of categories) {
3146
3154
  const result = {
3147
3155
  id: selectIdentifier(def),
3148
3156
  displayName: selectDisplayName(def),
@@ -3463,12 +3471,14 @@ var ComponentListModule = {
3463
3471
 
3464
3472
  // src/commands/canvas/componentDefinitionEngineDataSource.ts
3465
3473
  function createComponentDefinitionEngineDataSource({
3466
- client
3474
+ client,
3475
+ batchSize,
3476
+ verbose
3467
3477
  }) {
3468
3478
  async function* getObjects() {
3469
3479
  const componentDefinitions = paginateAsync(
3470
3480
  async (offset, limit2) => (await client.getComponentDefinitions({ limit: limit2, offset })).componentDefinitions,
3471
- { pageSize: 200 }
3481
+ { pageSize: batchSize ?? 200, verbose, entityName: "components" }
3472
3482
  );
3473
3483
  for await (const def of componentDefinitions) {
3474
3484
  const result = {
@@ -3508,22 +3518,25 @@ var ComponentPullModule = {
3508
3518
  withDebugOptions(
3509
3519
  withProjectOptions(
3510
3520
  withDiffOptions(
3511
- yargs43.positional("directory", {
3512
- describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
3513
- type: "string"
3514
- }).option("format", {
3515
- alias: ["f"],
3516
- describe: "Output format",
3517
- default: "yaml",
3518
- choices: ["yaml", "json"],
3519
- type: "string"
3520
- }).option("mode", {
3521
- alias: ["m"],
3522
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
3523
- choices: ["create", "createOrUpdate", "mirror"],
3524
- default: "mirror",
3525
- type: "string"
3526
- })
3521
+ withBatchSizeOptions(
3522
+ yargs43.positional("directory", {
3523
+ describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
3524
+ type: "string"
3525
+ }).option("format", {
3526
+ alias: ["f"],
3527
+ describe: "Output format",
3528
+ default: "yaml",
3529
+ choices: ["yaml", "json"],
3530
+ type: "string"
3531
+ }).option("mode", {
3532
+ alias: ["m"],
3533
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
3534
+ choices: ["create", "createOrUpdate", "mirror"],
3535
+ default: "mirror",
3536
+ type: "string"
3537
+ }),
3538
+ "component"
3539
+ )
3527
3540
  )
3528
3541
  )
3529
3542
  )
@@ -3540,11 +3553,16 @@ var ComponentPullModule = {
3540
3553
  project: projectId,
3541
3554
  diff: diffMode,
3542
3555
  allowEmptySource,
3543
- verbose
3556
+ verbose,
3557
+ resolvedBatchSize
3544
3558
  }) => {
3545
3559
  const fetch2 = nodeFetchProxy(proxy, verbose);
3546
3560
  const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
3547
- const source = createComponentDefinitionEngineDataSource({ client });
3561
+ const source = createComponentDefinitionEngineDataSource({
3562
+ client,
3563
+ batchSize: resolvedBatchSize,
3564
+ verbose
3565
+ });
3548
3566
  let target;
3549
3567
  const isPackage = isPathAPackageFile(directory);
3550
3568
  if (isPackage) {
@@ -3589,16 +3607,19 @@ var ComponentPushModule = {
3589
3607
  withDebugOptions(
3590
3608
  withProjectOptions(
3591
3609
  withDiffOptions(
3592
- yargs43.positional("directory", {
3593
- describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
3594
- type: "string"
3595
- }).option("mode", {
3596
- alias: ["m"],
3597
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
3598
- choices: ["create", "createOrUpdate", "mirror"],
3599
- default: "mirror",
3600
- type: "string"
3601
- })
3610
+ withBatchSizeOptions(
3611
+ yargs43.positional("directory", {
3612
+ describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
3613
+ type: "string"
3614
+ }).option("mode", {
3615
+ alias: ["m"],
3616
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
3617
+ choices: ["create", "createOrUpdate", "mirror"],
3618
+ default: "mirror",
3619
+ type: "string"
3620
+ }),
3621
+ "component"
3622
+ )
3602
3623
  )
3603
3624
  )
3604
3625
  )
@@ -3614,7 +3635,8 @@ var ComponentPushModule = {
3614
3635
  project: projectId,
3615
3636
  diff: diffMode,
3616
3637
  allowEmptySource,
3617
- verbose
3638
+ verbose,
3639
+ resolvedBatchSize
3618
3640
  }) => {
3619
3641
  const fetch2 = nodeFetchProxy(proxy, verbose);
3620
3642
  const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
@@ -3637,7 +3659,11 @@ var ComponentPushModule = {
3637
3659
  verbose
3638
3660
  });
3639
3661
  }
3640
- const target = createComponentDefinitionEngineDataSource({ client });
3662
+ const target = createComponentDefinitionEngineDataSource({
3663
+ client,
3664
+ batchSize: resolvedBatchSize,
3665
+ verbose
3666
+ });
3641
3667
  await syncEngine({
3642
3668
  source,
3643
3669
  target,
@@ -4091,6 +4117,7 @@ function createComponentInstanceEngineDataSource({
4091
4117
  onlyPatterns,
4092
4118
  patternType,
4093
4119
  verbose,
4120
+ batchSize,
4094
4121
  ...clientOptions
4095
4122
  }) {
4096
4123
  const stateId = convertStateOption(state);
@@ -4114,7 +4141,7 @@ function createComponentInstanceEngineDataSource({
4114
4141
  }
4115
4142
  return (await client.getCompositionList(parameters)).compositions;
4116
4143
  },
4117
- { pageSize: 100 }
4144
+ { pageSize: batchSize ?? 100, verbose, entityName: "compositions" }
4118
4145
  );
4119
4146
  for await (const compositionListItem of componentInstances) {
4120
4147
  const result = {
@@ -4153,24 +4180,27 @@ var CompositionPublishModule = {
4153
4180
  withProjectOptions(
4154
4181
  withDebugOptions(
4155
4182
  withDiffOptions(
4156
- yargs43.positional("ids", {
4157
- describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
4158
- type: "string"
4159
- }).option("all", {
4160
- alias: ["a"],
4161
- describe: "Publishes all compositions. Use compositionId to publish one instead.",
4162
- default: false,
4163
- type: "boolean"
4164
- }).option("onlyCompositions", {
4165
- describe: "Only publishing compositions and not patterns",
4166
- default: false,
4167
- type: "boolean"
4168
- }).option("onlyPatterns", {
4169
- describe: "Only pulling patterns and not compositions",
4170
- default: false,
4171
- type: "boolean",
4172
- hidden: true
4173
- })
4183
+ withBatchSizeOptions(
4184
+ yargs43.positional("ids", {
4185
+ describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
4186
+ type: "string"
4187
+ }).option("all", {
4188
+ alias: ["a"],
4189
+ describe: "Publishes all compositions. Use compositionId to publish one instead.",
4190
+ default: false,
4191
+ type: "boolean"
4192
+ }).option("onlyCompositions", {
4193
+ describe: "Only publishing compositions and not patterns",
4194
+ default: false,
4195
+ type: "boolean"
4196
+ }).option("onlyPatterns", {
4197
+ describe: "Only pulling patterns and not compositions",
4198
+ default: false,
4199
+ type: "boolean",
4200
+ hidden: true
4201
+ }),
4202
+ "composition"
4203
+ )
4174
4204
  )
4175
4205
  )
4176
4206
  )
@@ -4188,7 +4218,8 @@ var CompositionPublishModule = {
4188
4218
  onlyPatterns,
4189
4219
  patternType,
4190
4220
  verbose,
4191
- directory
4221
+ directory,
4222
+ resolvedBatchSize
4192
4223
  }) => {
4193
4224
  if (!all && !ids || all && ids) {
4194
4225
  console.error(`Specify --all or composition ID(s) to publish.`);
@@ -4204,7 +4235,8 @@ var CompositionPublishModule = {
4204
4235
  onlyCompositions,
4205
4236
  onlyPatterns,
4206
4237
  patternType,
4207
- verbose
4238
+ verbose,
4239
+ batchSize: resolvedBatchSize
4208
4240
  });
4209
4241
  const target = createComponentInstanceEngineDataSource({
4210
4242
  client,
@@ -4213,7 +4245,8 @@ var CompositionPublishModule = {
4213
4245
  onlyCompositions,
4214
4246
  onlyPatterns,
4215
4247
  patternType,
4216
- verbose
4248
+ verbose,
4249
+ batchSize: resolvedBatchSize
4217
4250
  });
4218
4251
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
4219
4252
  await syncEngine({
@@ -4251,33 +4284,36 @@ var ComponentPatternPublishModule = {
4251
4284
  withDebugOptions(
4252
4285
  withProjectOptions(
4253
4286
  withDiffOptions(
4254
- yargs43.positional("ids", {
4255
- describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
4256
- type: "string"
4257
- }).option("all", {
4258
- alias: ["a"],
4259
- describe: "Publishes all component patterns. Use compositionId to publish one instead.",
4260
- default: false,
4261
- type: "boolean"
4262
- }).option("publishingState", {
4263
- describe: 'Publishing state to update to. Can be "published" or "preview".',
4264
- default: "published",
4265
- type: "string",
4266
- hidden: true
4267
- }).option("onlyCompositions", {
4268
- describe: "Only publishing compositions and not component patterns",
4269
- default: false,
4270
- type: "boolean"
4271
- }).option("onlyPatterns", {
4272
- describe: "Only pulling component patterns and not compositions",
4273
- default: true,
4274
- type: "boolean",
4275
- hidden: true
4276
- }).option("patternType", {
4277
- default: "component",
4278
- choices: ["all", "component", "composition"],
4279
- hidden: true
4280
- })
4287
+ withBatchSizeOptions(
4288
+ yargs43.positional("ids", {
4289
+ describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
4290
+ type: "string"
4291
+ }).option("all", {
4292
+ alias: ["a"],
4293
+ describe: "Publishes all component patterns. Use compositionId to publish one instead.",
4294
+ default: false,
4295
+ type: "boolean"
4296
+ }).option("publishingState", {
4297
+ describe: 'Publishing state to update to. Can be "published" or "preview".',
4298
+ default: "published",
4299
+ type: "string",
4300
+ hidden: true
4301
+ }).option("onlyCompositions", {
4302
+ describe: "Only publishing compositions and not component patterns",
4303
+ default: false,
4304
+ type: "boolean"
4305
+ }).option("onlyPatterns", {
4306
+ describe: "Only pulling component patterns and not compositions",
4307
+ default: true,
4308
+ type: "boolean",
4309
+ hidden: true
4310
+ }).option("patternType", {
4311
+ default: "component",
4312
+ choices: ["all", "component", "composition"],
4313
+ hidden: true
4314
+ }),
4315
+ "componentPattern"
4316
+ )
4281
4317
  )
4282
4318
  )
4283
4319
  )
@@ -4286,8 +4322,8 @@ var ComponentPatternPublishModule = {
4286
4322
  };
4287
4323
 
4288
4324
  // src/commands/canvas/commands/composition/pull.ts
4289
- var CompositionPullModule = componentInstancePullModuleFactory("compositions");
4290
- function componentInstancePullModuleFactory(type) {
4325
+ var CompositionPullModule = componentInstancePullModuleFactory("compositions", "composition");
4326
+ function componentInstancePullModuleFactory(type, entityType) {
4291
4327
  return {
4292
4328
  command: "pull <directory>",
4293
4329
  describe: "Pulls all compositions to local files in a directory",
@@ -4297,31 +4333,34 @@ function componentInstancePullModuleFactory(type) {
4297
4333
  withStateOptions(
4298
4334
  withDebugOptions(
4299
4335
  withDiffOptions(
4300
- yargs43.positional("directory", {
4301
- describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
4302
- type: "string"
4303
- }).option("format", {
4304
- alias: ["f"],
4305
- describe: "Output format",
4306
- default: "yaml",
4307
- choices: ["yaml", "json"],
4308
- type: "string"
4309
- }).option("onlyCompositions", {
4310
- describe: "Only pulling compositions and not patterns",
4311
- default: false,
4312
- type: "boolean"
4313
- }).option("onlyPatterns", {
4314
- describe: "Only pulling patterns and not compositions",
4315
- default: false,
4316
- type: "boolean",
4317
- hidden: true
4318
- }).option("mode", {
4319
- alias: ["m"],
4320
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
4321
- choices: ["create", "createOrUpdate", "mirror"],
4322
- default: "mirror",
4323
- type: "string"
4324
- })
4336
+ withBatchSizeOptions(
4337
+ yargs43.positional("directory", {
4338
+ describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
4339
+ type: "string"
4340
+ }).option("format", {
4341
+ alias: ["f"],
4342
+ describe: "Output format",
4343
+ default: "yaml",
4344
+ choices: ["yaml", "json"],
4345
+ type: "string"
4346
+ }).option("onlyCompositions", {
4347
+ describe: "Only pulling compositions and not patterns",
4348
+ default: false,
4349
+ type: "boolean"
4350
+ }).option("onlyPatterns", {
4351
+ describe: "Only pulling patterns and not compositions",
4352
+ default: false,
4353
+ type: "boolean",
4354
+ hidden: true
4355
+ }).option("mode", {
4356
+ alias: ["m"],
4357
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
4358
+ choices: ["create", "createOrUpdate", "mirror"],
4359
+ default: "mirror",
4360
+ type: "string"
4361
+ }),
4362
+ entityType
4363
+ )
4325
4364
  )
4326
4365
  )
4327
4366
  )
@@ -4343,7 +4382,8 @@ function componentInstancePullModuleFactory(type) {
4343
4382
  project: projectId,
4344
4383
  diff: diffMode,
4345
4384
  allowEmptySource,
4346
- verbose
4385
+ verbose,
4386
+ resolvedBatchSize
4347
4387
  }) => {
4348
4388
  const fetch2 = nodeFetchProxy(proxy, verbose);
4349
4389
  const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
@@ -4354,7 +4394,8 @@ function componentInstancePullModuleFactory(type) {
4354
4394
  onlyCompositions,
4355
4395
  onlyPatterns,
4356
4396
  patternType,
4357
- verbose
4397
+ verbose,
4398
+ batchSize: resolvedBatchSize
4358
4399
  });
4359
4400
  const isPackage = isPathAPackageFile(directory);
4360
4401
  let target;
@@ -4410,7 +4451,7 @@ function componentInstancePullModuleFactory(type) {
4410
4451
 
4411
4452
  // src/commands/canvas/commands/componentPattern/pull.ts
4412
4453
  var ComponentPatternPullModule = {
4413
- ...componentInstancePullModuleFactory("componentPatterns"),
4454
+ ...componentInstancePullModuleFactory("componentPatterns", "componentPattern"),
4414
4455
  describe: "Pulls all component patterns to local files in a directory",
4415
4456
  builder: (yargs43) => withConfiguration(
4416
4457
  withApiOptions(
@@ -4487,8 +4528,8 @@ function createLocaleValidationHook(uniformLocales) {
4487
4528
  }
4488
4529
 
4489
4530
  // src/commands/canvas/commands/composition/push.ts
4490
- var CompositionPushModule = componentInstancePushModuleFactory("compositions");
4491
- function componentInstancePushModuleFactory(type) {
4531
+ var CompositionPushModule = componentInstancePushModuleFactory("compositions", "composition");
4532
+ function componentInstancePushModuleFactory(type, entityType) {
4492
4533
  return {
4493
4534
  command: "push <directory>",
4494
4535
  describe: "Pushes all compositions from files in a directory to Uniform Canvas",
@@ -4498,25 +4539,28 @@ function componentInstancePushModuleFactory(type) {
4498
4539
  withStateOptions(
4499
4540
  withDebugOptions(
4500
4541
  withDiffOptions(
4501
- yargs43.positional("directory", {
4502
- describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
4503
- type: "string"
4504
- }).option("mode", {
4505
- alias: ["m"],
4506
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
4507
- choices: ["create", "createOrUpdate", "mirror"],
4508
- default: "mirror",
4509
- type: "string"
4510
- }).option("onlyCompositions", {
4511
- describe: "Only pulling compositions and not patterns",
4512
- default: false,
4513
- type: "boolean"
4514
- }).option("onlyPatterns", {
4515
- // backwards compatibility
4516
- default: false,
4517
- type: "boolean",
4518
- hidden: true
4519
- })
4542
+ withBatchSizeOptions(
4543
+ yargs43.positional("directory", {
4544
+ describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
4545
+ type: "string"
4546
+ }).option("mode", {
4547
+ alias: ["m"],
4548
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
4549
+ choices: ["create", "createOrUpdate", "mirror"],
4550
+ default: "mirror",
4551
+ type: "string"
4552
+ }).option("onlyCompositions", {
4553
+ describe: "Only pulling compositions and not patterns",
4554
+ default: false,
4555
+ type: "boolean"
4556
+ }).option("onlyPatterns", {
4557
+ // backwards compatibility
4558
+ default: false,
4559
+ type: "boolean",
4560
+ hidden: true
4561
+ }),
4562
+ entityType
4563
+ )
4520
4564
  )
4521
4565
  )
4522
4566
  )
@@ -4537,7 +4581,8 @@ function componentInstancePushModuleFactory(type) {
4537
4581
  patternType,
4538
4582
  diff: diffMode,
4539
4583
  allowEmptySource,
4540
- verbose
4584
+ verbose,
4585
+ resolvedBatchSize
4541
4586
  }) => {
4542
4587
  const fetch2 = nodeFetchProxy(proxy, verbose);
4543
4588
  const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
@@ -4565,7 +4610,8 @@ function componentInstancePushModuleFactory(type) {
4565
4610
  onlyCompositions,
4566
4611
  onlyPatterns,
4567
4612
  patternType,
4568
- verbose
4613
+ verbose,
4614
+ batchSize: resolvedBatchSize
4569
4615
  });
4570
4616
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
4571
4617
  const uniformLocales = await fetchUniformLocales({
@@ -4610,7 +4656,7 @@ function componentInstancePushModuleFactory(type) {
4610
4656
 
4611
4657
  // src/commands/canvas/commands/componentPattern/push.ts
4612
4658
  var ComponentPatternPushModule = {
4613
- ...componentInstancePushModuleFactory("componentPatterns"),
4659
+ ...componentInstancePushModuleFactory("componentPatterns", "componentPattern"),
4614
4660
  describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
4615
4661
  builder: (yargs43) => withConfiguration(
4616
4662
  withApiOptions(
@@ -4718,24 +4764,27 @@ var CompositionUnpublishModule = {
4718
4764
  withApiOptions(
4719
4765
  withDebugOptions(
4720
4766
  withProjectOptions(
4721
- yargs43.positional("ids", {
4722
- describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
4723
- type: "string"
4724
- }).option("all", {
4725
- alias: ["a"],
4726
- describe: "Un-publishes all compositions. Use composition ID(s) to unpublish specific one(s) instead.",
4727
- default: false,
4728
- type: "boolean"
4729
- }).option("onlyCompositions", {
4730
- describe: "Only un-publishing compositions and not patterns",
4731
- default: false,
4732
- type: "boolean"
4733
- }).option("onlyPatterns", {
4734
- describe: "Only un-publishing patterns and not compositions",
4735
- default: false,
4736
- type: "boolean",
4737
- hidden: true
4738
- })
4767
+ withBatchSizeOptions(
4768
+ yargs43.positional("ids", {
4769
+ describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
4770
+ type: "string"
4771
+ }).option("all", {
4772
+ alias: ["a"],
4773
+ describe: "Un-publishes all compositions. Use composition ID(s) to unpublish specific one(s) instead.",
4774
+ default: false,
4775
+ type: "boolean"
4776
+ }).option("onlyCompositions", {
4777
+ describe: "Only un-publishing compositions and not patterns",
4778
+ default: false,
4779
+ type: "boolean"
4780
+ }).option("onlyPatterns", {
4781
+ describe: "Only un-publishing patterns and not compositions",
4782
+ default: false,
4783
+ type: "boolean",
4784
+ hidden: true
4785
+ }),
4786
+ "composition"
4787
+ )
4739
4788
  )
4740
4789
  )
4741
4790
  )
@@ -4751,7 +4800,8 @@ var CompositionUnpublishModule = {
4751
4800
  patternType,
4752
4801
  project: projectId,
4753
4802
  whatIf,
4754
- verbose
4803
+ verbose,
4804
+ resolvedBatchSize
4755
4805
  }) => {
4756
4806
  if (!all && !ids || all && ids) {
4757
4807
  console.error(`Specify --all or composition ID(s) to unpublish.`);
@@ -4768,7 +4818,8 @@ var CompositionUnpublishModule = {
4768
4818
  onlyCompositions,
4769
4819
  onlyPatterns,
4770
4820
  patternType,
4771
- verbose
4821
+ verbose,
4822
+ batchSize: resolvedBatchSize
4772
4823
  });
4773
4824
  const target = createComponentInstanceEngineDataSource({
4774
4825
  client,
@@ -4777,7 +4828,8 @@ var CompositionUnpublishModule = {
4777
4828
  onlyCompositions,
4778
4829
  onlyPatterns,
4779
4830
  patternType,
4780
- verbose
4831
+ verbose,
4832
+ batchSize: resolvedBatchSize
4781
4833
  });
4782
4834
  const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
4783
4835
  for await (const obj of target.objects) {
@@ -5016,34 +5068,37 @@ var CompositionPatternPublishModule = {
5016
5068
  withDebugOptions(
5017
5069
  withProjectOptions(
5018
5070
  withDiffOptions(
5019
- yargs43.positional("ids", {
5020
- describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
5021
- type: "string"
5022
- }).option("all", {
5023
- alias: ["a"],
5024
- describe: "Publishes all composition patterns. Use compositionId to publish one instead.",
5025
- default: false,
5026
- type: "boolean"
5027
- }).option("publishingState", {
5028
- describe: 'Publishing state to update to. Can be "published" or "preview".',
5029
- default: "published",
5030
- type: "string",
5031
- hidden: true
5032
- }).option("onlyCompositions", {
5033
- describe: "Only publishing compositions and not composition patterns",
5034
- default: false,
5035
- type: "boolean",
5036
- hidden: true
5037
- }).option("patternType", {
5038
- default: "composition",
5039
- choices: ["all", "component", "composition"],
5040
- hidden: true
5041
- }).option("onlyPatterns", {
5042
- describe: "Only pulling composition patterns and not compositions",
5043
- default: true,
5044
- type: "boolean",
5045
- hidden: true
5046
- })
5071
+ withBatchSizeOptions(
5072
+ yargs43.positional("ids", {
5073
+ describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
5074
+ type: "string"
5075
+ }).option("all", {
5076
+ alias: ["a"],
5077
+ describe: "Publishes all composition patterns. Use compositionId to publish one instead.",
5078
+ default: false,
5079
+ type: "boolean"
5080
+ }).option("publishingState", {
5081
+ describe: 'Publishing state to update to. Can be "published" or "preview".',
5082
+ default: "published",
5083
+ type: "string",
5084
+ hidden: true
5085
+ }).option("onlyCompositions", {
5086
+ describe: "Only publishing compositions and not composition patterns",
5087
+ default: false,
5088
+ type: "boolean",
5089
+ hidden: true
5090
+ }).option("patternType", {
5091
+ default: "composition",
5092
+ choices: ["all", "component", "composition"],
5093
+ hidden: true
5094
+ }).option("onlyPatterns", {
5095
+ describe: "Only pulling composition patterns and not compositions",
5096
+ default: true,
5097
+ type: "boolean",
5098
+ hidden: true
5099
+ }),
5100
+ "compositionPattern"
5101
+ )
5047
5102
  )
5048
5103
  )
5049
5104
  )
@@ -5053,7 +5108,7 @@ var CompositionPatternPublishModule = {
5053
5108
 
5054
5109
  // src/commands/canvas/commands/compositionPattern/pull.ts
5055
5110
  var CompositionPatternPullModule = {
5056
- ...componentInstancePullModuleFactory("compositionPatterns"),
5111
+ ...componentInstancePullModuleFactory("compositionPatterns", "compositionPattern"),
5057
5112
  describe: "Pulls all composition patterns to local files in a directory",
5058
5113
  builder: (yargs43) => withConfiguration(
5059
5114
  withApiOptions(
@@ -5097,7 +5152,7 @@ var CompositionPatternPullModule = {
5097
5152
 
5098
5153
  // src/commands/canvas/commands/compositionPattern/push.ts
5099
5154
  var CompositionPatternPushModule = {
5100
- ...componentInstancePushModuleFactory("compositionPatterns"),
5155
+ ...componentInstancePushModuleFactory("compositionPatterns", "compositionPattern"),
5101
5156
  describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
5102
5157
  builder: (yargs43) => withConfiguration(
5103
5158
  withApiOptions(
@@ -5248,10 +5303,15 @@ var ContentTypeListModule = {
5248
5303
 
5249
5304
  // src/commands/canvas/contentTypeEngineDataSource.ts
5250
5305
  function createContentTypeEngineDataSource({
5251
- client
5306
+ client,
5307
+ batchSize,
5308
+ verbose
5252
5309
  }) {
5253
5310
  async function* getObjects() {
5254
- const { contentTypes } = await client.getContentTypes({ offset: 0, limit: 1e3 });
5311
+ const contentTypes = paginateAsync(
5312
+ async (offset, limit2) => (await client.getContentTypes({ offset, limit: limit2 })).contentTypes,
5313
+ { pageSize: batchSize ?? 100, verbose, entityName: "content types" }
5314
+ );
5255
5315
  for await (const ct of contentTypes) {
5256
5316
  const result = {
5257
5317
  id: selectContentTypeIdentifier(ct),
@@ -5283,22 +5343,25 @@ var ContentTypePullModule = {
5283
5343
  withDebugOptions(
5284
5344
  withProjectOptions(
5285
5345
  withDiffOptions(
5286
- yargs43.positional("directory", {
5287
- describe: "Directory to save the content types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
5288
- type: "string"
5289
- }).option("format", {
5290
- alias: ["f"],
5291
- describe: "Output format",
5292
- default: "yaml",
5293
- choices: ["yaml", "json"],
5294
- type: "string"
5295
- }).option("mode", {
5296
- alias: ["m"],
5297
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
5298
- choices: ["create", "createOrUpdate", "mirror"],
5299
- default: "mirror",
5300
- type: "string"
5301
- })
5346
+ withBatchSizeOptions(
5347
+ yargs43.positional("directory", {
5348
+ describe: "Directory to save the content types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
5349
+ type: "string"
5350
+ }).option("format", {
5351
+ alias: ["f"],
5352
+ describe: "Output format",
5353
+ default: "yaml",
5354
+ choices: ["yaml", "json"],
5355
+ type: "string"
5356
+ }).option("mode", {
5357
+ alias: ["m"],
5358
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
5359
+ choices: ["create", "createOrUpdate", "mirror"],
5360
+ default: "mirror",
5361
+ type: "string"
5362
+ }),
5363
+ "contentType"
5364
+ )
5302
5365
  )
5303
5366
  )
5304
5367
  )
@@ -5315,7 +5378,8 @@ var ContentTypePullModule = {
5315
5378
  project: projectId,
5316
5379
  diff: diffMode,
5317
5380
  allowEmptySource,
5318
- verbose
5381
+ verbose,
5382
+ resolvedBatchSize
5319
5383
  }) => {
5320
5384
  const fetch2 = nodeFetchProxy(proxy, verbose);
5321
5385
  const client = getContentClient({
@@ -5324,7 +5388,11 @@ var ContentTypePullModule = {
5324
5388
  fetch: fetch2,
5325
5389
  projectId
5326
5390
  });
5327
- const source = createContentTypeEngineDataSource({ client });
5391
+ const source = createContentTypeEngineDataSource({
5392
+ client,
5393
+ verbose,
5394
+ batchSize: resolvedBatchSize
5395
+ });
5328
5396
  let target;
5329
5397
  const isPackage = isPathAPackageFile(directory);
5330
5398
  if (isPackage) {
@@ -5368,21 +5436,24 @@ var ContentTypePushModule = {
5368
5436
  withDebugOptions(
5369
5437
  withProjectOptions(
5370
5438
  withDiffOptions(
5371
- yargs43.positional("directory", {
5372
- describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
5373
- type: "string"
5374
- }).option("what-if", {
5375
- alias: ["w"],
5376
- describe: "What-if mode reports what would be done but changes nothing",
5377
- default: false,
5378
- type: "boolean"
5379
- }).option("mode", {
5380
- alias: ["m"],
5381
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
5382
- choices: ["create", "createOrUpdate", "mirror"],
5383
- default: "mirror",
5384
- type: "string"
5385
- })
5439
+ withBatchSizeOptions(
5440
+ yargs43.positional("directory", {
5441
+ describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
5442
+ type: "string"
5443
+ }).option("what-if", {
5444
+ alias: ["w"],
5445
+ describe: "What-if mode reports what would be done but changes nothing",
5446
+ default: false,
5447
+ type: "boolean"
5448
+ }).option("mode", {
5449
+ alias: ["m"],
5450
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
5451
+ choices: ["create", "createOrUpdate", "mirror"],
5452
+ default: "mirror",
5453
+ type: "string"
5454
+ }),
5455
+ "contentType"
5456
+ )
5386
5457
  )
5387
5458
  )
5388
5459
  )
@@ -5398,7 +5469,8 @@ var ContentTypePushModule = {
5398
5469
  project: projectId,
5399
5470
  diff: diffMode,
5400
5471
  allowEmptySource,
5401
- verbose
5472
+ verbose,
5473
+ resolvedBatchSize
5402
5474
  }) => {
5403
5475
  const fetch2 = nodeFetchProxy(proxy, verbose);
5404
5476
  const client = getContentClient({
@@ -5425,7 +5497,11 @@ var ContentTypePushModule = {
5425
5497
  verbose
5426
5498
  });
5427
5499
  }
5428
- const target = createContentTypeEngineDataSource({ client });
5500
+ const target = createContentTypeEngineDataSource({
5501
+ client,
5502
+ verbose,
5503
+ batchSize: resolvedBatchSize
5504
+ });
5429
5505
  await syncEngine({
5430
5506
  source,
5431
5507
  target,
@@ -6093,7 +6169,9 @@ function createEntryEngineDataSource({
6093
6169
  state,
6094
6170
  onlyEntries,
6095
6171
  onlyPatterns,
6096
- entryIDs
6172
+ entryIDs,
6173
+ batchSize,
6174
+ verbose
6097
6175
  }) {
6098
6176
  const stateId = convertStateOption(state);
6099
6177
  async function* getObjects() {
@@ -6119,7 +6197,7 @@ function createEntryEngineDataSource({
6119
6197
  throw error;
6120
6198
  }
6121
6199
  },
6122
- { pageSize: 100 }
6200
+ { pageSize: batchSize ?? 100, verbose, entityName: "entries" }
6123
6201
  );
6124
6202
  for await (const e of entries) {
6125
6203
  const result = {
@@ -6152,15 +6230,18 @@ var EntryPublishModule = {
6152
6230
  withDiffOptions(
6153
6231
  withApiOptions(
6154
6232
  withProjectOptions(
6155
- yargs43.positional("ids", {
6156
- describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
6157
- type: "string"
6158
- }).option("all", {
6159
- alias: ["a"],
6160
- describe: "Publishes all entries. Use --ids to publish selected entries instead.",
6161
- default: false,
6162
- type: "boolean"
6163
- })
6233
+ withBatchSizeOptions(
6234
+ yargs43.positional("ids", {
6235
+ describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
6236
+ type: "string"
6237
+ }).option("all", {
6238
+ alias: ["a"],
6239
+ describe: "Publishes all entries. Use --ids to publish selected entries instead.",
6240
+ default: false,
6241
+ type: "boolean"
6242
+ }),
6243
+ "entry"
6244
+ )
6164
6245
  )
6165
6246
  )
6166
6247
  )
@@ -6176,7 +6257,8 @@ var EntryPublishModule = {
6176
6257
  project: projectId,
6177
6258
  whatIf,
6178
6259
  verbose,
6179
- directory
6260
+ directory,
6261
+ resolvedBatchSize
6180
6262
  }) => {
6181
6263
  if (!all && !ids || all && ids) {
6182
6264
  console.error(`Specify --all or entry ID(s) to publish.`);
@@ -6189,13 +6271,15 @@ var EntryPublishModule = {
6189
6271
  client,
6190
6272
  state: "preview",
6191
6273
  entryIDs: entryIDsArray,
6192
- onlyEntries: true
6274
+ onlyEntries: true,
6275
+ batchSize: resolvedBatchSize
6193
6276
  });
6194
6277
  const target = createEntryEngineDataSource({
6195
6278
  client,
6196
6279
  state: "published",
6197
6280
  entryIDs: entryIDsArray,
6198
- onlyEntries: true
6281
+ onlyEntries: true,
6282
+ batchSize: resolvedBatchSize
6199
6283
  });
6200
6284
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
6201
6285
  await syncEngine({
@@ -6233,22 +6317,25 @@ var EntryPullModule = {
6233
6317
  withProjectOptions(
6234
6318
  withStateOptions(
6235
6319
  withDiffOptions(
6236
- yargs43.positional("directory", {
6237
- describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
6238
- type: "string"
6239
- }).option("format", {
6240
- alias: ["f"],
6241
- describe: "Output format",
6242
- default: "yaml",
6243
- choices: ["yaml", "json"],
6244
- type: "string"
6245
- }).option("mode", {
6246
- alias: ["m"],
6247
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
6248
- choices: ["create", "createOrUpdate", "mirror"],
6249
- default: "mirror",
6250
- type: "string"
6251
- })
6320
+ withBatchSizeOptions(
6321
+ yargs43.positional("directory", {
6322
+ describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
6323
+ type: "string"
6324
+ }).option("format", {
6325
+ alias: ["f"],
6326
+ describe: "Output format",
6327
+ default: "yaml",
6328
+ choices: ["yaml", "json"],
6329
+ type: "string"
6330
+ }).option("mode", {
6331
+ alias: ["m"],
6332
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
6333
+ choices: ["create", "createOrUpdate", "mirror"],
6334
+ default: "mirror",
6335
+ type: "string"
6336
+ }),
6337
+ "entry"
6338
+ )
6252
6339
  )
6253
6340
  )
6254
6341
  )
@@ -6267,7 +6354,8 @@ var EntryPullModule = {
6267
6354
  project: projectId,
6268
6355
  diff: diffMode,
6269
6356
  allowEmptySource,
6270
- verbose
6357
+ verbose,
6358
+ resolvedBatchSize
6271
6359
  }) => {
6272
6360
  const fetch2 = nodeFetchProxy(proxy, verbose);
6273
6361
  const client = getContentClient({
@@ -6277,7 +6365,13 @@ var EntryPullModule = {
6277
6365
  projectId
6278
6366
  });
6279
6367
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
6280
- const source = createEntryEngineDataSource({ client, state, onlyEntries: true });
6368
+ const source = createEntryEngineDataSource({
6369
+ client,
6370
+ state,
6371
+ onlyEntries: true,
6372
+ verbose,
6373
+ batchSize: resolvedBatchSize
6374
+ });
6281
6375
  let target;
6282
6376
  const isPackage = isPathAPackageFile(directory);
6283
6377
  if (isPackage) {
@@ -6339,16 +6433,19 @@ var EntryPushModule = {
6339
6433
  withProjectOptions(
6340
6434
  withStateOptions(
6341
6435
  withDiffOptions(
6342
- yargs43.positional("directory", {
6343
- describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
6344
- type: "string"
6345
- }).option("mode", {
6346
- alias: ["m"],
6347
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
6348
- choices: ["create", "createOrUpdate", "mirror"],
6349
- default: "mirror",
6350
- type: "string"
6351
- })
6436
+ withBatchSizeOptions(
6437
+ yargs43.positional("directory", {
6438
+ describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
6439
+ type: "string"
6440
+ }).option("mode", {
6441
+ alias: ["m"],
6442
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
6443
+ choices: ["create", "createOrUpdate", "mirror"],
6444
+ default: "mirror",
6445
+ type: "string"
6446
+ }),
6447
+ "entry"
6448
+ )
6352
6449
  )
6353
6450
  )
6354
6451
  )
@@ -6366,7 +6463,8 @@ var EntryPushModule = {
6366
6463
  project: projectId,
6367
6464
  diff: diffMode,
6368
6465
  allowEmptySource,
6369
- verbose
6466
+ verbose,
6467
+ resolvedBatchSize
6370
6468
  }) => {
6371
6469
  const fetch2 = nodeFetchProxy(proxy, verbose);
6372
6470
  const client = getContentClient({
@@ -6393,7 +6491,13 @@ var EntryPushModule = {
6393
6491
  verbose
6394
6492
  });
6395
6493
  }
6396
- const target = createEntryEngineDataSource({ client, state, onlyEntries: true });
6494
+ const target = createEntryEngineDataSource({
6495
+ client,
6496
+ state,
6497
+ onlyEntries: true,
6498
+ verbose,
6499
+ batchSize: resolvedBatchSize
6500
+ });
6397
6501
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
6398
6502
  const uniformLocales = await fetchUniformLocales({
6399
6503
  apiKey,
@@ -6487,24 +6591,37 @@ import { diffJson as diffJson3 } from "diff";
6487
6591
  var EntryUnpublishModule = {
6488
6592
  command: "unpublish [ids]",
6489
6593
  describe: "Unpublish an entry(ies)",
6490
- builder: (yargs43) => withConfiguration(
6491
- withDebugOptions(
6492
- withApiOptions(
6493
- withProjectOptions(
6494
- yargs43.positional("ids", {
6495
- describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
6496
- type: "string"
6497
- }).option("all", {
6498
- alias: ["a"],
6499
- describe: "Un-publishes all entries. Use --all to un-publish selected entries instead.",
6500
- default: false,
6501
- type: "boolean"
6502
- })
6594
+ builder: (yargs43) => withConfiguration(
6595
+ withDebugOptions(
6596
+ withApiOptions(
6597
+ withProjectOptions(
6598
+ withBatchSizeOptions(
6599
+ yargs43.positional("ids", {
6600
+ describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
6601
+ type: "string"
6602
+ }).option("all", {
6603
+ alias: ["a"],
6604
+ describe: "Un-publishes all entries. Use --all to un-publish selected entries instead.",
6605
+ default: false,
6606
+ type: "boolean"
6607
+ }),
6608
+ "entry"
6609
+ )
6503
6610
  )
6504
6611
  )
6505
6612
  )
6506
6613
  ),
6507
- handler: async ({ apiHost, apiKey, proxy, ids, all, project: projectId, whatIf, verbose }) => {
6614
+ handler: async ({
6615
+ apiHost,
6616
+ apiKey,
6617
+ proxy,
6618
+ ids,
6619
+ all,
6620
+ project: projectId,
6621
+ whatIf,
6622
+ verbose,
6623
+ resolvedBatchSize
6624
+ }) => {
6508
6625
  if (!all && !ids || all && ids) {
6509
6626
  console.error(`Specify --all or entry ID(s) to unpublish.`);
6510
6627
  process.exit(1);
@@ -6517,13 +6634,15 @@ var EntryUnpublishModule = {
6517
6634
  client,
6518
6635
  state: "published",
6519
6636
  entryIDs: entryIDsArray,
6520
- onlyEntries: true
6637
+ onlyEntries: true,
6638
+ batchSize: resolvedBatchSize
6521
6639
  });
6522
6640
  const target = createEntryEngineDataSource({
6523
6641
  client,
6524
6642
  state: "preview",
6525
6643
  entryIDs: entryIDsArray,
6526
- onlyEntries: true
6644
+ onlyEntries: true,
6645
+ batchSize: resolvedBatchSize
6527
6646
  });
6528
6647
  const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
6529
6648
  for await (const obj of target.objects) {
@@ -6741,15 +6860,18 @@ var EntryPatternPublishModule = {
6741
6860
  withApiOptions(
6742
6861
  withProjectOptions(
6743
6862
  withDiffOptions(
6744
- yargs43.positional("ids", {
6745
- describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
6746
- type: "string"
6747
- }).option("all", {
6748
- alias: ["a"],
6749
- describe: "Publishes all entry patterns. Use --ids to publish selected entry patterns instead.",
6750
- default: false,
6751
- type: "boolean"
6752
- })
6863
+ withBatchSizeOptions(
6864
+ yargs43.positional("ids", {
6865
+ describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
6866
+ type: "string"
6867
+ }).option("all", {
6868
+ alias: ["a"],
6869
+ describe: "Publishes all entry patterns. Use --ids to publish selected entry patterns instead.",
6870
+ default: false,
6871
+ type: "boolean"
6872
+ }),
6873
+ "entryPattern"
6874
+ )
6753
6875
  )
6754
6876
  )
6755
6877
  )
@@ -6765,7 +6887,8 @@ var EntryPatternPublishModule = {
6765
6887
  whatIf,
6766
6888
  project: projectId,
6767
6889
  verbose,
6768
- directory
6890
+ directory,
6891
+ resolvedBatchSize
6769
6892
  }) => {
6770
6893
  if (!all && !ids || all && ids) {
6771
6894
  console.error(`Specify --all or entry pattern ID(s) to publish.`);
@@ -6778,13 +6901,15 @@ var EntryPatternPublishModule = {
6778
6901
  client,
6779
6902
  state: "preview",
6780
6903
  entryIDs: entryIDsArray,
6781
- onlyPatterns: true
6904
+ onlyPatterns: true,
6905
+ batchSize: resolvedBatchSize
6782
6906
  });
6783
6907
  const target = createEntryEngineDataSource({
6784
6908
  client,
6785
6909
  state: "published",
6786
6910
  entryIDs: entryIDsArray,
6787
- onlyPatterns: true
6911
+ onlyPatterns: true,
6912
+ batchSize: resolvedBatchSize
6788
6913
  });
6789
6914
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
6790
6915
  await syncEngine({
@@ -6822,22 +6947,25 @@ var EntryPatternPullModule = {
6822
6947
  withProjectOptions(
6823
6948
  withStateOptions(
6824
6949
  withDiffOptions(
6825
- yargs43.positional("directory", {
6826
- describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
6827
- type: "string"
6828
- }).option("format", {
6829
- alias: ["f"],
6830
- describe: "Output format",
6831
- default: "yaml",
6832
- choices: ["yaml", "json"],
6833
- type: "string"
6834
- }).option("mode", {
6835
- alias: ["m"],
6836
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
6837
- choices: ["create", "createOrUpdate", "mirror"],
6838
- default: "mirror",
6839
- type: "string"
6840
- })
6950
+ withBatchSizeOptions(
6951
+ yargs43.positional("directory", {
6952
+ describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
6953
+ type: "string"
6954
+ }).option("format", {
6955
+ alias: ["f"],
6956
+ describe: "Output format",
6957
+ default: "yaml",
6958
+ choices: ["yaml", "json"],
6959
+ type: "string"
6960
+ }).option("mode", {
6961
+ alias: ["m"],
6962
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
6963
+ choices: ["create", "createOrUpdate", "mirror"],
6964
+ default: "mirror",
6965
+ type: "string"
6966
+ }),
6967
+ "entryPattern"
6968
+ )
6841
6969
  )
6842
6970
  )
6843
6971
  )
@@ -6856,7 +6984,8 @@ var EntryPatternPullModule = {
6856
6984
  project: projectId,
6857
6985
  diff: diffMode,
6858
6986
  allowEmptySource,
6859
- verbose
6987
+ verbose,
6988
+ resolvedBatchSize
6860
6989
  }) => {
6861
6990
  const fetch2 = nodeFetchProxy(proxy, verbose);
6862
6991
  const client = getContentClient({
@@ -6866,7 +6995,13 @@ var EntryPatternPullModule = {
6866
6995
  projectId
6867
6996
  });
6868
6997
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
6869
- const source = createEntryEngineDataSource({ client, state, onlyPatterns: true });
6998
+ const source = createEntryEngineDataSource({
6999
+ client,
7000
+ state,
7001
+ onlyPatterns: true,
7002
+ verbose,
7003
+ batchSize: resolvedBatchSize
7004
+ });
6870
7005
  let target;
6871
7006
  const isPackage = isPathAPackageFile(directory);
6872
7007
  if (isPackage) {
@@ -6928,21 +7063,24 @@ var EntryPatternPushModule = {
6928
7063
  withProjectOptions(
6929
7064
  withStateOptions(
6930
7065
  withDiffOptions(
6931
- yargs43.positional("directory", {
6932
- describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
6933
- type: "string"
6934
- }).option("what-if", {
6935
- alias: ["w"],
6936
- describe: "What-if mode reports what would be done but changes nothing",
6937
- default: false,
6938
- type: "boolean"
6939
- }).option("mode", {
6940
- alias: ["m"],
6941
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
6942
- choices: ["create", "createOrUpdate", "mirror"],
6943
- default: "mirror",
6944
- type: "string"
6945
- })
7066
+ withBatchSizeOptions(
7067
+ yargs43.positional("directory", {
7068
+ describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
7069
+ type: "string"
7070
+ }).option("what-if", {
7071
+ alias: ["w"],
7072
+ describe: "What-if mode reports what would be done but changes nothing",
7073
+ default: false,
7074
+ type: "boolean"
7075
+ }).option("mode", {
7076
+ alias: ["m"],
7077
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
7078
+ choices: ["create", "createOrUpdate", "mirror"],
7079
+ default: "mirror",
7080
+ type: "string"
7081
+ }),
7082
+ "entryPattern"
7083
+ )
6946
7084
  )
6947
7085
  )
6948
7086
  )
@@ -6960,7 +7098,8 @@ var EntryPatternPushModule = {
6960
7098
  project: projectId,
6961
7099
  diff: diffMode,
6962
7100
  allowEmptySource,
6963
- verbose
7101
+ verbose,
7102
+ resolvedBatchSize
6964
7103
  }) => {
6965
7104
  const fetch2 = nodeFetchProxy(proxy, verbose);
6966
7105
  const client = getContentClient({
@@ -6987,7 +7126,13 @@ var EntryPatternPushModule = {
6987
7126
  verbose
6988
7127
  });
6989
7128
  }
6990
- const target = createEntryEngineDataSource({ client, state, onlyPatterns: true });
7129
+ const target = createEntryEngineDataSource({
7130
+ client,
7131
+ state,
7132
+ onlyPatterns: true,
7133
+ verbose,
7134
+ batchSize: resolvedBatchSize
7135
+ });
6991
7136
  const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
6992
7137
  const uniformLocales = await fetchUniformLocales({
6993
7138
  apiKey,
@@ -7054,20 +7199,33 @@ var EntryPatternUnpublishModule = {
7054
7199
  withDebugOptions(
7055
7200
  withApiOptions(
7056
7201
  withProjectOptions(
7057
- yargs43.positional("ids", {
7058
- describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
7059
- type: "string"
7060
- }).option("all", {
7061
- alias: ["a"],
7062
- describe: "Un-publishes all entry patterns. Use --all to un-publish selected entry patterns instead.",
7063
- default: false,
7064
- type: "boolean"
7065
- })
7202
+ withBatchSizeOptions(
7203
+ yargs43.positional("ids", {
7204
+ describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
7205
+ type: "string"
7206
+ }).option("all", {
7207
+ alias: ["a"],
7208
+ describe: "Un-publishes all entry patterns. Use --all to un-publish selected entry patterns instead.",
7209
+ default: false,
7210
+ type: "boolean"
7211
+ }),
7212
+ "entryPattern"
7213
+ )
7066
7214
  )
7067
7215
  )
7068
7216
  )
7069
7217
  ),
7070
- handler: async ({ apiHost, apiKey, proxy, ids, all, project: projectId, whatIf, verbose }) => {
7218
+ handler: async ({
7219
+ apiHost,
7220
+ apiKey,
7221
+ proxy,
7222
+ ids,
7223
+ all,
7224
+ project: projectId,
7225
+ whatIf,
7226
+ verbose,
7227
+ resolvedBatchSize
7228
+ }) => {
7071
7229
  if (!all && !ids || all && ids) {
7072
7230
  console.error(`Specify --all or entry pattern ID(s) to unpublish.`);
7073
7231
  process.exit(1);
@@ -7080,13 +7238,15 @@ var EntryPatternUnpublishModule = {
7080
7238
  client,
7081
7239
  state: "published",
7082
7240
  entryIDs: entryIDsArray,
7083
- onlyPatterns: true
7241
+ onlyPatterns: true,
7242
+ batchSize: resolvedBatchSize
7084
7243
  });
7085
7244
  const target = createEntryEngineDataSource({
7086
7245
  client,
7087
7246
  state: "preview",
7088
7247
  entryIDs: entryIDsArray,
7089
- onlyPatterns: true
7248
+ onlyPatterns: true,
7249
+ batchSize: resolvedBatchSize
7090
7250
  });
7091
7251
  const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
7092
7252
  for await (const obj of target.objects) {
@@ -7172,12 +7332,14 @@ function normalizeLabelForSync(label) {
7172
7332
  return labelWithoutProjectId;
7173
7333
  }
7174
7334
  function createLabelsEngineDataSource({
7175
- client
7335
+ client,
7336
+ batchSize,
7337
+ verbose
7176
7338
  }) {
7177
7339
  async function* getObjects() {
7178
7340
  const labels = paginateAsync(
7179
7341
  async (offset, limit2) => (await client.getLabels({ offset, limit: limit2 })).labels,
7180
- { pageSize: 100 }
7342
+ { pageSize: batchSize ?? 100, verbose, entityName: "labels" }
7181
7343
  );
7182
7344
  for await (const label of labels) {
7183
7345
  const result = {
@@ -7218,22 +7380,25 @@ var LabelPullModule = {
7218
7380
  withApiOptions(
7219
7381
  withProjectOptions(
7220
7382
  withDiffOptions(
7221
- yargs43.positional("directory", {
7222
- describe: "Directory to save the labels to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
7223
- type: "string"
7224
- }).option("format", {
7225
- alias: ["f"],
7226
- describe: "Output format",
7227
- default: "yaml",
7228
- choices: ["yaml", "json"],
7229
- type: "string"
7230
- }).option("mode", {
7231
- alias: ["m"],
7232
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
7233
- choices: ["create", "createOrUpdate", "mirror"],
7234
- default: "mirror",
7235
- type: "string"
7236
- })
7383
+ withBatchSizeOptions(
7384
+ yargs43.positional("directory", {
7385
+ describe: "Directory to save the labels to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
7386
+ type: "string"
7387
+ }).option("format", {
7388
+ alias: ["f"],
7389
+ describe: "Output format",
7390
+ default: "yaml",
7391
+ choices: ["yaml", "json"],
7392
+ type: "string"
7393
+ }).option("mode", {
7394
+ alias: ["m"],
7395
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
7396
+ choices: ["create", "createOrUpdate", "mirror"],
7397
+ default: "mirror",
7398
+ type: "string"
7399
+ }),
7400
+ "label"
7401
+ )
7237
7402
  )
7238
7403
  )
7239
7404
  )
@@ -7250,11 +7415,16 @@ var LabelPullModule = {
7250
7415
  project: projectId,
7251
7416
  diff: diffMode,
7252
7417
  allowEmptySource,
7253
- verbose
7418
+ verbose,
7419
+ resolvedBatchSize
7254
7420
  }) => {
7255
7421
  const fetch2 = nodeFetchProxy(proxy, verbose);
7256
7422
  const client = getLabelClient({ apiKey, apiHost, fetch: fetch2, projectId });
7257
- const source = createLabelsEngineDataSource({ client });
7423
+ const source = createLabelsEngineDataSource({
7424
+ client,
7425
+ verbose,
7426
+ batchSize: resolvedBatchSize
7427
+ });
7258
7428
  let target;
7259
7429
  const isPackage = isPathAPackageFile(directory);
7260
7430
  if (isPackage) {
@@ -7305,16 +7475,19 @@ var LabelPushModule = {
7305
7475
  withApiOptions(
7306
7476
  withProjectOptions(
7307
7477
  withDiffOptions(
7308
- yargs43.positional("directory", {
7309
- describe: "Directory to read the labels from. If a filename is used, a package will be read instead.",
7310
- type: "string"
7311
- }).option("mode", {
7312
- alias: ["m"],
7313
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
7314
- choices: ["create", "createOrUpdate", "mirror"],
7315
- default: "mirror",
7316
- type: "string"
7317
- })
7478
+ withBatchSizeOptions(
7479
+ yargs43.positional("directory", {
7480
+ describe: "Directory to read the labels from. If a filename is used, a package will be read instead.",
7481
+ type: "string"
7482
+ }).option("mode", {
7483
+ alias: ["m"],
7484
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
7485
+ choices: ["create", "createOrUpdate", "mirror"],
7486
+ default: "mirror",
7487
+ type: "string"
7488
+ }),
7489
+ "label"
7490
+ )
7318
7491
  )
7319
7492
  )
7320
7493
  )
@@ -7330,7 +7503,8 @@ var LabelPushModule = {
7330
7503
  project: projectId,
7331
7504
  diff: diffMode,
7332
7505
  allowEmptySource,
7333
- verbose
7506
+ verbose,
7507
+ resolvedBatchSize
7334
7508
  }) => {
7335
7509
  const fetch2 = nodeFetchProxy(proxy, verbose);
7336
7510
  const client = getLabelClient({ apiKey, apiHost, fetch: fetch2, projectId });
@@ -7353,7 +7527,11 @@ var LabelPushModule = {
7353
7527
  verbose
7354
7528
  });
7355
7529
  }
7356
- const target = createLabelsEngineDataSource({ client });
7530
+ const target = createLabelsEngineDataSource({
7531
+ client,
7532
+ verbose,
7533
+ batchSize: resolvedBatchSize
7534
+ });
7357
7535
  const labelsFailedDueToMissingParent = /* @__PURE__ */ new Set();
7358
7536
  const attemptSync = async () => {
7359
7537
  const lastFailedLabelsCount = labelsFailedDueToMissingParent.size;
@@ -8498,11 +8676,15 @@ var getWorkflowClient = (options) => new WorkflowClient({ ...options, bypassCach
8498
8676
 
8499
8677
  // src/commands/canvas/workflowEngineDataSource.ts
8500
8678
  function createWorkflowEngineDataSource({
8501
- client
8679
+ client,
8680
+ batchSize,
8681
+ verbose
8502
8682
  }) {
8503
8683
  async function* getObjects() {
8504
- const workflows = paginateAsync(async () => (await client.get()).results, {
8505
- pageSize: 100
8684
+ const workflows = paginateAsync(async (offset, limit2) => (await client.get({ offset, limit: limit2 })).results, {
8685
+ pageSize: batchSize ?? 100,
8686
+ verbose,
8687
+ entityName: "workflows"
8506
8688
  });
8507
8689
  for await (const workflow of workflows) {
8508
8690
  const { modified, modifiedBy, created, createdBy, ...workflowWithoutStatistics } = workflow;
@@ -8536,22 +8718,25 @@ var WorkflowPullModule = {
8536
8718
  withDebugOptions(
8537
8719
  withProjectOptions(
8538
8720
  withDiffOptions(
8539
- yargs43.positional("directory", {
8540
- describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
8541
- type: "string"
8542
- }).option("format", {
8543
- alias: ["f"],
8544
- describe: "Output format",
8545
- default: "yaml",
8546
- choices: ["yaml", "json"],
8547
- type: "string"
8548
- }).option("mode", {
8549
- alias: ["m"],
8550
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
8551
- choices: ["create", "createOrUpdate", "mirror"],
8552
- default: "mirror",
8553
- type: "string"
8554
- })
8721
+ withBatchSizeOptions(
8722
+ yargs43.positional("directory", {
8723
+ describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
8724
+ type: "string"
8725
+ }).option("format", {
8726
+ alias: ["f"],
8727
+ describe: "Output format",
8728
+ default: "yaml",
8729
+ choices: ["yaml", "json"],
8730
+ type: "string"
8731
+ }).option("mode", {
8732
+ alias: ["m"],
8733
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
8734
+ choices: ["create", "createOrUpdate", "mirror"],
8735
+ default: "mirror",
8736
+ type: "string"
8737
+ }),
8738
+ "workflow"
8739
+ )
8555
8740
  )
8556
8741
  )
8557
8742
  )
@@ -8568,11 +8753,16 @@ var WorkflowPullModule = {
8568
8753
  project: projectId,
8569
8754
  diff: diffMode,
8570
8755
  allowEmptySource,
8571
- verbose
8756
+ verbose,
8757
+ resolvedBatchSize
8572
8758
  }) => {
8573
8759
  const fetch2 = nodeFetchProxy(proxy, verbose);
8574
8760
  const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch2, projectId });
8575
- const source = createWorkflowEngineDataSource({ client });
8761
+ const source = createWorkflowEngineDataSource({
8762
+ client,
8763
+ verbose,
8764
+ batchSize: resolvedBatchSize
8765
+ });
8576
8766
  let target;
8577
8767
  const isPackage = isPathAPackageFile(directory);
8578
8768
  if (isPackage) {
@@ -8616,16 +8806,19 @@ var WorkflowPushModule = {
8616
8806
  withApiOptions(
8617
8807
  withProjectOptions(
8618
8808
  withDiffOptions(
8619
- yargs43.positional("directory", {
8620
- describe: "Directory to read from. If a filename is used, a package will be read instead.",
8621
- type: "string"
8622
- }).option("mode", {
8623
- alias: ["m"],
8624
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
8625
- choices: ["create", "createOrUpdate", "mirror"],
8626
- default: "mirror",
8627
- type: "string"
8628
- })
8809
+ withBatchSizeOptions(
8810
+ yargs43.positional("directory", {
8811
+ describe: "Directory to read from. If a filename is used, a package will be read instead.",
8812
+ type: "string"
8813
+ }).option("mode", {
8814
+ alias: ["m"],
8815
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
8816
+ choices: ["create", "createOrUpdate", "mirror"],
8817
+ default: "mirror",
8818
+ type: "string"
8819
+ }),
8820
+ "workflow"
8821
+ )
8629
8822
  )
8630
8823
  )
8631
8824
  )
@@ -8641,7 +8834,8 @@ var WorkflowPushModule = {
8641
8834
  project: projectId,
8642
8835
  diff: diffMode,
8643
8836
  allowEmptySource,
8644
- verbose
8837
+ verbose,
8838
+ resolvedBatchSize
8645
8839
  }) => {
8646
8840
  const fetch2 = nodeFetchProxy(proxy, verbose);
8647
8841
  const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch2, projectId });
@@ -8663,7 +8857,11 @@ var WorkflowPushModule = {
8663
8857
  verbose
8664
8858
  });
8665
8859
  }
8666
- const target = createWorkflowEngineDataSource({ client });
8860
+ const target = createWorkflowEngineDataSource({
8861
+ client,
8862
+ verbose,
8863
+ batchSize: resolvedBatchSize
8864
+ });
8667
8865
  await syncEngine({
8668
8866
  source,
8669
8867
  target,
@@ -13019,7 +13217,8 @@ var SyncPullModule = {
13019
13217
  patternType: entityType === "compositionPattern" ? "composition" : entityType === "componentPattern" ? "component" : void 0,
13020
13218
  mode: getPullMode(entityType, config2),
13021
13219
  directory: getPullFilename(entityType, config2),
13022
- allowEmptySource: config2.allowEmptySource
13220
+ allowEmptySource: config2.allowEmptySource,
13221
+ ...isPaginatedSyncEntity(entityType) ? { resolvedBatchSize: getEntityBatchSize(entityType, config2) } : {}
13023
13222
  }),
13024
13223
  {
13025
13224
  text: `${entityType}\u2026`,
@@ -13184,7 +13383,8 @@ var SyncPushModule = {
13184
13383
  patternType: entityType === "compositionPattern" ? "composition" : entityType === "componentPattern" ? "component" : void 0,
13185
13384
  mode: getPushMode(entityType, config2),
13186
13385
  directory: getPushFilename(entityType, config2),
13187
- allowEmptySource: config2.allowEmptySource
13386
+ allowEmptySource: config2.allowEmptySource,
13387
+ ...isPaginatedSyncEntity(entityType) ? { resolvedBatchSize: getEntityBatchSize(entityType, config2) } : {}
13188
13388
  }),
13189
13389
  {
13190
13390
  text: `${entityType}...`,
@@ -13205,10 +13405,12 @@ var SyncPushModule = {
13205
13405
  await spinPromise(
13206
13406
  ComponentPatternPublishModule.handler({
13207
13407
  ...otherParams,
13408
+ serialization: config2,
13208
13409
  patternType: "component",
13209
13410
  onlyPatterns: true,
13210
13411
  all: true,
13211
- directory: getPushFilename("componentPattern", config2)
13412
+ directory: getPushFilename("componentPattern", config2),
13413
+ resolvedBatchSize: getEntityBatchSize("componentPattern", config2)
13212
13414
  }),
13213
13415
  {
13214
13416
  text: "publishing component patterns...",
@@ -13229,10 +13431,12 @@ var SyncPushModule = {
13229
13431
  await spinPromise(
13230
13432
  CompositionPatternPublishModule.handler({
13231
13433
  ...otherParams,
13434
+ serialization: config2,
13232
13435
  all: true,
13233
13436
  onlyPatterns: true,
13234
13437
  patternType: "composition",
13235
- directory: getPushFilename("compositionPattern", config2)
13438
+ directory: getPushFilename("compositionPattern", config2),
13439
+ resolvedBatchSize: getEntityBatchSize("compositionPattern", config2)
13236
13440
  }),
13237
13441
  {
13238
13442
  text: "publishing composition patterns...",
@@ -13253,9 +13457,11 @@ var SyncPushModule = {
13253
13457
  await spinPromise(
13254
13458
  CompositionPublishModule.handler({
13255
13459
  ...otherParams,
13460
+ serialization: config2,
13256
13461
  all: true,
13257
13462
  onlyCompositions: true,
13258
- directory: getPushFilename("composition", config2)
13463
+ directory: getPushFilename("composition", config2),
13464
+ resolvedBatchSize: getEntityBatchSize("composition", config2)
13259
13465
  }),
13260
13466
  {
13261
13467
  text: "publishing compositions...",
@@ -13276,8 +13482,10 @@ var SyncPushModule = {
13276
13482
  await spinPromise(
13277
13483
  EntryPublishModule.handler({
13278
13484
  ...otherParams,
13485
+ serialization: config2,
13279
13486
  all: true,
13280
- directory: getPushFilename("entry", config2)
13487
+ directory: getPushFilename("entry", config2),
13488
+ resolvedBatchSize: getEntityBatchSize("entry", config2)
13281
13489
  }),
13282
13490
  {
13283
13491
  text: "publishing entries...",
@@ -13298,8 +13506,10 @@ var SyncPushModule = {
13298
13506
  await spinPromise(
13299
13507
  EntryPatternPublishModule.handler({
13300
13508
  ...otherParams,
13509
+ serialization: config2,
13301
13510
  all: true,
13302
- directory: getPushFilename("entryPattern", config2)
13511
+ directory: getPushFilename("entryPattern", config2),
13512
+ resolvedBatchSize: getEntityBatchSize("entryPattern", config2)
13303
13513
  }),
13304
13514
  {
13305
13515
  text: "publishing entry patterns...",