@contentstack/cli-utilities 1.18.2 → 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.
@@ -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, message: _message, code, status, response, request, config, statusText } = error;
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.2",
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",
@@ -30,7 +30,7 @@
30
30
  "@contentstack/management": "~1.30.1",
31
31
  "@contentstack/marketplace-sdk": "^1.5.1",
32
32
  "@oclif/core": "^4.10.5",
33
- "axios": "^1.15.1",
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,7 +53,8 @@
53
53
  "traverse": "^0.6.11",
54
54
  "tty-table": "^4.2.3",
55
55
  "unique-string": "^2.0.0",
56
- "uuid": "^9.0.1",
56
+ "short-uuid": "^6.0.0",
57
+ "uuid": "^14.0.0",
57
58
  "winston": "^3.19.0",
58
59
  "xdg-basedir": "^4.0.0"
59
60
  },
@@ -71,7 +72,7 @@
71
72
  "@types/sinon": "^21.0.0",
72
73
  "@types/traverse": "^0.6.37",
73
74
  "chai": "^4.5.0",
74
- "eslint": "^8.57.1",
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",