@contentstack/cli-cm-bulk-publish 1.3.15 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/package.json +3 -3
- package/src/producer/cross-publish.js +17 -8
- package/src/producer/unpublish.js +39 -9
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
|
|
|
18
18
|
$ csdx COMMAND
|
|
19
19
|
running command...
|
|
20
20
|
$ csdx (--version)
|
|
21
|
-
@contentstack/cli-cm-bulk-publish/1.
|
|
21
|
+
@contentstack/cli-cm-bulk-publish/1.4.0 darwin-arm64 node-v20.8.0
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-bulk-publish",
|
|
3
3
|
"description": "Contentstack CLI plugin for bulk publish actions",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@contentstack/cli-command": "~1.2.16",
|
|
9
|
-
"@contentstack/cli-utilities": "~1.5.
|
|
9
|
+
"@contentstack/cli-utilities": "~1.5.10",
|
|
10
10
|
"bluebird": "^3.7.2",
|
|
11
11
|
"chalk": "^4.1.2",
|
|
12
12
|
"dotenv": "^16.1.4",
|
|
@@ -99,4 +99,4 @@
|
|
|
99
99
|
"version": "oclif readme && git add README.md",
|
|
100
100
|
"clean": "rm -rf ./node_modules tsconfig.build.tsbuildinfo"
|
|
101
101
|
}
|
|
102
|
-
}
|
|
102
|
+
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* eslint-disable camelcase */
|
|
4
4
|
/* eslint-disable complexity */
|
|
5
5
|
/* eslint-disable max-params */
|
|
6
|
+
const { configHandler } = require('@contentstack/cli-utilities');
|
|
6
7
|
const { getQueue } = require('../util/queue');
|
|
7
8
|
const defaults = require('../config/defaults.json');
|
|
8
9
|
const { performBulkPublish, publishEntry, publishAsset, initializeLogger } = require('../consumer/publish');
|
|
@@ -62,7 +63,7 @@ async function bulkAction(stack, items, bulkPublish, filter, destEnv, apiVersion
|
|
|
62
63
|
locale: filter.locale,
|
|
63
64
|
environments: destEnv,
|
|
64
65
|
stack: stack,
|
|
65
|
-
apiVersion
|
|
66
|
+
apiVersion,
|
|
66
67
|
});
|
|
67
68
|
bulkPublishAssetSet = [];
|
|
68
69
|
}
|
|
@@ -74,7 +75,7 @@ async function bulkAction(stack, items, bulkPublish, filter, destEnv, apiVersion
|
|
|
74
75
|
Type: 'entry',
|
|
75
76
|
environments: destEnv,
|
|
76
77
|
stack: stack,
|
|
77
|
-
apiVersion
|
|
78
|
+
apiVersion,
|
|
78
79
|
});
|
|
79
80
|
bulkPublishSet = [];
|
|
80
81
|
}
|
|
@@ -86,7 +87,7 @@ async function bulkAction(stack, items, bulkPublish, filter, destEnv, apiVersion
|
|
|
86
87
|
locale: filter.locale,
|
|
87
88
|
environments: destEnv,
|
|
88
89
|
stack: stack,
|
|
89
|
-
apiVersion
|
|
90
|
+
apiVersion,
|
|
90
91
|
});
|
|
91
92
|
bulkPublishAssetSet = [];
|
|
92
93
|
}
|
|
@@ -98,7 +99,7 @@ async function bulkAction(stack, items, bulkPublish, filter, destEnv, apiVersion
|
|
|
98
99
|
Type: 'entry',
|
|
99
100
|
environments: destEnv,
|
|
100
101
|
stack: stack,
|
|
101
|
-
apiVersion
|
|
102
|
+
apiVersion,
|
|
102
103
|
});
|
|
103
104
|
bulkPublishSet = [];
|
|
104
105
|
}
|
|
@@ -156,13 +157,21 @@ async function getSyncEntries(
|
|
|
156
157
|
queryParamsObj[decodeURIComponent(split[0])] = decodeURIComponent(split[1]);
|
|
157
158
|
}
|
|
158
159
|
|
|
159
|
-
const
|
|
160
|
+
const deliveryAPIOptions = {
|
|
160
161
|
api_key: tokenDetails.apiKey,
|
|
161
162
|
delivery_token: deliveryToken,
|
|
162
163
|
environment: queryParamsObj.environment,
|
|
163
164
|
branch: config.branch,
|
|
164
|
-
}
|
|
165
|
-
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const earlyAccessHeaders = configHandler.get(`earlyAccessHeaders`);
|
|
168
|
+
if (earlyAccessHeaders && Object.keys(earlyAccessHeaders).length > 0) {
|
|
169
|
+
deliveryAPIOptions.early_access = Object.values(earlyAccessHeaders);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const Stack = new command.deliveryAPIClient.Stack(deliveryAPIOptions);
|
|
173
|
+
|
|
174
|
+
Stack.setHost(config.cda);
|
|
166
175
|
|
|
167
176
|
const syncData = {};
|
|
168
177
|
|
|
@@ -236,7 +245,7 @@ async function start(
|
|
|
236
245
|
onlyEntries,
|
|
237
246
|
destEnv,
|
|
238
247
|
f_types,
|
|
239
|
-
apiVersion
|
|
248
|
+
apiVersion,
|
|
240
249
|
},
|
|
241
250
|
stack,
|
|
242
251
|
config,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* eslint-disable complexity */
|
|
4
4
|
/* eslint-disable no-console */
|
|
5
5
|
/* eslint-disable camelcase */
|
|
6
|
+
const { configHandler } = require('@contentstack/cli-utilities');
|
|
6
7
|
const { getQueue } = require('../util/queue');
|
|
7
8
|
const defaults = require('../config/defaults.json');
|
|
8
9
|
const { performBulkUnPublish, UnpublishEntry, UnpublishAsset, initializeLogger } = require('../consumer/publish');
|
|
@@ -79,7 +80,7 @@ function bulkAction(stack, items, bulkUnpublish, environment, locale, apiVersion
|
|
|
79
80
|
locale: locale,
|
|
80
81
|
environments: [environment],
|
|
81
82
|
stack: stack,
|
|
82
|
-
apiVersion
|
|
83
|
+
apiVersion,
|
|
83
84
|
});
|
|
84
85
|
bulkUnPulishAssetSet = [];
|
|
85
86
|
}
|
|
@@ -91,7 +92,7 @@ function bulkAction(stack, items, bulkUnpublish, environment, locale, apiVersion
|
|
|
91
92
|
Type: 'entry',
|
|
92
93
|
environments: [environment],
|
|
93
94
|
stack: stack,
|
|
94
|
-
apiVersion
|
|
95
|
+
apiVersion,
|
|
95
96
|
});
|
|
96
97
|
bulkUnPublishSet = [];
|
|
97
98
|
}
|
|
@@ -102,7 +103,7 @@ function bulkAction(stack, items, bulkUnpublish, environment, locale, apiVersion
|
|
|
102
103
|
locale: locale,
|
|
103
104
|
environments: [environment],
|
|
104
105
|
stack: stack,
|
|
105
|
-
apiVersion
|
|
106
|
+
apiVersion,
|
|
106
107
|
});
|
|
107
108
|
bulkUnPulishAssetSet = [];
|
|
108
109
|
}
|
|
@@ -114,7 +115,7 @@ function bulkAction(stack, items, bulkUnpublish, environment, locale, apiVersion
|
|
|
114
115
|
Type: 'entry',
|
|
115
116
|
environments: [environment],
|
|
116
117
|
stack: stack,
|
|
117
|
-
apiVersion
|
|
118
|
+
apiVersion,
|
|
118
119
|
});
|
|
119
120
|
bulkUnPublishSet = [];
|
|
120
121
|
}
|
|
@@ -171,13 +172,21 @@ async function getSyncEntries(
|
|
|
171
172
|
queryParamsObj[decodeURIComponent(split[0])] = decodeURIComponent(split[1]);
|
|
172
173
|
}
|
|
173
174
|
|
|
174
|
-
const
|
|
175
|
+
const deliveryAPIOptions = {
|
|
175
176
|
api_key: tokenDetails.apiKey,
|
|
176
177
|
delivery_token: deliveryToken,
|
|
177
178
|
environment: queryParamsObj.environment,
|
|
178
179
|
branch: config.branch,
|
|
179
|
-
}
|
|
180
|
-
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const earlyAccessHeaders = configHandler.get(`earlyAccessHeaders`);
|
|
183
|
+
if (earlyAccessHeaders && Object.keys(earlyAccessHeaders).length > 0) {
|
|
184
|
+
deliveryAPIOptions.early_access = Object.values(earlyAccessHeaders);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const Stack = new command.deliveryAPIClient.Stack(deliveryAPIOptions);
|
|
188
|
+
|
|
189
|
+
Stack.setHost(config.cda);
|
|
181
190
|
|
|
182
191
|
const syncData = {};
|
|
183
192
|
|
|
@@ -203,7 +212,17 @@ async function getSyncEntries(
|
|
|
203
212
|
return resolve();
|
|
204
213
|
}
|
|
205
214
|
setTimeout(async () => {
|
|
206
|
-
await getSyncEntries(
|
|
215
|
+
await getSyncEntries(
|
|
216
|
+
stack,
|
|
217
|
+
config,
|
|
218
|
+
locale,
|
|
219
|
+
queryParams,
|
|
220
|
+
bulkUnpublish,
|
|
221
|
+
environment,
|
|
222
|
+
deliveryToken,
|
|
223
|
+
apiVersion,
|
|
224
|
+
null,
|
|
225
|
+
);
|
|
207
226
|
}, 3000);
|
|
208
227
|
} catch (error) {
|
|
209
228
|
reject(error);
|
|
@@ -212,7 +231,18 @@ async function getSyncEntries(
|
|
|
212
231
|
}
|
|
213
232
|
|
|
214
233
|
async function start(
|
|
215
|
-
{
|
|
234
|
+
{
|
|
235
|
+
retryFailed,
|
|
236
|
+
bulkUnpublish,
|
|
237
|
+
contentType,
|
|
238
|
+
locale,
|
|
239
|
+
environment,
|
|
240
|
+
deliveryToken,
|
|
241
|
+
onlyAssets,
|
|
242
|
+
onlyEntries,
|
|
243
|
+
f_types,
|
|
244
|
+
apiVersion,
|
|
245
|
+
},
|
|
216
246
|
stack,
|
|
217
247
|
config,
|
|
218
248
|
) {
|