@contentstack/cli-utilities 1.18.1 → 1.18.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/fs-utility/core.js +0 -1
- package/lib/helpers.d.ts +2 -0
- package/lib/helpers.js +11 -1
- package/lib/http-client/http-response.js +1 -0
- package/lib/logger/cli-error-handler.js +1 -1
- package/package.json +11 -10
package/lib/fs-utility/core.js
CHANGED
|
@@ -365,7 +365,6 @@ async function getFileList(dirName, onlyName = true) {
|
|
|
365
365
|
const items = (0, node_fs_1.readdirSync)(dirName, { withFileTypes: true });
|
|
366
366
|
for (const item of items) {
|
|
367
367
|
if (item.isDirectory()) {
|
|
368
|
-
/* eslint-disable no-await-in-loop */
|
|
369
368
|
files = [...files, ...(await getFileList(`${dirName}/${item.name}`))];
|
|
370
369
|
}
|
|
371
370
|
else {
|
package/lib/helpers.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export declare function getAuthenticationMethod(): string;
|
|
|
42
42
|
* @param authenticationMethod - Optional authentication method
|
|
43
43
|
* @returns Context object with all session-level metadata
|
|
44
44
|
*/
|
|
45
|
+
export declare function generateUid(): string;
|
|
46
|
+
export declare function generateShortUid(): string;
|
|
45
47
|
export declare function createLogContext(commandId: string, apiKey: string, authenticationMethod?: string): {
|
|
46
48
|
command: string;
|
|
47
49
|
module: string;
|
package/lib/helpers.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLogContext = exports.getAuthenticationMethod = exports.redactObject = exports.formatError = exports.validateRegex = exports.validateFileName = exports.validateUids = exports.sanitizePath = exports.escapeRegExp = exports.validatePath = exports.createDeveloperHubUrl = exports.isManagementTokenValid = exports.getBranchFromAlias = exports.doesBranchExist = exports.isAuthenticated = void 0;
|
|
3
|
+
exports.createLogContext = exports.generateShortUid = exports.generateUid = exports.getAuthenticationMethod = exports.redactObject = exports.formatError = exports.validateRegex = exports.validateFileName = exports.validateUids = exports.sanitizePath = exports.escapeRegExp = exports.validatePath = exports.createDeveloperHubUrl = exports.isManagementTokenValid = exports.getBranchFromAlias = exports.doesBranchExist = exports.isAuthenticated = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const recheck_1 = require("recheck");
|
|
6
6
|
const traverse_1 = tslib_1.__importDefault(require("traverse"));
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
const short_uuid_1 = require("short-uuid");
|
|
7
9
|
const auth_handler_1 = tslib_1.__importDefault(require("./auth-handler"));
|
|
8
10
|
const _1 = require(".");
|
|
9
11
|
const proxy_helper_1 = require("./proxy-helper");
|
|
@@ -271,6 +273,14 @@ exports.getAuthenticationMethod = getAuthenticationMethod;
|
|
|
271
273
|
* @param authenticationMethod - Optional authentication method
|
|
272
274
|
* @returns Context object with all session-level metadata
|
|
273
275
|
*/
|
|
276
|
+
function generateUid() {
|
|
277
|
+
return (0, uuid_1.v4)();
|
|
278
|
+
}
|
|
279
|
+
exports.generateUid = generateUid;
|
|
280
|
+
function generateShortUid() {
|
|
281
|
+
return (0, short_uuid_1.generate)();
|
|
282
|
+
}
|
|
283
|
+
exports.generateShortUid = generateShortUid;
|
|
274
284
|
function createLogContext(commandId, apiKey, authenticationMethod) {
|
|
275
285
|
// Store apiKey in configHandler so it's available for session.json
|
|
276
286
|
if (apiKey) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HttpResponse = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
5
|
class HttpResponse {
|
|
5
6
|
/**
|
|
6
7
|
* Wrap the given Axios `response` into a new response instance.
|
|
@@ -175,7 +175,7 @@ class CLIErrorHandler {
|
|
|
175
175
|
*/
|
|
176
176
|
extractErrorPayload(error) {
|
|
177
177
|
var _a, _b, _c, _d;
|
|
178
|
-
const { name,
|
|
178
|
+
const { name, code, status, response, request, config, statusText } = error;
|
|
179
179
|
const payload = {
|
|
180
180
|
name,
|
|
181
181
|
message: this.extractClearMessage(error),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-utilities",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.3",
|
|
4
4
|
"description": "Utilities for contentstack projects",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"author": "contentstack",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@contentstack/management": "~1.
|
|
31
|
-
"@contentstack/marketplace-sdk": "^1.5.
|
|
32
|
-
"@oclif/core": "^4.
|
|
33
|
-
"axios": "^1.
|
|
30
|
+
"@contentstack/management": "~1.30.1",
|
|
31
|
+
"@contentstack/marketplace-sdk": "^1.5.1",
|
|
32
|
+
"@oclif/core": "^4.10.5",
|
|
33
|
+
"axios": "^1.15.2",
|
|
34
34
|
"chalk": "^4.1.2",
|
|
35
35
|
"cli-cursor": "^3.1.0",
|
|
36
36
|
"cli-progress": "^3.12.0",
|
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
"traverse": "^0.6.11",
|
|
54
54
|
"tty-table": "^4.2.3",
|
|
55
55
|
"unique-string": "^2.0.0",
|
|
56
|
-
"uuid": "^
|
|
57
|
-
"
|
|
56
|
+
"short-uuid": "^6.0.0",
|
|
57
|
+
"uuid": "^14.0.0",
|
|
58
|
+
"winston": "^3.19.0",
|
|
58
59
|
"xdg-basedir": "^4.0.0"
|
|
59
60
|
},
|
|
60
61
|
"overrides": {
|
|
@@ -64,20 +65,20 @@
|
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@types/chai": "^4.3.20",
|
|
67
|
-
"@types/inquirer": "^9.0.
|
|
68
|
+
"@types/inquirer": "^9.0.9",
|
|
68
69
|
"@types/mkdirp": "^1.0.2",
|
|
69
70
|
"@types/mocha": "^10.0.10",
|
|
70
71
|
"@types/node": "^14.18.63",
|
|
71
72
|
"@types/sinon": "^21.0.0",
|
|
72
73
|
"@types/traverse": "^0.6.37",
|
|
73
74
|
"chai": "^4.5.0",
|
|
74
|
-
"eslint": "^
|
|
75
|
+
"eslint": "^9.26.0",
|
|
75
76
|
"eslint-config-oclif": "^6.0.62",
|
|
76
77
|
"eslint-config-oclif-typescript": "^3.1.14",
|
|
77
78
|
"fancy-test": "^2.0.42",
|
|
78
79
|
"mocha": "10.8.2",
|
|
79
80
|
"nyc": "^15.1.0",
|
|
80
|
-
"sinon": "^21.
|
|
81
|
+
"sinon": "^21.1.2",
|
|
81
82
|
"ts-node": "^10.9.2",
|
|
82
83
|
"typescript": "^4.9.5"
|
|
83
84
|
}
|