@contentstack/cli-cm-export-to-csv 2.0.0-beta.2 → 2.0.0-beta.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/lib/utils/interactive.d.ts +4 -0
- package/lib/utils/interactive.js +153 -233
- package/oclif.manifest.json +1 -1
- package/package.json +5 -7
|
@@ -25,6 +25,10 @@ export declare function chooseBranch(branchList: Branch[]): Promise<BranchChoice
|
|
|
25
25
|
export declare function chooseContentType(stackAPIClient: StackClient, skip: number): Promise<string[]>;
|
|
26
26
|
/**
|
|
27
27
|
* Prompt user to choose content types (searchable multi-select).
|
|
28
|
+
*
|
|
29
|
+
* Note: inquirer-checkbox-plus-prompt is incompatible with inquirer v9+
|
|
30
|
+
* (registerPrompt was removed). Replaced with checkbox() from @inquirer/prompts
|
|
31
|
+
* which has built-in real-time filtering — users type to search, Space to select.
|
|
28
32
|
*/
|
|
29
33
|
export declare function chooseInMemContentTypes(contentTypesList: string[]): Promise<string[]>;
|
|
30
34
|
/**
|
package/lib/utils/interactive.js
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
* Interactive prompt utilities.
|
|
4
4
|
* Migrated from: packages/contentstack-export-to-csv/src/util/index.js
|
|
5
5
|
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
6
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
40
|
exports.startupQuestions = startupQuestions;
|
|
8
41
|
exports.chooseOrganization = chooseOrganization;
|
|
@@ -13,41 +46,31 @@ exports.chooseInMemContentTypes = chooseInMemContentTypes;
|
|
|
13
46
|
exports.chooseLanguage = chooseLanguage;
|
|
14
47
|
exports.chooseFallbackOptions = chooseFallbackOptions;
|
|
15
48
|
exports.promptContinueExport = promptContinueExport;
|
|
16
|
-
const
|
|
17
|
-
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
18
|
-
// @ts-ignore - no types available
|
|
19
|
-
const inquirer_checkbox_plus_prompt_1 = tslib_1.__importDefault(require("inquirer-checkbox-plus-prompt"));
|
|
49
|
+
const prompts_1 = require("@inquirer/prompts");
|
|
20
50
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
21
51
|
const messages_1 = require("../messages");
|
|
22
52
|
const error_handler_1 = require("./error-handler");
|
|
23
53
|
const api_client_1 = require("./api-client");
|
|
24
|
-
// Register checkbox-plus prompt type
|
|
25
|
-
inquirer_1.default.registerPrompt('checkbox-plus', inquirer_checkbox_plus_prompt_1.default);
|
|
26
54
|
// ============================================================================
|
|
27
55
|
// Startup Questions
|
|
28
56
|
// ============================================================================
|
|
29
57
|
/**
|
|
30
58
|
* Display startup questions to choose an action.
|
|
31
59
|
*/
|
|
32
|
-
function startupQuestions() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
]
|
|
42
|
-
inquirer_1.default
|
|
43
|
-
.prompt(actions)
|
|
44
|
-
.then((answers) => {
|
|
45
|
-
if (answers.action === 'Exit')
|
|
46
|
-
(0, error_handler_1.exitProgram)();
|
|
47
|
-
resolve(answers.action);
|
|
48
|
-
})
|
|
49
|
-
.catch(reject);
|
|
60
|
+
async function startupQuestions() {
|
|
61
|
+
const action = await (0, prompts_1.select)({
|
|
62
|
+
message: 'Choose Action',
|
|
63
|
+
choices: [
|
|
64
|
+
{ value: messages_1.messages.ACTION_EXPORT_ENTRIES },
|
|
65
|
+
{ value: messages_1.messages.ACTION_EXPORT_USERS },
|
|
66
|
+
{ value: messages_1.messages.ACTION_EXPORT_TEAMS },
|
|
67
|
+
{ value: messages_1.messages.ACTION_EXPORT_TAXONOMIES },
|
|
68
|
+
{ value: 'Exit' },
|
|
69
|
+
],
|
|
50
70
|
});
|
|
71
|
+
if (action === 'Exit')
|
|
72
|
+
(0, error_handler_1.exitProgram)();
|
|
73
|
+
return action;
|
|
51
74
|
}
|
|
52
75
|
// ============================================================================
|
|
53
76
|
// Organization Prompts
|
|
@@ -55,41 +78,26 @@ function startupQuestions() {
|
|
|
55
78
|
/**
|
|
56
79
|
* Prompt user to choose an organization.
|
|
57
80
|
*/
|
|
58
|
-
function chooseOrganization(managementAPIClient, action) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
message: 'Choose an Organization',
|
|
75
|
-
choices: orgList,
|
|
76
|
-
loop: false,
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
inquirer_1.default
|
|
80
|
-
.prompt(_chooseOrganization)
|
|
81
|
-
.then((answers) => {
|
|
82
|
-
const chosenOrg = answers.chosenOrg;
|
|
83
|
-
if (chosenOrg === messages_1.messages.ACTION_CANCEL)
|
|
84
|
-
(0, error_handler_1.exitProgram)();
|
|
85
|
-
resolve({ name: chosenOrg, uid: organizations[chosenOrg] });
|
|
86
|
-
})
|
|
87
|
-
.catch(reject);
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
reject(error);
|
|
91
|
-
}
|
|
81
|
+
async function chooseOrganization(managementAPIClient, action) {
|
|
82
|
+
let organizations;
|
|
83
|
+
if (action === messages_1.messages.ACTION_EXPORT_USERS || action === messages_1.messages.ACTION_EXPORT_TEAMS || action === 'teams') {
|
|
84
|
+
organizations = await (0, api_client_1.getOrganizationsWhereUserIsAdmin)(managementAPIClient);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
organizations = await (0, api_client_1.getOrganizations)(managementAPIClient);
|
|
88
|
+
}
|
|
89
|
+
const choices = [
|
|
90
|
+
...Object.keys(organizations).map((name) => ({ value: name })),
|
|
91
|
+
{ value: messages_1.messages.ACTION_CANCEL },
|
|
92
|
+
];
|
|
93
|
+
const chosenOrg = await (0, prompts_1.select)({
|
|
94
|
+
message: 'Choose an Organization',
|
|
95
|
+
choices,
|
|
96
|
+
loop: false,
|
|
92
97
|
});
|
|
98
|
+
if (chosenOrg === messages_1.messages.ACTION_CANCEL)
|
|
99
|
+
(0, error_handler_1.exitProgram)();
|
|
100
|
+
return { name: chosenOrg, uid: organizations[chosenOrg] };
|
|
93
101
|
}
|
|
94
102
|
// ============================================================================
|
|
95
103
|
// Stack Prompts
|
|
@@ -97,44 +105,28 @@ function chooseOrganization(managementAPIClient, action) {
|
|
|
97
105
|
/**
|
|
98
106
|
* Prompt user to choose a stack.
|
|
99
107
|
*/
|
|
100
|
-
function chooseStack(managementAPIClient, orgUid, stackApiKey) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (stackName) {
|
|
107
|
-
resolve({ name: stackName, apiKey: stackApiKey });
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
throw new Error('Could not find stack');
|
|
111
|
-
}
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const stackList = Object.keys(stacks);
|
|
115
|
-
stackList.push(messages_1.messages.ACTION_CANCEL);
|
|
116
|
-
const _chooseStack = [
|
|
117
|
-
{
|
|
118
|
-
type: 'list',
|
|
119
|
-
name: 'chosenStack',
|
|
120
|
-
message: 'Choose a Stack',
|
|
121
|
-
choices: stackList,
|
|
122
|
-
},
|
|
123
|
-
];
|
|
124
|
-
inquirer_1.default
|
|
125
|
-
.prompt(_chooseStack)
|
|
126
|
-
.then((answers) => {
|
|
127
|
-
const chosenStack = answers.chosenStack;
|
|
128
|
-
if (chosenStack === messages_1.messages.ACTION_CANCEL)
|
|
129
|
-
(0, error_handler_1.exitProgram)();
|
|
130
|
-
resolve({ name: chosenStack, apiKey: stacks[chosenStack] });
|
|
131
|
-
})
|
|
132
|
-
.catch(reject);
|
|
108
|
+
async function chooseStack(managementAPIClient, orgUid, stackApiKey) {
|
|
109
|
+
const stacks = await (0, api_client_1.getStacks)(managementAPIClient, orgUid);
|
|
110
|
+
if (stackApiKey) {
|
|
111
|
+
const stackName = Object.keys(stacks).find((key) => stacks[key] === stackApiKey);
|
|
112
|
+
if (stackName) {
|
|
113
|
+
return { name: stackName, apiKey: stackApiKey };
|
|
133
114
|
}
|
|
134
|
-
|
|
135
|
-
|
|
115
|
+
else {
|
|
116
|
+
throw new Error('Could not find stack');
|
|
136
117
|
}
|
|
118
|
+
}
|
|
119
|
+
const choices = [
|
|
120
|
+
...Object.keys(stacks).map((name) => ({ value: name })),
|
|
121
|
+
{ value: messages_1.messages.ACTION_CANCEL },
|
|
122
|
+
];
|
|
123
|
+
const chosenStack = await (0, prompts_1.select)({
|
|
124
|
+
message: 'Choose a Stack',
|
|
125
|
+
choices,
|
|
137
126
|
});
|
|
127
|
+
if (chosenStack === messages_1.messages.ACTION_CANCEL)
|
|
128
|
+
(0, error_handler_1.exitProgram)();
|
|
129
|
+
return { name: chosenStack, apiKey: stacks[chosenStack] };
|
|
138
130
|
}
|
|
139
131
|
// ============================================================================
|
|
140
132
|
// Branch Prompts
|
|
@@ -144,17 +136,11 @@ function chooseStack(managementAPIClient, orgUid, stackApiKey) {
|
|
|
144
136
|
*/
|
|
145
137
|
async function chooseBranch(branchList) {
|
|
146
138
|
try {
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
message: 'Choose a Branch',
|
|
153
|
-
choices: branchesArray,
|
|
154
|
-
},
|
|
155
|
-
];
|
|
156
|
-
const answers = await inquirer_1.default.prompt(_chooseBranch);
|
|
157
|
-
return { branch: answers.branch };
|
|
139
|
+
const branch = await (0, prompts_1.select)({
|
|
140
|
+
message: 'Choose a Branch',
|
|
141
|
+
choices: branchList.map((b) => ({ value: b.uid })),
|
|
142
|
+
});
|
|
143
|
+
return { branch };
|
|
158
144
|
}
|
|
159
145
|
catch (err) {
|
|
160
146
|
cli_utilities_1.cliux.error(err);
|
|
@@ -167,71 +153,38 @@ async function chooseBranch(branchList) {
|
|
|
167
153
|
/**
|
|
168
154
|
* Prompt user to choose content types (basic checkbox).
|
|
169
155
|
*/
|
|
170
|
-
function chooseContentType(stackAPIClient, skip) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
message: 'Choose Content Type (Press Space to select the content types) ',
|
|
179
|
-
choices: contentTypesList,
|
|
180
|
-
name: 'chosenContentTypes',
|
|
181
|
-
loop: false,
|
|
182
|
-
},
|
|
183
|
-
];
|
|
184
|
-
inquirer_1.default
|
|
185
|
-
.prompt(_chooseContentType)
|
|
186
|
-
.then((answers) => resolve(answers.chosenContentTypes))
|
|
187
|
-
.catch(reject);
|
|
156
|
+
async function chooseContentType(stackAPIClient, skip) {
|
|
157
|
+
const { getContentTypes } = await Promise.resolve().then(() => __importStar(require('./api-client')));
|
|
158
|
+
const contentTypes = await getContentTypes(stackAPIClient, skip);
|
|
159
|
+
const contentTypesList = Object.values(contentTypes);
|
|
160
|
+
const chosenContentTypes = await (0, prompts_1.checkbox)({
|
|
161
|
+
message: 'Choose Content Type (Press Space to select the content types)',
|
|
162
|
+
choices: contentTypesList.map((ct) => ({ value: ct, name: ct })),
|
|
163
|
+
loop: false,
|
|
188
164
|
});
|
|
165
|
+
return chosenContentTypes;
|
|
189
166
|
}
|
|
190
167
|
/**
|
|
191
168
|
* Prompt user to choose content types (searchable multi-select).
|
|
169
|
+
*
|
|
170
|
+
* Note: inquirer-checkbox-plus-prompt is incompatible with inquirer v9+
|
|
171
|
+
* (registerPrompt was removed). Replaced with checkbox() from @inquirer/prompts
|
|
172
|
+
* which has built-in real-time filtering — users type to search, Space to select.
|
|
192
173
|
*/
|
|
193
|
-
function chooseInMemContentTypes(contentTypesList) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return shouldInclude;
|
|
208
|
-
});
|
|
209
|
-
resolveSource(contentTypes);
|
|
210
|
-
});
|
|
211
|
-
};
|
|
212
|
-
const _chooseContentType = [
|
|
213
|
-
{
|
|
214
|
-
type: 'checkbox-plus',
|
|
215
|
-
message: 'Choose Content Type (Press Space to select the content types)',
|
|
216
|
-
choices: contentTypesList,
|
|
217
|
-
name: 'chosenContentTypes',
|
|
218
|
-
loop: false,
|
|
219
|
-
highlight: true,
|
|
220
|
-
searchable: true,
|
|
221
|
-
source,
|
|
222
|
-
},
|
|
223
|
-
];
|
|
224
|
-
inquirer_1.default
|
|
225
|
-
.prompt(_chooseContentType)
|
|
226
|
-
.then((answers) => {
|
|
227
|
-
const chosenContentTypes = answers.chosenContentTypes;
|
|
228
|
-
if (chosenContentTypes.length === 0) {
|
|
229
|
-
reject('Please select atleast one content type.');
|
|
230
|
-
}
|
|
231
|
-
resolve(chosenContentTypes);
|
|
232
|
-
})
|
|
233
|
-
.catch(reject);
|
|
234
|
-
});
|
|
174
|
+
async function chooseInMemContentTypes(contentTypesList) {
|
|
175
|
+
let chosenContentTypes = [];
|
|
176
|
+
while (chosenContentTypes.length === 0) {
|
|
177
|
+
chosenContentTypes = await (0, prompts_1.checkbox)({
|
|
178
|
+
message: 'Choose Content Type (Type to filter, Space to select)',
|
|
179
|
+
choices: contentTypesList.map((ct) => ({ value: ct, name: ct })),
|
|
180
|
+
loop: false,
|
|
181
|
+
});
|
|
182
|
+
// if any term to filter by doesn't exist, exclude
|
|
183
|
+
if (chosenContentTypes.length === 0) {
|
|
184
|
+
cli_utilities_1.cliux.print('Please select atleast one content type.', { color: 'yellow' });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return chosenContentTypes;
|
|
235
188
|
}
|
|
236
189
|
// ============================================================================
|
|
237
190
|
// Language Prompts
|
|
@@ -239,29 +192,19 @@ function chooseInMemContentTypes(contentTypesList) {
|
|
|
239
192
|
/**
|
|
240
193
|
* Prompt user to choose a language/locale.
|
|
241
194
|
*/
|
|
242
|
-
function chooseLanguage(stackAPIClient) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
choices: languagesList,
|
|
252
|
-
name: 'chosenLanguage',
|
|
253
|
-
},
|
|
254
|
-
];
|
|
255
|
-
inquirer_1.default
|
|
256
|
-
.prompt(_chooseLanguage)
|
|
257
|
-
.then((answers) => {
|
|
258
|
-
const chosenLanguage = answers.chosenLanguage;
|
|
259
|
-
if (chosenLanguage === messages_1.messages.ACTION_CANCEL)
|
|
260
|
-
(0, error_handler_1.exitProgram)();
|
|
261
|
-
resolve({ name: chosenLanguage, code: languages[chosenLanguage] });
|
|
262
|
-
})
|
|
263
|
-
.catch(reject);
|
|
195
|
+
async function chooseLanguage(stackAPIClient) {
|
|
196
|
+
const languages = await (0, api_client_1.getLanguages)(stackAPIClient);
|
|
197
|
+
const choices = [
|
|
198
|
+
...Object.keys(languages).map((name) => ({ value: name })),
|
|
199
|
+
{ value: messages_1.messages.ACTION_CANCEL },
|
|
200
|
+
];
|
|
201
|
+
const chosenLanguage = await (0, prompts_1.select)({
|
|
202
|
+
message: 'Choose Language',
|
|
203
|
+
choices,
|
|
264
204
|
});
|
|
205
|
+
if (chosenLanguage === messages_1.messages.ACTION_CANCEL)
|
|
206
|
+
(0, error_handler_1.exitProgram)();
|
|
207
|
+
return { name: chosenLanguage, code: languages[chosenLanguage] };
|
|
265
208
|
}
|
|
266
209
|
// ============================================================================
|
|
267
210
|
// Fallback Options Prompts
|
|
@@ -269,45 +212,27 @@ function chooseLanguage(stackAPIClient) {
|
|
|
269
212
|
/**
|
|
270
213
|
* Prompt user for fallback options.
|
|
271
214
|
*/
|
|
272
|
-
function chooseFallbackOptions(stackAPIClient) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
let fallbackLocale = null;
|
|
286
|
-
if (includeFallback) {
|
|
287
|
-
// Get available languages for fallback locale selection
|
|
288
|
-
const languages = await (0, api_client_1.getLanguages)(stackAPIClient);
|
|
289
|
-
const languagesList = Object.keys(languages);
|
|
290
|
-
const fallbackQuestion = [
|
|
291
|
-
{
|
|
292
|
-
type: 'list',
|
|
293
|
-
name: 'selectedFallbackLocale',
|
|
294
|
-
message: 'Choose fallback locale',
|
|
295
|
-
choices: languagesList,
|
|
296
|
-
},
|
|
297
|
-
];
|
|
298
|
-
const secondAnswers = await inquirer_1.default.prompt(fallbackQuestion);
|
|
299
|
-
const selectedFallbackLocale = secondAnswers.selectedFallbackLocale;
|
|
300
|
-
fallbackLocale = languages[selectedFallbackLocale];
|
|
301
|
-
}
|
|
302
|
-
resolve({
|
|
303
|
-
includeFallback,
|
|
304
|
-
fallbackLocale,
|
|
215
|
+
async function chooseFallbackOptions(stackAPIClient) {
|
|
216
|
+
try {
|
|
217
|
+
const includeFallback = await (0, prompts_1.confirm)({
|
|
218
|
+
message: 'Include fallback locale data when exporting taxonomies?',
|
|
219
|
+
default: false,
|
|
220
|
+
});
|
|
221
|
+
let fallbackLocale = null;
|
|
222
|
+
if (includeFallback) {
|
|
223
|
+
// Get available languages for fallback locale selection
|
|
224
|
+
const languages = await (0, api_client_1.getLanguages)(stackAPIClient);
|
|
225
|
+
const selectedFallbackLocale = await (0, prompts_1.select)({
|
|
226
|
+
message: 'Choose fallback locale',
|
|
227
|
+
choices: Object.keys(languages).map((name) => ({ value: name })),
|
|
305
228
|
});
|
|
229
|
+
fallbackLocale = languages[selectedFallbackLocale];
|
|
306
230
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
231
|
+
return { includeFallback, fallbackLocale };
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
311
236
|
}
|
|
312
237
|
// ============================================================================
|
|
313
238
|
// Team Export Prompts
|
|
@@ -316,18 +241,13 @@ function chooseFallbackOptions(stackAPIClient) {
|
|
|
316
241
|
* Prompt to continue exporting without certain fields.
|
|
317
242
|
*/
|
|
318
243
|
async function promptContinueExport() {
|
|
319
|
-
|
|
320
|
-
{
|
|
321
|
-
type: 'list',
|
|
322
|
-
name: 'chooseExport',
|
|
244
|
+
try {
|
|
245
|
+
const chooseExport = await (0, prompts_1.select)({
|
|
323
246
|
message: 'Access denied: Please confirm if you still want to continue exporting the data without the { Stack Name, Stack Uid, Role Name } fields.',
|
|
324
|
-
choices: ['yes', 'no'],
|
|
247
|
+
choices: [{ value: 'yes' }, { value: 'no' }],
|
|
325
248
|
loop: false,
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
try {
|
|
329
|
-
const answers = await inquirer_1.default.prompt(export_stack_role);
|
|
330
|
-
return answers.chooseExport === 'yes';
|
|
249
|
+
});
|
|
250
|
+
return chooseExport === 'yes';
|
|
331
251
|
}
|
|
332
252
|
catch (error) {
|
|
333
253
|
cli_utilities_1.cliux.print(error, { color: 'red' });
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-export-to-csv",
|
|
3
3
|
"description": "Export entries, taxonomies, terms, or organization users to CSV",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.3",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-command": "~2.0.0-beta.
|
|
9
|
-
"@contentstack/cli-utilities": "~2.0.0-beta.
|
|
8
|
+
"@contentstack/cli-command": "~2.0.0-beta.3",
|
|
9
|
+
"@contentstack/cli-utilities": "~2.0.0-beta.3",
|
|
10
10
|
"@oclif/core": "^4.8.0",
|
|
11
11
|
"@oclif/plugin-help": "^6.2.32",
|
|
12
|
-
"fast-csv": "^4.3.6"
|
|
13
|
-
"inquirer": "8.2.7",
|
|
14
|
-
"inquirer-checkbox-plus-prompt": "1.4.2"
|
|
12
|
+
"fast-csv": "^4.3.6"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
17
15
|
"@oclif/test": "^4.1.13",
|
|
@@ -75,4 +73,4 @@
|
|
|
75
73
|
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"",
|
|
76
74
|
"version": "oclif readme && git add README.md"
|
|
77
75
|
}
|
|
78
|
-
}
|
|
76
|
+
}
|