diff --git a/.talismanrc b/.talismanrc index 212f9b2b77..13bfde9e48 100644 --- a/.talismanrc +++ b/.talismanrc @@ -1,4 +1,4 @@ fileignoreconfig: - - filename: pnpm-lock.yaml - checksum: 5bf275a8f6843072ceadaef8e1aafaef8a80ef71d8d0719a653dc6ecee6e9355 + - filename: eslint.config.base.js + checksum: 42ffeeab54d02b41d9cc9253f380a5269603d4a9da3798d32bf5c815684ea466 version: '1.0' diff --git a/eslint.config.base.js b/eslint.config.base.js new file mode 100644 index 0000000000..7a9d1d4da9 --- /dev/null +++ b/eslint.config.base.js @@ -0,0 +1,15 @@ +import tseslint from 'typescript-eslint'; + +export const typescriptConfig = tseslint.configs.recommended; + +export const baseRules = { + eqeqeq: ['error', 'smart'], + 'id-match': 'error', + 'no-eval': 'error', + 'no-var': 'error', + '@typescript-eslint/no-unused-vars': ['error', { args: 'none' }], + '@typescript-eslint/prefer-namespace-keyword': 'error', + semi: 'off', + '@typescript-eslint/no-redeclare': 'off', + '@typescript-eslint/no-explicit-any': 'off', +}; diff --git a/packages/contentstack-auth/.eslintignore b/packages/contentstack-auth/.eslintignore deleted file mode 100644 index 72d230bac9..0000000000 --- a/packages/contentstack-auth/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -# Build files -./lib \ No newline at end of file diff --git a/packages/contentstack-auth/.eslintrc b/packages/contentstack-auth/.eslintrc deleted file mode 100644 index 7b112a1df8..0000000000 --- a/packages/contentstack-auth/.eslintrc +++ /dev/null @@ -1,36 +0,0 @@ -{ - "env": { - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "extends": [ - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - "args": "none" - } - ], - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/quotes": "off", - "semi": "off", - "@typescript-eslint/type-annotation-spacing": "off", - "@typescript-eslint/no-redeclare": "off", - "eqeqeq": [ - "error", - "smart" - ], - "id-match": "error", - "no-eval": "error", - "no-var": "error", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unsafe-function-type": "off" - } -} \ No newline at end of file diff --git a/packages/contentstack-auth/README.md b/packages/contentstack-auth/README.md index 9d8a9a4fe7..69ad0517d0 100644 --- a/packages/contentstack-auth/README.md +++ b/packages/contentstack-auth/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-auth/1.8.0 darwin-arm64 node-v24.14.0 +@contentstack/cli-auth/1.8.1 darwin-arm64 node-v24.14.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-auth/eslint.config.js b/packages/contentstack-auth/eslint.config.js new file mode 100644 index 0000000000..26de1c803a --- /dev/null +++ b/packages/contentstack-auth/eslint.config.js @@ -0,0 +1,17 @@ +import { typescriptConfig, baseRules } from '../../eslint.config.base.js'; + +export default [ + ...typescriptConfig, + { + files: ['src/**/*.ts'], + rules: { + ...baseRules, + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/quotes': 'off', + '@typescript-eslint/type-annotation-spacing': 'off', + }, + }, + { + ignores: ['lib/**'], + }, +]; diff --git a/packages/contentstack-auth/package.json b/packages/contentstack-auth/package.json index 88c9b7ef82..347e29aff3 100644 --- a/packages/contentstack-auth/package.json +++ b/packages/contentstack-auth/package.json @@ -37,7 +37,7 @@ "@types/sinon": "^21.0.0", "chai": "^4.5.0", "dotenv": "^16.4.7", - "eslint": "^8.57.1", + "eslint": "^9.26.0", "eslint-config-oclif": "^5.2.2", "eslint-config-oclif-typescript": "^3.1.14", "mocha": "10.8.2", diff --git a/packages/contentstack-auth/src/interfaces/index.ts b/packages/contentstack-auth/src/interfaces/index.ts index d0bcde92f4..9be0dc0f42 100644 --- a/packages/contentstack-auth/src/interfaces/index.ts +++ b/packages/contentstack-auth/src/interfaces/index.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line @typescript-eslint/no-redeclare export interface AuthOptions { contentstackClient: any; } diff --git a/packages/contentstack-command/.eslintignore b/packages/contentstack-command/.eslintignore deleted file mode 100644 index 72d230bac9..0000000000 --- a/packages/contentstack-command/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -# Build files -./lib \ No newline at end of file diff --git a/packages/contentstack-command/.eslintrc b/packages/contentstack-command/.eslintrc deleted file mode 100644 index cd91b82a66..0000000000 --- a/packages/contentstack-command/.eslintrc +++ /dev/null @@ -1,31 +0,0 @@ -{ - "env": { - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "extends": [ - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@typescript-eslint/no-unused-vars": [ - "error", - { - "args": "none" - } - ], - "@typescript-eslint/prefer-namespace-keyword": "error", - "semi": "off", - "@typescript-eslint/no-redeclare": "off", - "eqeqeq": [ - "error", - "smart" - ], - "id-match": "error", - "no-eval": "error", - "no-var": "error" - } -} \ No newline at end of file diff --git a/packages/contentstack-command/eslint.config.js b/packages/contentstack-command/eslint.config.js new file mode 100644 index 0000000000..000cf19a89 --- /dev/null +++ b/packages/contentstack-command/eslint.config.js @@ -0,0 +1,12 @@ +import { typescriptConfig, baseRules } from '../../eslint.config.base.js'; + +export default [ + ...typescriptConfig, + { + files: ['src/**/*.ts'], + rules: baseRules, + }, + { + ignores: ['lib/**'], + }, +]; diff --git a/packages/contentstack-command/package.json b/packages/contentstack-command/package.json index d33be95fcf..4385bd49b2 100644 --- a/packages/contentstack-command/package.json +++ b/packages/contentstack-command/package.json @@ -29,7 +29,7 @@ "@types/mkdirp": "^1.0.2", "@types/mocha": "^8.2.3", "@types/node": "^14.18.63", - "eslint": "^8.57.1", + "eslint": "^9.26.0", "eslint-config-oclif": "^6.0.15", "eslint-config-oclif-typescript": "^3.1.13", "mocha": "10.8.2", diff --git a/packages/contentstack-config/.eslintignore b/packages/contentstack-config/.eslintignore deleted file mode 100644 index 72d230bac9..0000000000 --- a/packages/contentstack-config/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -# Build files -./lib \ No newline at end of file diff --git a/packages/contentstack-config/.eslintrc b/packages/contentstack-config/.eslintrc deleted file mode 100644 index 25135802f1..0000000000 --- a/packages/contentstack-config/.eslintrc +++ /dev/null @@ -1,34 +0,0 @@ -{ - "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:mocha/recommended"], - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "mocha"], - "rules": { - "unicorn/no-abusive-eslint-disable": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/ban-ts-ignore": "off", - "indent": "off", - "object-curly-spacing": "off", - "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], - "mocha/no-async-describe": "off", - "mocha/no-identical-title": "off", - "mocha/no-mocha-arrows": "off", - "mocha/no-setup-in-describe": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-var-requires": "off", - "prefer-const": "error", - "no-fallthrough": "error", - "no-prototype-builtins": "off" - }, - "env": { - "node": true, - "mocha": true - }, - "overrides": [ - { - "files": ["*.d.ts"], - "rules": { - "@typescript-eslint/no-explicit-any": "off" - } - } - ] -} diff --git a/packages/contentstack-config/README.md b/packages/contentstack-config/README.md index 65be566e9b..aab6ff8958 100644 --- a/packages/contentstack-config/README.md +++ b/packages/contentstack-config/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-config/1.20.1 darwin-arm64 node-v24.14.0 +@contentstack/cli-config/1.20.2 darwin-arm64 node-v24.14.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-config/eslint.config.js b/packages/contentstack-config/eslint.config.js new file mode 100644 index 0000000000..722ed43da6 --- /dev/null +++ b/packages/contentstack-config/eslint.config.js @@ -0,0 +1,43 @@ +import eslint from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import mochaPlugin from 'eslint-plugin-mocha'; +import { FlatCompat } from '@eslint/eslintrc'; +import { baseRules } from '../../eslint.config.base.js'; + +const compat = new FlatCompat(); + +export default [ + eslint.configs.recommended, + ...tseslint.configs.recommended, + ...compat.config(mochaPlugin.configs.recommended), + { + files: ['src/**/*.ts', 'test/**/*.ts'], + rules: { + ...baseRules, + 'unicorn/no-abusive-eslint-disable': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/ban-ts-ignore': 'off', + indent: 'off', + 'object-curly-spacing': 'off', + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + 'mocha/no-async-describe': 'off', + 'mocha/no-identical-title': 'off', + 'mocha/no-mocha-arrows': 'off', + 'mocha/no-setup-in-describe': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-var-requires': 'off', + 'prefer-const': 'error', + 'no-fallthrough': 'error', + 'no-prototype-builtins': 'off', + }, + }, + { + files: ['*.d.ts'], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + }, + }, + { + ignores: ['lib/**'], + }, +]; diff --git a/packages/contentstack-config/package.json b/packages/contentstack-config/package.json index d342826c20..4a2f18944c 100644 --- a/packages/contentstack-config/package.json +++ b/packages/contentstack-config/package.json @@ -33,7 +33,7 @@ "@types/node": "^14.18.63", "@types/sinon": "^21.0.0", "chai": "^4.5.0", - "eslint": "^8.57.1", + "eslint": "^9.26.0", "eslint-config-oclif": "^6.0.62", "eslint-config-oclif-typescript": "^3.1.14", "mocha": "10.8.2", diff --git a/packages/contentstack-utilities/.eslintignore b/packages/contentstack-utilities/.eslintignore deleted file mode 100644 index 72d230bac9..0000000000 --- a/packages/contentstack-utilities/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -# Build files -./lib \ No newline at end of file diff --git a/packages/contentstack-utilities/.eslintrc b/packages/contentstack-utilities/.eslintrc deleted file mode 100644 index b9fcf5f446..0000000000 --- a/packages/contentstack-utilities/.eslintrc +++ /dev/null @@ -1,36 +0,0 @@ -{ - "env": { - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "extends": [ - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@typescript-eslint/no-empty-object-type": "off", - "@typescript-eslint/no-this-alias": "off", - "@typescript-eslint/no-unsafe-function-type": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - "args": "none", - "varsIgnorePattern": "^_" - } - ], - "@typescript-eslint/prefer-namespace-keyword": "error", - "semi": "off", - "@typescript-eslint/no-redeclare": "off", - "@typescript-eslint/no-explicit-any": "off", - "eqeqeq": [ - "error", - "smart" - ], - "id-match": "error", - "no-eval": "error", - "no-var": "error" - } -} \ No newline at end of file diff --git a/packages/contentstack-utilities/eslint.config.js b/packages/contentstack-utilities/eslint.config.js new file mode 100644 index 0000000000..12252a8229 --- /dev/null +++ b/packages/contentstack-utilities/eslint.config.js @@ -0,0 +1,17 @@ +import { typescriptConfig, baseRules } from '../../eslint.config.base.js'; + +export default [ + ...typescriptConfig, + { + files: ['src/**/*.ts'], + rules: { + ...baseRules, + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-this-alias': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off', + }, + }, + { + ignores: ['lib/**'], + }, +]; diff --git a/packages/contentstack-utilities/package.json b/packages/contentstack-utilities/package.json index f781ddeb7e..08f28525b5 100644 --- a/packages/contentstack-utilities/package.json +++ b/packages/contentstack-utilities/package.json @@ -53,7 +53,7 @@ "traverse": "^0.6.11", "tty-table": "^4.2.3", "unique-string": "^2.0.0", - "uuid": "^9.0.1", + "uuid": "^14.0.0", "winston": "^3.19.0", "xdg-basedir": "^4.0.0" }, @@ -71,7 +71,7 @@ "@types/sinon": "^21.0.0", "@types/traverse": "^0.6.37", "chai": "^4.5.0", - "eslint": "^8.57.1", + "eslint": "^9.26.0", "eslint-config-oclif": "^6.0.62", "eslint-config-oclif-typescript": "^3.1.14", "fancy-test": "^2.0.42", diff --git a/packages/contentstack-utilities/src/fs-utility/core.ts b/packages/contentstack-utilities/src/fs-utility/core.ts index 17ce3972b4..de02ae6f48 100644 --- a/packages/contentstack-utilities/src/fs-utility/core.ts +++ b/packages/contentstack-utilities/src/fs-utility/core.ts @@ -458,7 +458,6 @@ export async function getFileList(dirName: string, onlyName = true): Promise { /** * The Axios response object. diff --git a/packages/contentstack-utilities/src/logger/cli-error-handler.ts b/packages/contentstack-utilities/src/logger/cli-error-handler.ts index 7d7aa2bd5a..1a57af5e23 100644 --- a/packages/contentstack-utilities/src/logger/cli-error-handler.ts +++ b/packages/contentstack-utilities/src/logger/cli-error-handler.ts @@ -178,7 +178,7 @@ export default class CLIErrorHandler { * Extracts only essential error payload information for clear debugging. */ private extractErrorPayload(error: Error & Record): Record { - const { name, message: _message, code, status, response, request, config, statusText } = error; + const { name, code, status, response, request, config, statusText } = error; const payload: Record = { name, diff --git a/packages/contentstack-utilities/test/unit/auth-handler.test.ts b/packages/contentstack-utilities/test/unit/auth-handler.test.ts index 295da6f037..551f6bf7f8 100644 --- a/packages/contentstack-utilities/test/unit/auth-handler.test.ts +++ b/packages/contentstack-utilities/test/unit/auth-handler.test.ts @@ -166,25 +166,17 @@ describe('Auth Handler', () => { refresh_token: refreshToken, }; - try { - const expectedPayload = { - grant_type: 'authorization_code', - client_id: authHandler.OAuthClientId, - code_verifier: authHandler.codeVerifier, - redirect_uri: authHandler.OAuthRedirectURL, - code, - }; - - const httpClientStub = sandbox.stub(HttpClient.prototype, 'post').resolves({ data: userData }); - const getUserDetailsStub = sandbox.stub(authHandler, 'getUserDetails').resolves(userData); - const setConfigDataStub = sandbox.stub(authHandler, 'setConfigData').resolves(); - - await authHandler.getAccessToken(code); - - assert.calledWith(httpClientStub, `${authHandler.OAuthBaseURL}/apps-api/apps/token`, expectedPayload); - assert.calledWith(getUserDetailsStub, userData); - assert.calledWith(setConfigDataStub, 'oauth', userData); - } catch (error) {} + const exchangeStub = sandbox.stub().resolves(userData); + sandbox.stub(authHandler, 'oauthHandler').value({ + exchangeCodeForToken: exchangeStub, + }); + const getUserDetailsStub = sandbox.stub(authHandler, 'getUserDetails').resolves(userData); + const setConfigDataStub = sandbox.stub(authHandler, 'setConfigData').resolves(); + await authHandler.getAccessToken(code); + // Verify the actual calls made: + assert.calledWith(exchangeStub, code); // exchangeCodeForToken called with code + assert.calledWith(getUserDetailsStub, userData); // getUserDetails called with result from exchange + assert.calledWith(setConfigDataStub, 'oauth', userData); // setConfigData called with 'oauth' and userData }); }); @@ -296,30 +288,31 @@ describe('Auth Handler', () => { }); it('should refresh the token and resolve with data when refresh token is valid', async () => { - const configOauthRefreshToken = 'valid_refresh_token'; // Set a valid refresh token here + const configOauthRefreshToken = 'valid_refresh_token'; const configAuthorisationType = authHandler.authorisationTypeOAUTHValue; const expectedData = { - access_token: config.access_token, + access_token: 'new_access_token', refresh_token: 'new_refresh_token', }; - - const postStub = sandbox.stub().resolves({ data: expectedData }); - const httpClientStub = { - post: postStub, - }; - const httpClientInstance = new HttpClient().headers().asFormParams(); - sandbox.stub(httpClientInstance, 'post').value(httpClientStub); - - sandbox.stub(authHandler, 'setConfigData').resolves(expectedData); - + // Stub oauthHandler with refreshAccessToken method + const refreshAccessTokenStub = sandbox.stub().resolves(expectedData); + sandbox.stub(authHandler, 'oauthHandler').value({ + refreshAccessToken: refreshAccessTokenStub, + }); + // Stub configHandler.get to return proper values sandbox .stub(configHandler, 'get') .withArgs(authHandler.oauthRefreshTokenKeyName) .returns(configOauthRefreshToken) .withArgs(authHandler.authorisationTypeKeyName) .returns(configAuthorisationType); - - authHandler.refreshToken(); + // Stub setConfigData + sandbox.stub(authHandler, 'setConfigData').resolves(expectedData); + const result = await authHandler.refreshToken(); + // Verify calls + assert.calledWith(refreshAccessTokenStub, configOauthRefreshToken); + assert.calledWith(authHandler.setConfigData, 'refreshToken', expectedData); + expect(result).to.deep.equal(expectedData); }); }); @@ -354,7 +347,7 @@ describe('Auth Handler', () => { const data = { access_token: '', }; - + try { await authHandler.getUserDetails(data); throw new Error('Expected getUserDetails to throw'); // ensure failure if no error is thrown @@ -362,7 +355,7 @@ describe('Auth Handler', () => { expect(error).to.be.instanceOf(Error); expect(error.message).to.equal('Invalid or empty access token.'); } - }); + }); }); describe('isAuthenticated', () => { diff --git a/packages/contentstack/.eslintignore b/packages/contentstack/.eslintignore deleted file mode 100644 index 72d230bac9..0000000000 --- a/packages/contentstack/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -# Build files -./lib \ No newline at end of file diff --git a/packages/contentstack/.eslintrc b/packages/contentstack/.eslintrc deleted file mode 100644 index 332273081e..0000000000 --- a/packages/contentstack/.eslintrc +++ /dev/null @@ -1,33 +0,0 @@ -{ - "env": { - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "extends": [ - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@typescript-eslint/no-unused-vars": [ - "error", - { - "args": "none" - } - ], - "@typescript-eslint/prefer-namespace-keyword": "error", - "semi": "off", - "@typescript-eslint/no-redeclare": "off", - "eqeqeq": [ - "error", - "smart" - ], - "id-match": "error", - "no-eval": "error", - "no-var": "error", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unsafe-function-type": "off" - } -} \ No newline at end of file diff --git a/packages/contentstack/README.md b/packages/contentstack/README.md index a18406b226..a3ff1cf571 100644 --- a/packages/contentstack/README.md +++ b/packages/contentstack/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli/1.60.1 darwin-arm64 node-v24.14.0 +@contentstack/cli/1.61.1 darwin-arm64 node-v24.14.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -39,12 +39,12 @@ USAGE * [`csdx auth:whoami`](#csdx-authwhoami) * [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value) * [`csdx cm:assets:unpublish`](#csdx-cmassetsunpublish) -* [`csdx cm:bootstrap`](#csdx-cmbootstrap) * [`csdx cm:branches`](#csdx-cmbranches) * [`csdx cm:branches:create`](#csdx-cmbranchescreate) * [`csdx cm:branches:delete [-uid ] [-k ]`](#csdx-cmbranchesdelete--uid-value--k-value) * [`csdx cm:branches:diff [--base-branch ] [--compare-branch ] [-k ][--module ] [--format ] [--csv-path ]`](#csdx-cmbranchesdiff---base-branch-value---compare-branch-value--k-value--module-value---format-value---csv-path-value) * [`csdx cm:branches:merge [-k ][--compare-branch ] [--no-revert] [--export-summary-path ] [--use-merge-summary ] [--comment ] [--base-branch ]`](#csdx-cmbranchesmerge--k-value--compare-branch-value---no-revert---export-summary-path-value---use-merge-summary-value---comment-value---base-branch-value) +* [`csdx cm:branches:merge-status -k --merge-uid `](#csdx-cmbranchesmerge-status--k-value---merge-uid-value) * [`csdx cm:bulk-publish`](#csdx-cmbulk-publish) * [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value) * [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value) @@ -70,11 +70,8 @@ USAGE * [`csdx cm:stacks:import-setup [-k ] [-d ] [-a ] [--modules ]`](#csdx-cmstacksimport-setup--k-value--d-value--a-value---modules-valuevalue) * [`csdx cm:migrate-rte`](#csdx-cmmigrate-rte) * [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) -* [`csdx cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y] [-s ] [--locale ]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y--s-value---locale-value) -* [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent) * [`csdx cm:stacks:audit`](#csdx-cmstacksaudit) * [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix) -* [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent) * [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets) * [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent) * [`csdx cm:stacks:import-setup [-k ] [-d ] [-a ] [--modules ]`](#csdx-cmstacksimport-setup--k-value--d-value--a-value---modules-valuevalue) @@ -83,7 +80,6 @@ USAGE * [`csdx cm:stacks:publish-clear-logs`](#csdx-cmstackspublish-clear-logs) * [`csdx cm:stacks:publish-configure`](#csdx-cmstackspublish-configure) * [`csdx cm:stacks:publish-revert`](#csdx-cmstackspublish-revert) -* [`csdx cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y] [-s ] [--locale ]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y--s-value---locale-value) * [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries) * [`csdx config:get:base-branch`](#csdx-configgetbase-branch) * [`csdx config:get:ea-header`](#csdx-configgetea-header) @@ -576,46 +572,6 @@ EXAMPLES _See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/assets/unpublish.js)_ -## `csdx cm:bootstrap` - -Bootstrap contentstack apps - -``` -USAGE - $ csdx cm:bootstrap [--app-name ] [--project-dir ] [-k | --org | -n ] [-y] - [--run-dev-server] [-a ] - -FLAGS - -a, --alias= Alias of the management token - -k, --stack-api-key= Provide stack API key to seed content - -n, --stack-name= Name of the new stack that will be created. - -y, --yes [Optional] Skip stack confirmation - --app-name= App name, kickstart-next, kickstart-next-ssr, kickstart-next-ssg, kickstart-next-graphql, - kickstart-next-middleware, kickstart-nuxt, kickstart-nuxt-ssr - --org= Provide organization UID to create a new stack - --project-dir= Directory to setup the project. If directory name has a space then provide the path as a - string or escap the space using back slash eg: "../../test space" or ../../test\ space - --run-dev-server Automatically start the development server after setup - -DESCRIPTION - Bootstrap contentstack apps - -EXAMPLES - $ csdx cm:bootstrap - - $ csdx cm:bootstrap --project-dir - - $ csdx cm:bootstrap --app-name "kickstart-next" --project-dir - - $ csdx cm:bootstrap --app-name "kickstart-next" --project-dir --stack-api-key "stack-api-key" - - $ csdx cm:bootstrap --app-name "kickstart-next" --project-dir --org "your-org-uid" --stack-name "stack-name" - - $ csdx cm:bootstrap --app-name "kickstart-next" --project-dir --run-dev-server -``` - -_See code: [@contentstack/cli-cm-bootstrap](https://github.com/contentstack/cli/blob/main/packages/contentstack-bootstrap/src/commands/cm/bootstrap.ts)_ - ## `csdx cm:branches` List the branches @@ -793,6 +749,29 @@ EXAMPLES _See code: [@contentstack/cli-cm-branches](https://github.com/contentstack/cli/blob/main/packages/contentstack-export/src/commands/cm/branches/merge.ts)_ +## `csdx cm:branches:merge-status -k --merge-uid ` + +Check the status of a branch merge job + +``` +USAGE + $ csdx cm:branches:merge-status -k --merge-uid + +FLAGS + -k, --stack-api-key= (required) Provide your stack API key. + --merge-uid= (required) Merge job UID to check status for. + +DESCRIPTION + Check the status of a branch merge job + +EXAMPLES + $ csdx cm:branches:merge-status -k bltxxxxxxxx --merge-uid merge_abc123 + + $ csdx cm:branches:merge-status --stack-api-key bltxxxxxxxx --merge-uid merge_abc123 +``` + +_See code: [@contentstack/cli-cm-branches](https://github.com/contentstack/cli/blob/main/packages/contentstack-export/src/commands/cm/branches/merge-status.ts)_ + ## `csdx cm:bulk-publish` Bulk Publish script for managing entries and assets @@ -2566,97 +2545,6 @@ EXAMPLES $ csdx cm:migration --alias --file-path -k ``` -## `csdx cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y] [-s ] [--locale ]` - -Create a stack from existing content types, entries, assets, etc - -``` -USAGE - $ csdx cm:seed cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y] [-s ] - [--locale ] - -FLAGS - -a, --alias= Alias of the management token - -k, --stack-api-key= Provide stack API key to seed content to - -n, --stack-name= Name of a new stack that needs to be created. - -o, --org= Provide Organization UID to create a new stack - -r, --repo= GitHub organization name or GitHub user name/repository name. - -s, --stack= Provide the stack UID to seed content. - -y, --yes [Optional] Skip the stack confirmation. - -DESCRIPTION - Create a stack from existing content types, entries, assets, etc - -ALIASES - $ csdx cm:seed - -EXAMPLES - $ csdx cm:stacks:seed - - $ csdx cm:stacks:seed --repo "account" - - $ csdx cm:stacks:seed --repo "account/repository" - - $ csdx cm:stacks:seed --repo "account/repository" --stack-api-key "stack-api-key" //seed content into specific stack - - $ csdx cm:stacks:seed --repo "account/repository" --org "your-org-uid" --stack-name "stack-name" //create a new stack in given org uid -``` - -## `csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]` - -Clone data (structure/content or both) of a stack into another stack - -``` -USAGE - $ csdx cm:stack-clone cm:stacks:clone [--source-branch ] [--target-branch ] - [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] - [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current] - -FLAGS - -c, --config= Path for the external configuration - -n, --stack-name= Provide a name for the new stack to store the cloned content. - -y, --yes Force override all Marketplace prompts. - --destination-management-token-alias= Destination management token alias. - --destination-stack-api-key= Destination stack API key - --import-webhook-status=