@uniformdev/cli 20.66.4 → 20.66.5-alpha.3
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-
|
|
24
|
+
} from "./chunk-JWPMHLJX.mjs";
|
|
22
25
|
|
|
23
26
|
// src/index.ts
|
|
24
27
|
import * as dotenv from "dotenv";
|
|
@@ -2709,20 +2712,16 @@ function convertStateOption(state) {
|
|
|
2709
2712
|
// src/commands/canvas/assetEngineDataSource.ts
|
|
2710
2713
|
function createAssetEngineDataSource({
|
|
2711
2714
|
client,
|
|
2712
|
-
verbose
|
|
2715
|
+
verbose,
|
|
2716
|
+
batchSize
|
|
2713
2717
|
}) {
|
|
2714
2718
|
async function* getObjects() {
|
|
2715
2719
|
const assets = paginateAsync(
|
|
2716
|
-
async (offset, limit2) => {
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
limit: limit2,
|
|
2722
|
-
offset
|
|
2723
|
-
})).assets;
|
|
2724
|
-
},
|
|
2725
|
-
{ pageSize: 50 }
|
|
2720
|
+
async (offset, limit2) => (await client.get({
|
|
2721
|
+
limit: limit2,
|
|
2722
|
+
offset
|
|
2723
|
+
})).assets,
|
|
2724
|
+
{ pageSize: batchSize ?? 50, verbose, entityName: "assets" }
|
|
2726
2725
|
);
|
|
2727
2726
|
for await (const e of assets) {
|
|
2728
2727
|
const result = {
|
|
@@ -2772,22 +2771,25 @@ var AssetPullModule = {
|
|
|
2772
2771
|
withDebugOptions(
|
|
2773
2772
|
withProjectOptions(
|
|
2774
2773
|
withDiffOptions(
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
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
|
+
)
|
|
2791
2793
|
)
|
|
2792
2794
|
)
|
|
2793
2795
|
)
|
|
@@ -2804,7 +2806,8 @@ var AssetPullModule = {
|
|
|
2804
2806
|
whatIf,
|
|
2805
2807
|
project: projectId,
|
|
2806
2808
|
diff: diffMode,
|
|
2807
|
-
allowEmptySource
|
|
2809
|
+
allowEmptySource,
|
|
2810
|
+
resolvedBatchSize
|
|
2808
2811
|
}) => {
|
|
2809
2812
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2810
2813
|
const client = getAssetClient({
|
|
@@ -2814,7 +2817,11 @@ var AssetPullModule = {
|
|
|
2814
2817
|
projectId
|
|
2815
2818
|
});
|
|
2816
2819
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
2817
|
-
const source = createAssetEngineDataSource({
|
|
2820
|
+
const source = createAssetEngineDataSource({
|
|
2821
|
+
client,
|
|
2822
|
+
verbose,
|
|
2823
|
+
batchSize: resolvedBatchSize
|
|
2824
|
+
});
|
|
2818
2825
|
let target;
|
|
2819
2826
|
const isPackage = isPathAPackageFile(directory);
|
|
2820
2827
|
const onBeforeDeleteObject = async (id, object4) => {
|
|
@@ -2889,16 +2896,19 @@ var AssetPushModule = {
|
|
|
2889
2896
|
withDebugOptions(
|
|
2890
2897
|
withProjectOptions(
|
|
2891
2898
|
withDiffOptions(
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
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
|
+
)
|
|
2902
2912
|
)
|
|
2903
2913
|
)
|
|
2904
2914
|
)
|
|
@@ -2914,7 +2924,8 @@ var AssetPushModule = {
|
|
|
2914
2924
|
project: projectId,
|
|
2915
2925
|
diff: diffMode,
|
|
2916
2926
|
allowEmptySource,
|
|
2917
|
-
verbose
|
|
2927
|
+
verbose,
|
|
2928
|
+
resolvedBatchSize
|
|
2918
2929
|
}) => {
|
|
2919
2930
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2920
2931
|
const client = getAssetClient({
|
|
@@ -2941,7 +2952,11 @@ var AssetPushModule = {
|
|
|
2941
2952
|
verbose
|
|
2942
2953
|
});
|
|
2943
2954
|
}
|
|
2944
|
-
const target = createAssetEngineDataSource({
|
|
2955
|
+
const target = createAssetEngineDataSource({
|
|
2956
|
+
client,
|
|
2957
|
+
verbose,
|
|
2958
|
+
batchSize: resolvedBatchSize
|
|
2959
|
+
});
|
|
2945
2960
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
2946
2961
|
await syncEngine({
|
|
2947
2962
|
source,
|
|
@@ -3134,10 +3149,8 @@ function createCategoriesEngineDataSource({
|
|
|
3134
3149
|
client
|
|
3135
3150
|
}) {
|
|
3136
3151
|
async function* getObjects() {
|
|
3137
|
-
const categories =
|
|
3138
|
-
|
|
3139
|
-
});
|
|
3140
|
-
for await (const def of categories) {
|
|
3152
|
+
const categories = (await client.getCategories()).categories;
|
|
3153
|
+
for (const def of categories) {
|
|
3141
3154
|
const result = {
|
|
3142
3155
|
id: selectIdentifier(def),
|
|
3143
3156
|
displayName: selectDisplayName(def),
|
|
@@ -3458,12 +3471,14 @@ var ComponentListModule = {
|
|
|
3458
3471
|
|
|
3459
3472
|
// src/commands/canvas/componentDefinitionEngineDataSource.ts
|
|
3460
3473
|
function createComponentDefinitionEngineDataSource({
|
|
3461
|
-
client
|
|
3474
|
+
client,
|
|
3475
|
+
batchSize,
|
|
3476
|
+
verbose
|
|
3462
3477
|
}) {
|
|
3463
3478
|
async function* getObjects() {
|
|
3464
3479
|
const componentDefinitions = paginateAsync(
|
|
3465
3480
|
async (offset, limit2) => (await client.getComponentDefinitions({ limit: limit2, offset })).componentDefinitions,
|
|
3466
|
-
{ pageSize: 200 }
|
|
3481
|
+
{ pageSize: batchSize ?? 200, verbose, entityName: "components" }
|
|
3467
3482
|
);
|
|
3468
3483
|
for await (const def of componentDefinitions) {
|
|
3469
3484
|
const result = {
|
|
@@ -3503,22 +3518,25 @@ var ComponentPullModule = {
|
|
|
3503
3518
|
withDebugOptions(
|
|
3504
3519
|
withProjectOptions(
|
|
3505
3520
|
withDiffOptions(
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
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
|
+
)
|
|
3522
3540
|
)
|
|
3523
3541
|
)
|
|
3524
3542
|
)
|
|
@@ -3535,11 +3553,16 @@ var ComponentPullModule = {
|
|
|
3535
3553
|
project: projectId,
|
|
3536
3554
|
diff: diffMode,
|
|
3537
3555
|
allowEmptySource,
|
|
3538
|
-
verbose
|
|
3556
|
+
verbose,
|
|
3557
|
+
resolvedBatchSize
|
|
3539
3558
|
}) => {
|
|
3540
3559
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3541
3560
|
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
3542
|
-
const source = createComponentDefinitionEngineDataSource({
|
|
3561
|
+
const source = createComponentDefinitionEngineDataSource({
|
|
3562
|
+
client,
|
|
3563
|
+
batchSize: resolvedBatchSize,
|
|
3564
|
+
verbose
|
|
3565
|
+
});
|
|
3543
3566
|
let target;
|
|
3544
3567
|
const isPackage = isPathAPackageFile(directory);
|
|
3545
3568
|
if (isPackage) {
|
|
@@ -3584,16 +3607,19 @@ var ComponentPushModule = {
|
|
|
3584
3607
|
withDebugOptions(
|
|
3585
3608
|
withProjectOptions(
|
|
3586
3609
|
withDiffOptions(
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
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
|
+
)
|
|
3597
3623
|
)
|
|
3598
3624
|
)
|
|
3599
3625
|
)
|
|
@@ -3609,7 +3635,8 @@ var ComponentPushModule = {
|
|
|
3609
3635
|
project: projectId,
|
|
3610
3636
|
diff: diffMode,
|
|
3611
3637
|
allowEmptySource,
|
|
3612
|
-
verbose
|
|
3638
|
+
verbose,
|
|
3639
|
+
resolvedBatchSize
|
|
3613
3640
|
}) => {
|
|
3614
3641
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3615
3642
|
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -3632,7 +3659,11 @@ var ComponentPushModule = {
|
|
|
3632
3659
|
verbose
|
|
3633
3660
|
});
|
|
3634
3661
|
}
|
|
3635
|
-
const target = createComponentDefinitionEngineDataSource({
|
|
3662
|
+
const target = createComponentDefinitionEngineDataSource({
|
|
3663
|
+
client,
|
|
3664
|
+
batchSize: resolvedBatchSize,
|
|
3665
|
+
verbose
|
|
3666
|
+
});
|
|
3636
3667
|
await syncEngine({
|
|
3637
3668
|
source,
|
|
3638
3669
|
target,
|
|
@@ -4086,6 +4117,7 @@ function createComponentInstanceEngineDataSource({
|
|
|
4086
4117
|
onlyPatterns,
|
|
4087
4118
|
patternType,
|
|
4088
4119
|
verbose,
|
|
4120
|
+
batchSize,
|
|
4089
4121
|
...clientOptions
|
|
4090
4122
|
}) {
|
|
4091
4123
|
const stateId = convertStateOption(state);
|
|
@@ -4109,7 +4141,7 @@ function createComponentInstanceEngineDataSource({
|
|
|
4109
4141
|
}
|
|
4110
4142
|
return (await client.getCompositionList(parameters)).compositions;
|
|
4111
4143
|
},
|
|
4112
|
-
{ pageSize: 100 }
|
|
4144
|
+
{ pageSize: batchSize ?? 100, verbose, entityName: "compositions" }
|
|
4113
4145
|
);
|
|
4114
4146
|
for await (const compositionListItem of componentInstances) {
|
|
4115
4147
|
const result = {
|
|
@@ -4148,24 +4180,27 @@ var CompositionPublishModule = {
|
|
|
4148
4180
|
withProjectOptions(
|
|
4149
4181
|
withDebugOptions(
|
|
4150
4182
|
withDiffOptions(
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
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
|
+
)
|
|
4169
4204
|
)
|
|
4170
4205
|
)
|
|
4171
4206
|
)
|
|
@@ -4183,7 +4218,8 @@ var CompositionPublishModule = {
|
|
|
4183
4218
|
onlyPatterns,
|
|
4184
4219
|
patternType,
|
|
4185
4220
|
verbose,
|
|
4186
|
-
directory
|
|
4221
|
+
directory,
|
|
4222
|
+
resolvedBatchSize
|
|
4187
4223
|
}) => {
|
|
4188
4224
|
if (!all && !ids || all && ids) {
|
|
4189
4225
|
console.error(`Specify --all or composition ID(s) to publish.`);
|
|
@@ -4199,7 +4235,8 @@ var CompositionPublishModule = {
|
|
|
4199
4235
|
onlyCompositions,
|
|
4200
4236
|
onlyPatterns,
|
|
4201
4237
|
patternType,
|
|
4202
|
-
verbose
|
|
4238
|
+
verbose,
|
|
4239
|
+
batchSize: resolvedBatchSize
|
|
4203
4240
|
});
|
|
4204
4241
|
const target = createComponentInstanceEngineDataSource({
|
|
4205
4242
|
client,
|
|
@@ -4208,7 +4245,8 @@ var CompositionPublishModule = {
|
|
|
4208
4245
|
onlyCompositions,
|
|
4209
4246
|
onlyPatterns,
|
|
4210
4247
|
patternType,
|
|
4211
|
-
verbose
|
|
4248
|
+
verbose,
|
|
4249
|
+
batchSize: resolvedBatchSize
|
|
4212
4250
|
});
|
|
4213
4251
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
4214
4252
|
await syncEngine({
|
|
@@ -4246,33 +4284,36 @@ var ComponentPatternPublishModule = {
|
|
|
4246
4284
|
withDebugOptions(
|
|
4247
4285
|
withProjectOptions(
|
|
4248
4286
|
withDiffOptions(
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
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
|
+
)
|
|
4276
4317
|
)
|
|
4277
4318
|
)
|
|
4278
4319
|
)
|
|
@@ -4281,8 +4322,8 @@ var ComponentPatternPublishModule = {
|
|
|
4281
4322
|
};
|
|
4282
4323
|
|
|
4283
4324
|
// src/commands/canvas/commands/composition/pull.ts
|
|
4284
|
-
var CompositionPullModule = componentInstancePullModuleFactory("compositions");
|
|
4285
|
-
function componentInstancePullModuleFactory(type) {
|
|
4325
|
+
var CompositionPullModule = componentInstancePullModuleFactory("compositions", "composition");
|
|
4326
|
+
function componentInstancePullModuleFactory(type, entityType) {
|
|
4286
4327
|
return {
|
|
4287
4328
|
command: "pull <directory>",
|
|
4288
4329
|
describe: "Pulls all compositions to local files in a directory",
|
|
@@ -4292,31 +4333,34 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4292
4333
|
withStateOptions(
|
|
4293
4334
|
withDebugOptions(
|
|
4294
4335
|
withDiffOptions(
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
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
|
+
)
|
|
4320
4364
|
)
|
|
4321
4365
|
)
|
|
4322
4366
|
)
|
|
@@ -4338,7 +4382,8 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4338
4382
|
project: projectId,
|
|
4339
4383
|
diff: diffMode,
|
|
4340
4384
|
allowEmptySource,
|
|
4341
|
-
verbose
|
|
4385
|
+
verbose,
|
|
4386
|
+
resolvedBatchSize
|
|
4342
4387
|
}) => {
|
|
4343
4388
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4344
4389
|
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -4349,7 +4394,8 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4349
4394
|
onlyCompositions,
|
|
4350
4395
|
onlyPatterns,
|
|
4351
4396
|
patternType,
|
|
4352
|
-
verbose
|
|
4397
|
+
verbose,
|
|
4398
|
+
batchSize: resolvedBatchSize
|
|
4353
4399
|
});
|
|
4354
4400
|
const isPackage = isPathAPackageFile(directory);
|
|
4355
4401
|
let target;
|
|
@@ -4405,7 +4451,7 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4405
4451
|
|
|
4406
4452
|
// src/commands/canvas/commands/componentPattern/pull.ts
|
|
4407
4453
|
var ComponentPatternPullModule = {
|
|
4408
|
-
...componentInstancePullModuleFactory("componentPatterns"),
|
|
4454
|
+
...componentInstancePullModuleFactory("componentPatterns", "componentPattern"),
|
|
4409
4455
|
describe: "Pulls all component patterns to local files in a directory",
|
|
4410
4456
|
builder: (yargs43) => withConfiguration(
|
|
4411
4457
|
withApiOptions(
|
|
@@ -4482,8 +4528,8 @@ function createLocaleValidationHook(uniformLocales) {
|
|
|
4482
4528
|
}
|
|
4483
4529
|
|
|
4484
4530
|
// src/commands/canvas/commands/composition/push.ts
|
|
4485
|
-
var CompositionPushModule = componentInstancePushModuleFactory("compositions");
|
|
4486
|
-
function componentInstancePushModuleFactory(type) {
|
|
4531
|
+
var CompositionPushModule = componentInstancePushModuleFactory("compositions", "composition");
|
|
4532
|
+
function componentInstancePushModuleFactory(type, entityType) {
|
|
4487
4533
|
return {
|
|
4488
4534
|
command: "push <directory>",
|
|
4489
4535
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
@@ -4493,25 +4539,28 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4493
4539
|
withStateOptions(
|
|
4494
4540
|
withDebugOptions(
|
|
4495
4541
|
withDiffOptions(
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
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
|
+
)
|
|
4515
4564
|
)
|
|
4516
4565
|
)
|
|
4517
4566
|
)
|
|
@@ -4532,7 +4581,8 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4532
4581
|
patternType,
|
|
4533
4582
|
diff: diffMode,
|
|
4534
4583
|
allowEmptySource,
|
|
4535
|
-
verbose
|
|
4584
|
+
verbose,
|
|
4585
|
+
resolvedBatchSize
|
|
4536
4586
|
}) => {
|
|
4537
4587
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4538
4588
|
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -4560,7 +4610,8 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4560
4610
|
onlyCompositions,
|
|
4561
4611
|
onlyPatterns,
|
|
4562
4612
|
patternType,
|
|
4563
|
-
verbose
|
|
4613
|
+
verbose,
|
|
4614
|
+
batchSize: resolvedBatchSize
|
|
4564
4615
|
});
|
|
4565
4616
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
4566
4617
|
const uniformLocales = await fetchUniformLocales({
|
|
@@ -4605,7 +4656,7 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4605
4656
|
|
|
4606
4657
|
// src/commands/canvas/commands/componentPattern/push.ts
|
|
4607
4658
|
var ComponentPatternPushModule = {
|
|
4608
|
-
...componentInstancePushModuleFactory("componentPatterns"),
|
|
4659
|
+
...componentInstancePushModuleFactory("componentPatterns", "componentPattern"),
|
|
4609
4660
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
4610
4661
|
builder: (yargs43) => withConfiguration(
|
|
4611
4662
|
withApiOptions(
|
|
@@ -4713,24 +4764,27 @@ var CompositionUnpublishModule = {
|
|
|
4713
4764
|
withApiOptions(
|
|
4714
4765
|
withDebugOptions(
|
|
4715
4766
|
withProjectOptions(
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
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
|
+
)
|
|
4734
4788
|
)
|
|
4735
4789
|
)
|
|
4736
4790
|
)
|
|
@@ -4746,7 +4800,8 @@ var CompositionUnpublishModule = {
|
|
|
4746
4800
|
patternType,
|
|
4747
4801
|
project: projectId,
|
|
4748
4802
|
whatIf,
|
|
4749
|
-
verbose
|
|
4803
|
+
verbose,
|
|
4804
|
+
resolvedBatchSize
|
|
4750
4805
|
}) => {
|
|
4751
4806
|
if (!all && !ids || all && ids) {
|
|
4752
4807
|
console.error(`Specify --all or composition ID(s) to unpublish.`);
|
|
@@ -4763,7 +4818,8 @@ var CompositionUnpublishModule = {
|
|
|
4763
4818
|
onlyCompositions,
|
|
4764
4819
|
onlyPatterns,
|
|
4765
4820
|
patternType,
|
|
4766
|
-
verbose
|
|
4821
|
+
verbose,
|
|
4822
|
+
batchSize: resolvedBatchSize
|
|
4767
4823
|
});
|
|
4768
4824
|
const target = createComponentInstanceEngineDataSource({
|
|
4769
4825
|
client,
|
|
@@ -4772,7 +4828,8 @@ var CompositionUnpublishModule = {
|
|
|
4772
4828
|
onlyCompositions,
|
|
4773
4829
|
onlyPatterns,
|
|
4774
4830
|
patternType,
|
|
4775
|
-
verbose
|
|
4831
|
+
verbose,
|
|
4832
|
+
batchSize: resolvedBatchSize
|
|
4776
4833
|
});
|
|
4777
4834
|
const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
|
|
4778
4835
|
for await (const obj of target.objects) {
|
|
@@ -5011,34 +5068,37 @@ var CompositionPatternPublishModule = {
|
|
|
5011
5068
|
withDebugOptions(
|
|
5012
5069
|
withProjectOptions(
|
|
5013
5070
|
withDiffOptions(
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
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
|
+
)
|
|
5042
5102
|
)
|
|
5043
5103
|
)
|
|
5044
5104
|
)
|
|
@@ -5048,7 +5108,7 @@ var CompositionPatternPublishModule = {
|
|
|
5048
5108
|
|
|
5049
5109
|
// src/commands/canvas/commands/compositionPattern/pull.ts
|
|
5050
5110
|
var CompositionPatternPullModule = {
|
|
5051
|
-
...componentInstancePullModuleFactory("compositionPatterns"),
|
|
5111
|
+
...componentInstancePullModuleFactory("compositionPatterns", "compositionPattern"),
|
|
5052
5112
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
5053
5113
|
builder: (yargs43) => withConfiguration(
|
|
5054
5114
|
withApiOptions(
|
|
@@ -5092,7 +5152,7 @@ var CompositionPatternPullModule = {
|
|
|
5092
5152
|
|
|
5093
5153
|
// src/commands/canvas/commands/compositionPattern/push.ts
|
|
5094
5154
|
var CompositionPatternPushModule = {
|
|
5095
|
-
...componentInstancePushModuleFactory("compositionPatterns"),
|
|
5155
|
+
...componentInstancePushModuleFactory("compositionPatterns", "compositionPattern"),
|
|
5096
5156
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
5097
5157
|
builder: (yargs43) => withConfiguration(
|
|
5098
5158
|
withApiOptions(
|
|
@@ -5243,10 +5303,15 @@ var ContentTypeListModule = {
|
|
|
5243
5303
|
|
|
5244
5304
|
// src/commands/canvas/contentTypeEngineDataSource.ts
|
|
5245
5305
|
function createContentTypeEngineDataSource({
|
|
5246
|
-
client
|
|
5306
|
+
client,
|
|
5307
|
+
batchSize,
|
|
5308
|
+
verbose
|
|
5247
5309
|
}) {
|
|
5248
5310
|
async function* getObjects() {
|
|
5249
|
-
const
|
|
5311
|
+
const contentTypes = paginateAsync(
|
|
5312
|
+
async (offset, limit2) => (await client.getContentTypes({ offset, limit: limit2 })).contentTypes,
|
|
5313
|
+
{ pageSize: batchSize ?? 100, verbose, entityName: "content types" }
|
|
5314
|
+
);
|
|
5250
5315
|
for await (const ct of contentTypes) {
|
|
5251
5316
|
const result = {
|
|
5252
5317
|
id: selectContentTypeIdentifier(ct),
|
|
@@ -5278,22 +5343,25 @@ var ContentTypePullModule = {
|
|
|
5278
5343
|
withDebugOptions(
|
|
5279
5344
|
withProjectOptions(
|
|
5280
5345
|
withDiffOptions(
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
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
|
+
)
|
|
5297
5365
|
)
|
|
5298
5366
|
)
|
|
5299
5367
|
)
|
|
@@ -5310,7 +5378,8 @@ var ContentTypePullModule = {
|
|
|
5310
5378
|
project: projectId,
|
|
5311
5379
|
diff: diffMode,
|
|
5312
5380
|
allowEmptySource,
|
|
5313
|
-
verbose
|
|
5381
|
+
verbose,
|
|
5382
|
+
resolvedBatchSize
|
|
5314
5383
|
}) => {
|
|
5315
5384
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5316
5385
|
const client = getContentClient({
|
|
@@ -5319,7 +5388,11 @@ var ContentTypePullModule = {
|
|
|
5319
5388
|
fetch: fetch2,
|
|
5320
5389
|
projectId
|
|
5321
5390
|
});
|
|
5322
|
-
const source = createContentTypeEngineDataSource({
|
|
5391
|
+
const source = createContentTypeEngineDataSource({
|
|
5392
|
+
client,
|
|
5393
|
+
verbose,
|
|
5394
|
+
batchSize: resolvedBatchSize
|
|
5395
|
+
});
|
|
5323
5396
|
let target;
|
|
5324
5397
|
const isPackage = isPathAPackageFile(directory);
|
|
5325
5398
|
if (isPackage) {
|
|
@@ -5363,21 +5436,24 @@ var ContentTypePushModule = {
|
|
|
5363
5436
|
withDebugOptions(
|
|
5364
5437
|
withProjectOptions(
|
|
5365
5438
|
withDiffOptions(
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
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
|
+
)
|
|
5381
5457
|
)
|
|
5382
5458
|
)
|
|
5383
5459
|
)
|
|
@@ -5393,7 +5469,8 @@ var ContentTypePushModule = {
|
|
|
5393
5469
|
project: projectId,
|
|
5394
5470
|
diff: diffMode,
|
|
5395
5471
|
allowEmptySource,
|
|
5396
|
-
verbose
|
|
5472
|
+
verbose,
|
|
5473
|
+
resolvedBatchSize
|
|
5397
5474
|
}) => {
|
|
5398
5475
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5399
5476
|
const client = getContentClient({
|
|
@@ -5420,7 +5497,11 @@ var ContentTypePushModule = {
|
|
|
5420
5497
|
verbose
|
|
5421
5498
|
});
|
|
5422
5499
|
}
|
|
5423
|
-
const target = createContentTypeEngineDataSource({
|
|
5500
|
+
const target = createContentTypeEngineDataSource({
|
|
5501
|
+
client,
|
|
5502
|
+
verbose,
|
|
5503
|
+
batchSize: resolvedBatchSize
|
|
5504
|
+
});
|
|
5424
5505
|
await syncEngine({
|
|
5425
5506
|
source,
|
|
5426
5507
|
target,
|
|
@@ -6088,7 +6169,9 @@ function createEntryEngineDataSource({
|
|
|
6088
6169
|
state,
|
|
6089
6170
|
onlyEntries,
|
|
6090
6171
|
onlyPatterns,
|
|
6091
|
-
entryIDs
|
|
6172
|
+
entryIDs,
|
|
6173
|
+
batchSize,
|
|
6174
|
+
verbose
|
|
6092
6175
|
}) {
|
|
6093
6176
|
const stateId = convertStateOption(state);
|
|
6094
6177
|
async function* getObjects() {
|
|
@@ -6114,7 +6197,7 @@ function createEntryEngineDataSource({
|
|
|
6114
6197
|
throw error;
|
|
6115
6198
|
}
|
|
6116
6199
|
},
|
|
6117
|
-
{ pageSize: 100 }
|
|
6200
|
+
{ pageSize: batchSize ?? 100, verbose, entityName: "entries" }
|
|
6118
6201
|
);
|
|
6119
6202
|
for await (const e of entries) {
|
|
6120
6203
|
const result = {
|
|
@@ -6147,15 +6230,18 @@ var EntryPublishModule = {
|
|
|
6147
6230
|
withDiffOptions(
|
|
6148
6231
|
withApiOptions(
|
|
6149
6232
|
withProjectOptions(
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
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
|
+
)
|
|
6159
6245
|
)
|
|
6160
6246
|
)
|
|
6161
6247
|
)
|
|
@@ -6171,7 +6257,8 @@ var EntryPublishModule = {
|
|
|
6171
6257
|
project: projectId,
|
|
6172
6258
|
whatIf,
|
|
6173
6259
|
verbose,
|
|
6174
|
-
directory
|
|
6260
|
+
directory,
|
|
6261
|
+
resolvedBatchSize
|
|
6175
6262
|
}) => {
|
|
6176
6263
|
if (!all && !ids || all && ids) {
|
|
6177
6264
|
console.error(`Specify --all or entry ID(s) to publish.`);
|
|
@@ -6184,13 +6271,15 @@ var EntryPublishModule = {
|
|
|
6184
6271
|
client,
|
|
6185
6272
|
state: "preview",
|
|
6186
6273
|
entryIDs: entryIDsArray,
|
|
6187
|
-
onlyEntries: true
|
|
6274
|
+
onlyEntries: true,
|
|
6275
|
+
batchSize: resolvedBatchSize
|
|
6188
6276
|
});
|
|
6189
6277
|
const target = createEntryEngineDataSource({
|
|
6190
6278
|
client,
|
|
6191
6279
|
state: "published",
|
|
6192
6280
|
entryIDs: entryIDsArray,
|
|
6193
|
-
onlyEntries: true
|
|
6281
|
+
onlyEntries: true,
|
|
6282
|
+
batchSize: resolvedBatchSize
|
|
6194
6283
|
});
|
|
6195
6284
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6196
6285
|
await syncEngine({
|
|
@@ -6228,22 +6317,25 @@ var EntryPullModule = {
|
|
|
6228
6317
|
withProjectOptions(
|
|
6229
6318
|
withStateOptions(
|
|
6230
6319
|
withDiffOptions(
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
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
|
+
)
|
|
6247
6339
|
)
|
|
6248
6340
|
)
|
|
6249
6341
|
)
|
|
@@ -6262,7 +6354,8 @@ var EntryPullModule = {
|
|
|
6262
6354
|
project: projectId,
|
|
6263
6355
|
diff: diffMode,
|
|
6264
6356
|
allowEmptySource,
|
|
6265
|
-
verbose
|
|
6357
|
+
verbose,
|
|
6358
|
+
resolvedBatchSize
|
|
6266
6359
|
}) => {
|
|
6267
6360
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6268
6361
|
const client = getContentClient({
|
|
@@ -6272,7 +6365,13 @@ var EntryPullModule = {
|
|
|
6272
6365
|
projectId
|
|
6273
6366
|
});
|
|
6274
6367
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6275
|
-
const source = createEntryEngineDataSource({
|
|
6368
|
+
const source = createEntryEngineDataSource({
|
|
6369
|
+
client,
|
|
6370
|
+
state,
|
|
6371
|
+
onlyEntries: true,
|
|
6372
|
+
verbose,
|
|
6373
|
+
batchSize: resolvedBatchSize
|
|
6374
|
+
});
|
|
6276
6375
|
let target;
|
|
6277
6376
|
const isPackage = isPathAPackageFile(directory);
|
|
6278
6377
|
if (isPackage) {
|
|
@@ -6334,16 +6433,19 @@ var EntryPushModule = {
|
|
|
6334
6433
|
withProjectOptions(
|
|
6335
6434
|
withStateOptions(
|
|
6336
6435
|
withDiffOptions(
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
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
|
+
)
|
|
6347
6449
|
)
|
|
6348
6450
|
)
|
|
6349
6451
|
)
|
|
@@ -6361,7 +6463,8 @@ var EntryPushModule = {
|
|
|
6361
6463
|
project: projectId,
|
|
6362
6464
|
diff: diffMode,
|
|
6363
6465
|
allowEmptySource,
|
|
6364
|
-
verbose
|
|
6466
|
+
verbose,
|
|
6467
|
+
resolvedBatchSize
|
|
6365
6468
|
}) => {
|
|
6366
6469
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6367
6470
|
const client = getContentClient({
|
|
@@ -6388,7 +6491,13 @@ var EntryPushModule = {
|
|
|
6388
6491
|
verbose
|
|
6389
6492
|
});
|
|
6390
6493
|
}
|
|
6391
|
-
const target = createEntryEngineDataSource({
|
|
6494
|
+
const target = createEntryEngineDataSource({
|
|
6495
|
+
client,
|
|
6496
|
+
state,
|
|
6497
|
+
onlyEntries: true,
|
|
6498
|
+
verbose,
|
|
6499
|
+
batchSize: resolvedBatchSize
|
|
6500
|
+
});
|
|
6392
6501
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6393
6502
|
const uniformLocales = await fetchUniformLocales({
|
|
6394
6503
|
apiKey,
|
|
@@ -6482,24 +6591,37 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
6482
6591
|
var EntryUnpublishModule = {
|
|
6483
6592
|
command: "unpublish [ids]",
|
|
6484
6593
|
describe: "Unpublish an entry(ies)",
|
|
6485
|
-
builder: (yargs43) => withConfiguration(
|
|
6486
|
-
withDebugOptions(
|
|
6487
|
-
withApiOptions(
|
|
6488
|
-
withProjectOptions(
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
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
|
+
)
|
|
6498
6610
|
)
|
|
6499
6611
|
)
|
|
6500
6612
|
)
|
|
6501
6613
|
),
|
|
6502
|
-
handler: async ({
|
|
6614
|
+
handler: async ({
|
|
6615
|
+
apiHost,
|
|
6616
|
+
apiKey,
|
|
6617
|
+
proxy,
|
|
6618
|
+
ids,
|
|
6619
|
+
all,
|
|
6620
|
+
project: projectId,
|
|
6621
|
+
whatIf,
|
|
6622
|
+
verbose,
|
|
6623
|
+
resolvedBatchSize
|
|
6624
|
+
}) => {
|
|
6503
6625
|
if (!all && !ids || all && ids) {
|
|
6504
6626
|
console.error(`Specify --all or entry ID(s) to unpublish.`);
|
|
6505
6627
|
process.exit(1);
|
|
@@ -6512,13 +6634,15 @@ var EntryUnpublishModule = {
|
|
|
6512
6634
|
client,
|
|
6513
6635
|
state: "published",
|
|
6514
6636
|
entryIDs: entryIDsArray,
|
|
6515
|
-
onlyEntries: true
|
|
6637
|
+
onlyEntries: true,
|
|
6638
|
+
batchSize: resolvedBatchSize
|
|
6516
6639
|
});
|
|
6517
6640
|
const target = createEntryEngineDataSource({
|
|
6518
6641
|
client,
|
|
6519
6642
|
state: "preview",
|
|
6520
6643
|
entryIDs: entryIDsArray,
|
|
6521
|
-
onlyEntries: true
|
|
6644
|
+
onlyEntries: true,
|
|
6645
|
+
batchSize: resolvedBatchSize
|
|
6522
6646
|
});
|
|
6523
6647
|
const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
|
|
6524
6648
|
for await (const obj of target.objects) {
|
|
@@ -6736,15 +6860,18 @@ var EntryPatternPublishModule = {
|
|
|
6736
6860
|
withApiOptions(
|
|
6737
6861
|
withProjectOptions(
|
|
6738
6862
|
withDiffOptions(
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
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
|
+
)
|
|
6748
6875
|
)
|
|
6749
6876
|
)
|
|
6750
6877
|
)
|
|
@@ -6760,7 +6887,8 @@ var EntryPatternPublishModule = {
|
|
|
6760
6887
|
whatIf,
|
|
6761
6888
|
project: projectId,
|
|
6762
6889
|
verbose,
|
|
6763
|
-
directory
|
|
6890
|
+
directory,
|
|
6891
|
+
resolvedBatchSize
|
|
6764
6892
|
}) => {
|
|
6765
6893
|
if (!all && !ids || all && ids) {
|
|
6766
6894
|
console.error(`Specify --all or entry pattern ID(s) to publish.`);
|
|
@@ -6773,13 +6901,15 @@ var EntryPatternPublishModule = {
|
|
|
6773
6901
|
client,
|
|
6774
6902
|
state: "preview",
|
|
6775
6903
|
entryIDs: entryIDsArray,
|
|
6776
|
-
onlyPatterns: true
|
|
6904
|
+
onlyPatterns: true,
|
|
6905
|
+
batchSize: resolvedBatchSize
|
|
6777
6906
|
});
|
|
6778
6907
|
const target = createEntryEngineDataSource({
|
|
6779
6908
|
client,
|
|
6780
6909
|
state: "published",
|
|
6781
6910
|
entryIDs: entryIDsArray,
|
|
6782
|
-
onlyPatterns: true
|
|
6911
|
+
onlyPatterns: true,
|
|
6912
|
+
batchSize: resolvedBatchSize
|
|
6783
6913
|
});
|
|
6784
6914
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6785
6915
|
await syncEngine({
|
|
@@ -6817,22 +6947,25 @@ var EntryPatternPullModule = {
|
|
|
6817
6947
|
withProjectOptions(
|
|
6818
6948
|
withStateOptions(
|
|
6819
6949
|
withDiffOptions(
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
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
|
+
)
|
|
6836
6969
|
)
|
|
6837
6970
|
)
|
|
6838
6971
|
)
|
|
@@ -6851,7 +6984,8 @@ var EntryPatternPullModule = {
|
|
|
6851
6984
|
project: projectId,
|
|
6852
6985
|
diff: diffMode,
|
|
6853
6986
|
allowEmptySource,
|
|
6854
|
-
verbose
|
|
6987
|
+
verbose,
|
|
6988
|
+
resolvedBatchSize
|
|
6855
6989
|
}) => {
|
|
6856
6990
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6857
6991
|
const client = getContentClient({
|
|
@@ -6861,7 +6995,13 @@ var EntryPatternPullModule = {
|
|
|
6861
6995
|
projectId
|
|
6862
6996
|
});
|
|
6863
6997
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6864
|
-
const source = createEntryEngineDataSource({
|
|
6998
|
+
const source = createEntryEngineDataSource({
|
|
6999
|
+
client,
|
|
7000
|
+
state,
|
|
7001
|
+
onlyPatterns: true,
|
|
7002
|
+
verbose,
|
|
7003
|
+
batchSize: resolvedBatchSize
|
|
7004
|
+
});
|
|
6865
7005
|
let target;
|
|
6866
7006
|
const isPackage = isPathAPackageFile(directory);
|
|
6867
7007
|
if (isPackage) {
|
|
@@ -6923,21 +7063,24 @@ var EntryPatternPushModule = {
|
|
|
6923
7063
|
withProjectOptions(
|
|
6924
7064
|
withStateOptions(
|
|
6925
7065
|
withDiffOptions(
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
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
|
+
)
|
|
6941
7084
|
)
|
|
6942
7085
|
)
|
|
6943
7086
|
)
|
|
@@ -6955,7 +7098,8 @@ var EntryPatternPushModule = {
|
|
|
6955
7098
|
project: projectId,
|
|
6956
7099
|
diff: diffMode,
|
|
6957
7100
|
allowEmptySource,
|
|
6958
|
-
verbose
|
|
7101
|
+
verbose,
|
|
7102
|
+
resolvedBatchSize
|
|
6959
7103
|
}) => {
|
|
6960
7104
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6961
7105
|
const client = getContentClient({
|
|
@@ -6982,7 +7126,13 @@ var EntryPatternPushModule = {
|
|
|
6982
7126
|
verbose
|
|
6983
7127
|
});
|
|
6984
7128
|
}
|
|
6985
|
-
const target = createEntryEngineDataSource({
|
|
7129
|
+
const target = createEntryEngineDataSource({
|
|
7130
|
+
client,
|
|
7131
|
+
state,
|
|
7132
|
+
onlyPatterns: true,
|
|
7133
|
+
verbose,
|
|
7134
|
+
batchSize: resolvedBatchSize
|
|
7135
|
+
});
|
|
6986
7136
|
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6987
7137
|
const uniformLocales = await fetchUniformLocales({
|
|
6988
7138
|
apiKey,
|
|
@@ -7049,20 +7199,33 @@ var EntryPatternUnpublishModule = {
|
|
|
7049
7199
|
withDebugOptions(
|
|
7050
7200
|
withApiOptions(
|
|
7051
7201
|
withProjectOptions(
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
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
|
+
)
|
|
7061
7214
|
)
|
|
7062
7215
|
)
|
|
7063
7216
|
)
|
|
7064
7217
|
),
|
|
7065
|
-
handler: async ({
|
|
7218
|
+
handler: async ({
|
|
7219
|
+
apiHost,
|
|
7220
|
+
apiKey,
|
|
7221
|
+
proxy,
|
|
7222
|
+
ids,
|
|
7223
|
+
all,
|
|
7224
|
+
project: projectId,
|
|
7225
|
+
whatIf,
|
|
7226
|
+
verbose,
|
|
7227
|
+
resolvedBatchSize
|
|
7228
|
+
}) => {
|
|
7066
7229
|
if (!all && !ids || all && ids) {
|
|
7067
7230
|
console.error(`Specify --all or entry pattern ID(s) to unpublish.`);
|
|
7068
7231
|
process.exit(1);
|
|
@@ -7075,13 +7238,15 @@ var EntryPatternUnpublishModule = {
|
|
|
7075
7238
|
client,
|
|
7076
7239
|
state: "published",
|
|
7077
7240
|
entryIDs: entryIDsArray,
|
|
7078
|
-
onlyPatterns: true
|
|
7241
|
+
onlyPatterns: true,
|
|
7242
|
+
batchSize: resolvedBatchSize
|
|
7079
7243
|
});
|
|
7080
7244
|
const target = createEntryEngineDataSource({
|
|
7081
7245
|
client,
|
|
7082
7246
|
state: "preview",
|
|
7083
7247
|
entryIDs: entryIDsArray,
|
|
7084
|
-
onlyPatterns: true
|
|
7248
|
+
onlyPatterns: true,
|
|
7249
|
+
batchSize: resolvedBatchSize
|
|
7085
7250
|
});
|
|
7086
7251
|
const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
|
|
7087
7252
|
for await (const obj of target.objects) {
|
|
@@ -7167,12 +7332,14 @@ function normalizeLabelForSync(label) {
|
|
|
7167
7332
|
return labelWithoutProjectId;
|
|
7168
7333
|
}
|
|
7169
7334
|
function createLabelsEngineDataSource({
|
|
7170
|
-
client
|
|
7335
|
+
client,
|
|
7336
|
+
batchSize,
|
|
7337
|
+
verbose
|
|
7171
7338
|
}) {
|
|
7172
7339
|
async function* getObjects() {
|
|
7173
7340
|
const labels = paginateAsync(
|
|
7174
7341
|
async (offset, limit2) => (await client.getLabels({ offset, limit: limit2 })).labels,
|
|
7175
|
-
{ pageSize: 100 }
|
|
7342
|
+
{ pageSize: batchSize ?? 100, verbose, entityName: "labels" }
|
|
7176
7343
|
);
|
|
7177
7344
|
for await (const label of labels) {
|
|
7178
7345
|
const result = {
|
|
@@ -7213,22 +7380,25 @@ var LabelPullModule = {
|
|
|
7213
7380
|
withApiOptions(
|
|
7214
7381
|
withProjectOptions(
|
|
7215
7382
|
withDiffOptions(
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
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
|
+
)
|
|
7232
7402
|
)
|
|
7233
7403
|
)
|
|
7234
7404
|
)
|
|
@@ -7245,11 +7415,16 @@ var LabelPullModule = {
|
|
|
7245
7415
|
project: projectId,
|
|
7246
7416
|
diff: diffMode,
|
|
7247
7417
|
allowEmptySource,
|
|
7248
|
-
verbose
|
|
7418
|
+
verbose,
|
|
7419
|
+
resolvedBatchSize
|
|
7249
7420
|
}) => {
|
|
7250
7421
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7251
7422
|
const client = getLabelClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
7252
|
-
const source = createLabelsEngineDataSource({
|
|
7423
|
+
const source = createLabelsEngineDataSource({
|
|
7424
|
+
client,
|
|
7425
|
+
verbose,
|
|
7426
|
+
batchSize: resolvedBatchSize
|
|
7427
|
+
});
|
|
7253
7428
|
let target;
|
|
7254
7429
|
const isPackage = isPathAPackageFile(directory);
|
|
7255
7430
|
if (isPackage) {
|
|
@@ -7300,16 +7475,19 @@ var LabelPushModule = {
|
|
|
7300
7475
|
withApiOptions(
|
|
7301
7476
|
withProjectOptions(
|
|
7302
7477
|
withDiffOptions(
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
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
|
+
)
|
|
7313
7491
|
)
|
|
7314
7492
|
)
|
|
7315
7493
|
)
|
|
@@ -7325,7 +7503,8 @@ var LabelPushModule = {
|
|
|
7325
7503
|
project: projectId,
|
|
7326
7504
|
diff: diffMode,
|
|
7327
7505
|
allowEmptySource,
|
|
7328
|
-
verbose
|
|
7506
|
+
verbose,
|
|
7507
|
+
resolvedBatchSize
|
|
7329
7508
|
}) => {
|
|
7330
7509
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7331
7510
|
const client = getLabelClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -7348,7 +7527,11 @@ var LabelPushModule = {
|
|
|
7348
7527
|
verbose
|
|
7349
7528
|
});
|
|
7350
7529
|
}
|
|
7351
|
-
const target = createLabelsEngineDataSource({
|
|
7530
|
+
const target = createLabelsEngineDataSource({
|
|
7531
|
+
client,
|
|
7532
|
+
verbose,
|
|
7533
|
+
batchSize: resolvedBatchSize
|
|
7534
|
+
});
|
|
7352
7535
|
const labelsFailedDueToMissingParent = /* @__PURE__ */ new Set();
|
|
7353
7536
|
const attemptSync = async () => {
|
|
7354
7537
|
const lastFailedLabelsCount = labelsFailedDueToMissingParent.size;
|
|
@@ -8493,11 +8676,15 @@ var getWorkflowClient = (options) => new WorkflowClient({ ...options, bypassCach
|
|
|
8493
8676
|
|
|
8494
8677
|
// src/commands/canvas/workflowEngineDataSource.ts
|
|
8495
8678
|
function createWorkflowEngineDataSource({
|
|
8496
|
-
client
|
|
8679
|
+
client,
|
|
8680
|
+
batchSize,
|
|
8681
|
+
verbose
|
|
8497
8682
|
}) {
|
|
8498
8683
|
async function* getObjects() {
|
|
8499
|
-
const workflows = paginateAsync(async () => (await client.get()).results, {
|
|
8500
|
-
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"
|
|
8501
8688
|
});
|
|
8502
8689
|
for await (const workflow of workflows) {
|
|
8503
8690
|
const { modified, modifiedBy, created, createdBy, ...workflowWithoutStatistics } = workflow;
|
|
@@ -8531,22 +8718,25 @@ var WorkflowPullModule = {
|
|
|
8531
8718
|
withDebugOptions(
|
|
8532
8719
|
withProjectOptions(
|
|
8533
8720
|
withDiffOptions(
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
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
|
+
)
|
|
8550
8740
|
)
|
|
8551
8741
|
)
|
|
8552
8742
|
)
|
|
@@ -8563,11 +8753,16 @@ var WorkflowPullModule = {
|
|
|
8563
8753
|
project: projectId,
|
|
8564
8754
|
diff: diffMode,
|
|
8565
8755
|
allowEmptySource,
|
|
8566
|
-
verbose
|
|
8756
|
+
verbose,
|
|
8757
|
+
resolvedBatchSize
|
|
8567
8758
|
}) => {
|
|
8568
8759
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
8569
8760
|
const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
8570
|
-
const source = createWorkflowEngineDataSource({
|
|
8761
|
+
const source = createWorkflowEngineDataSource({
|
|
8762
|
+
client,
|
|
8763
|
+
verbose,
|
|
8764
|
+
batchSize: resolvedBatchSize
|
|
8765
|
+
});
|
|
8571
8766
|
let target;
|
|
8572
8767
|
const isPackage = isPathAPackageFile(directory);
|
|
8573
8768
|
if (isPackage) {
|
|
@@ -8611,16 +8806,19 @@ var WorkflowPushModule = {
|
|
|
8611
8806
|
withApiOptions(
|
|
8612
8807
|
withProjectOptions(
|
|
8613
8808
|
withDiffOptions(
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
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
|
+
)
|
|
8624
8822
|
)
|
|
8625
8823
|
)
|
|
8626
8824
|
)
|
|
@@ -8636,7 +8834,8 @@ var WorkflowPushModule = {
|
|
|
8636
8834
|
project: projectId,
|
|
8637
8835
|
diff: diffMode,
|
|
8638
8836
|
allowEmptySource,
|
|
8639
|
-
verbose
|
|
8837
|
+
verbose,
|
|
8838
|
+
resolvedBatchSize
|
|
8640
8839
|
}) => {
|
|
8641
8840
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
8642
8841
|
const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8658,7 +8857,11 @@ var WorkflowPushModule = {
|
|
|
8658
8857
|
verbose
|
|
8659
8858
|
});
|
|
8660
8859
|
}
|
|
8661
|
-
const target = createWorkflowEngineDataSource({
|
|
8860
|
+
const target = createWorkflowEngineDataSource({
|
|
8861
|
+
client,
|
|
8862
|
+
verbose,
|
|
8863
|
+
batchSize: resolvedBatchSize
|
|
8864
|
+
});
|
|
8662
8865
|
await syncEngine({
|
|
8663
8866
|
source,
|
|
8664
8867
|
target,
|
|
@@ -13014,7 +13217,8 @@ var SyncPullModule = {
|
|
|
13014
13217
|
patternType: entityType === "compositionPattern" ? "composition" : entityType === "componentPattern" ? "component" : void 0,
|
|
13015
13218
|
mode: getPullMode(entityType, config2),
|
|
13016
13219
|
directory: getPullFilename(entityType, config2),
|
|
13017
|
-
allowEmptySource: config2.allowEmptySource
|
|
13220
|
+
allowEmptySource: config2.allowEmptySource,
|
|
13221
|
+
...isPaginatedSyncEntity(entityType) ? { resolvedBatchSize: getEntityBatchSize(entityType, config2) } : {}
|
|
13018
13222
|
}),
|
|
13019
13223
|
{
|
|
13020
13224
|
text: `${entityType}\u2026`,
|
|
@@ -13179,7 +13383,8 @@ var SyncPushModule = {
|
|
|
13179
13383
|
patternType: entityType === "compositionPattern" ? "composition" : entityType === "componentPattern" ? "component" : void 0,
|
|
13180
13384
|
mode: getPushMode(entityType, config2),
|
|
13181
13385
|
directory: getPushFilename(entityType, config2),
|
|
13182
|
-
allowEmptySource: config2.allowEmptySource
|
|
13386
|
+
allowEmptySource: config2.allowEmptySource,
|
|
13387
|
+
...isPaginatedSyncEntity(entityType) ? { resolvedBatchSize: getEntityBatchSize(entityType, config2) } : {}
|
|
13183
13388
|
}),
|
|
13184
13389
|
{
|
|
13185
13390
|
text: `${entityType}...`,
|
|
@@ -13200,10 +13405,12 @@ var SyncPushModule = {
|
|
|
13200
13405
|
await spinPromise(
|
|
13201
13406
|
ComponentPatternPublishModule.handler({
|
|
13202
13407
|
...otherParams,
|
|
13408
|
+
serialization: config2,
|
|
13203
13409
|
patternType: "component",
|
|
13204
13410
|
onlyPatterns: true,
|
|
13205
13411
|
all: true,
|
|
13206
|
-
directory: getPushFilename("componentPattern", config2)
|
|
13412
|
+
directory: getPushFilename("componentPattern", config2),
|
|
13413
|
+
resolvedBatchSize: getEntityBatchSize("componentPattern", config2)
|
|
13207
13414
|
}),
|
|
13208
13415
|
{
|
|
13209
13416
|
text: "publishing component patterns...",
|
|
@@ -13224,10 +13431,12 @@ var SyncPushModule = {
|
|
|
13224
13431
|
await spinPromise(
|
|
13225
13432
|
CompositionPatternPublishModule.handler({
|
|
13226
13433
|
...otherParams,
|
|
13434
|
+
serialization: config2,
|
|
13227
13435
|
all: true,
|
|
13228
13436
|
onlyPatterns: true,
|
|
13229
13437
|
patternType: "composition",
|
|
13230
|
-
directory: getPushFilename("compositionPattern", config2)
|
|
13438
|
+
directory: getPushFilename("compositionPattern", config2),
|
|
13439
|
+
resolvedBatchSize: getEntityBatchSize("compositionPattern", config2)
|
|
13231
13440
|
}),
|
|
13232
13441
|
{
|
|
13233
13442
|
text: "publishing composition patterns...",
|
|
@@ -13248,9 +13457,11 @@ var SyncPushModule = {
|
|
|
13248
13457
|
await spinPromise(
|
|
13249
13458
|
CompositionPublishModule.handler({
|
|
13250
13459
|
...otherParams,
|
|
13460
|
+
serialization: config2,
|
|
13251
13461
|
all: true,
|
|
13252
13462
|
onlyCompositions: true,
|
|
13253
|
-
directory: getPushFilename("composition", config2)
|
|
13463
|
+
directory: getPushFilename("composition", config2),
|
|
13464
|
+
resolvedBatchSize: getEntityBatchSize("composition", config2)
|
|
13254
13465
|
}),
|
|
13255
13466
|
{
|
|
13256
13467
|
text: "publishing compositions...",
|
|
@@ -13271,8 +13482,10 @@ var SyncPushModule = {
|
|
|
13271
13482
|
await spinPromise(
|
|
13272
13483
|
EntryPublishModule.handler({
|
|
13273
13484
|
...otherParams,
|
|
13485
|
+
serialization: config2,
|
|
13274
13486
|
all: true,
|
|
13275
|
-
directory: getPushFilename("entry", config2)
|
|
13487
|
+
directory: getPushFilename("entry", config2),
|
|
13488
|
+
resolvedBatchSize: getEntityBatchSize("entry", config2)
|
|
13276
13489
|
}),
|
|
13277
13490
|
{
|
|
13278
13491
|
text: "publishing entries...",
|
|
@@ -13293,8 +13506,10 @@ var SyncPushModule = {
|
|
|
13293
13506
|
await spinPromise(
|
|
13294
13507
|
EntryPatternPublishModule.handler({
|
|
13295
13508
|
...otherParams,
|
|
13509
|
+
serialization: config2,
|
|
13296
13510
|
all: true,
|
|
13297
|
-
directory: getPushFilename("entryPattern", config2)
|
|
13511
|
+
directory: getPushFilename("entryPattern", config2),
|
|
13512
|
+
resolvedBatchSize: getEntityBatchSize("entryPattern", config2)
|
|
13298
13513
|
}),
|
|
13299
13514
|
{
|
|
13300
13515
|
text: "publishing entry patterns...",
|