Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9edbb33
chore: update inquirer and node types across multiple packages, refac…
harshitha-cstk Feb 20, 2026
f42ff37
update package-lock
harshitha-cstk Feb 20, 2026
b1dafff
test: fix interactive tests by stubbing additional functions and upda…
harshitha-cstk Feb 20, 2026
0da0985
chore: update @types/node and @typescript-eslint/parser versions in p…
harshitha-cstk Feb 20, 2026
60c88cd
chore: update .gitignore to include tsconfig.tsbuildinfo
harshitha-cstk Feb 20, 2026
24e4950
chore: update test script to use 'compile' instead of 'build'
harshitha-cstk Feb 20, 2026
25d2d64
test: enhance bootstrapping tests by setting authorisation type and u…
harshitha-cstk Feb 23, 2026
e64012a
test: enable previously skipped test for management token retrieval a…
harshitha-cstk Feb 23, 2026
95ab9df
refactor: enhance CLI interface by adding InquirerQuestion and Answer…
harshitha-cstk Feb 23, 2026
5dd254d
feat(audit): validate referenced entry content types in entries audit
cs-raj Feb 23, 2026
c7ecbba
Remove Redundant code block
cs-raj Feb 24, 2026
aa08882
Merge pull request #2423 from contentstack/feat/DX-3800
cs-raj Feb 24, 2026
2d1ad10
fix: Skipping lytics audience creation
cs-raj Feb 24, 2026
db01c8a
fix(personalize): filter lytics audiences in experience variants duri…
cs-raj Feb 24, 2026
f95b012
Merge branch 'v2-beta-dev' into enh/dx-362-inquirer-v12
harshitha-cstk Feb 25, 2026
7628fd8
Merge branch 'v2-beta-dev' into enh/dx-362-inquirer-v12
harshitha-cstk Feb 25, 2026
cbfec0a
Merge pull request #2427 from contentstack/fix/DX-3445
cs-raj Feb 25, 2026
63b088d
Update package lock and pnpm lock
harshitha-cstk Feb 25, 2026
abdd358
version bump
harshitha-cstk Feb 27, 2026
44fd133
Merge pull request #2435 from contentstack/fix/version-bump
harshithad0703 Feb 27, 2026
d65b8c8
Merge pull request #2431 from contentstack/development
harshithad0703 Feb 27, 2026
47c1c8a
Merge pull request #2436 from contentstack/staging
harshithad0703 Mar 2, 2026
d58b86f
Update sca-scan.yml
dhavaljain999 Mar 2, 2026
2f317e2
fix(utilities): single session log folder per run via cache in getSes…
cs-raj Mar 3, 2026
fa9344c
fix(dx-4439): show human-readable prompts after command correction
harshitha-cstk Mar 4, 2026
4d61fe2
fix(auth): show 'Log out cancelled' when user declines logout confirm…
harshitha-cstk Mar 4, 2026
a266f8a
update pnpm lock
harshitha-cstk Mar 4, 2026
baa8a61
update pnpm lock
harshitha-cstk Mar 4, 2026
ba6bf58
Update sca-scan.yml
dhavaljain999 Mar 4, 2026
3111559
Fix logger Test cases
cs-raj Mar 5, 2026
6f90ffe
Merge pull request #2442 from contentstack/fix/DX-4903
cs-raj Mar 5, 2026
6a13b99
enhance error handling in CLI interface for better user experience
harshitha-cstk Mar 6, 2026
d1150e2
Merge branch 'v2-dev-bugfix' into enh/dx-362-inquirer-v12
harshitha-cstk Mar 6, 2026
08a166c
Merge branch 'main' into enh/dx-362-inquirer-v12
harshitha-cstk Mar 6, 2026
a7cb8b7
Add pnpm setup and Node.js version to workflow
aravindbuilt Mar 6, 2026
a64e69a
Update sca-scan.yml
aravindbuilt Mar 6, 2026
60ceac4
Update sca-scan.yml
aravindbuilt Mar 6, 2026
e4668e0
Update sca-scan.yml
aravindbuilt Mar 6, 2026
91a0b5d
update pnpm lock
harshitha-cstk Mar 9, 2026
9cee3d1
Merge pull request #2450 from contentstack/v2-beta
shafeeqd959 Mar 9, 2026
b403892
Merge branch 'v2-dev-bugfix' into fix/dx-4439-v2-dev-interactive-mode…
harshithad0703 Mar 10, 2026
d4e0151
Merge pull request #2446 from contentstack/fix/dx-4439-v2-dev-interac…
harshithad0703 Mar 10, 2026
caec548
update pnpm lock
harshitha-cstk Mar 11, 2026
48b61b1
Merge branch 'v2-dev-bugfix' into enh/dx-362-inquirer-v12
harshitha-cstk Mar 11, 2026
efa548f
Merge pull request #2420 from contentstack/enh/dx-362-inquirer-v12
harshithad0703 Mar 11, 2026
13a27f1
fixed workflow
shafeeqd959 Mar 12, 2026
3399d2e
Merge branch 'v2-dev' into v2-dev-bugfix
cs-raj Mar 13, 2026
8840e70
merged latest changes
shafeeqd959 Mar 13, 2026
c995a74
Merge pull request #2461 from contentstack/v2-beta-latest
shafeeqd959 Mar 13, 2026
6c26a72
Merge branch 'v2-dev' into fix/v2-dev-bugfix
cs-raj Mar 13, 2026
2a6288a
updated lock file
cs-raj Mar 13, 2026
f7edbd3
Merge pull request #2459 from contentstack/fix/v2-dev-bugfix
cs-raj Mar 13, 2026
1e6eb42
Merge pull request #2462 from contentstack/v2-dev-bugfix
cs-raj Mar 13, 2026
b0e67b5
enh: Added NO_PROXY env support
sunil-lakshman Mar 13, 2026
302bb90
Merge pull request #2466 from contentstack/enh/dx-5343-v2-dev
naman-contentstack Mar 16, 2026
6958177
chore: version bumps
Mar 16, 2026
83c6d60
Merge pull request #2469 from contentstack/chore/version-bumps
naman-contentstack Mar 16, 2026
f85ce83
chore: update lockfile and workflows
Mar 18, 2026
f1ce3fb
Merge pull request #2475 from contentstack/update/lockfile
naman-contentstack Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-v2-beta-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: pnpm run clean:all

- name: Install root dependencies
run: pnpm install --frozen-lockfile
run: pnpm install --no-frozen-lockfile

- name: Build all packages
run: pnpm -r --sort run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-v2-beta-platform-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: pnpm run clean:all

- name: Install root dependencies
run: pnpm install --frozen-lockfile
run: pnpm install --no-frozen-lockfile

- name: Build all plugins
run: pnpm -r --sort run build
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ jobs:
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --fail-on=all
args: --fail-on=all --all-projects
json: true
continue-on-error: true
- uses: contentstack/sca-policy@main
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fileignoreconfig:
- filename: pnpm-lock.yaml
checksum: a73fa0520b8f116e22cf347f4e2979a68ca798d922665b3f7b0118fffa66891d
checksum: 818b43b375b3b8d9c18b127a064db9886671e89576049e48dbbaf0d25baacb99
- filename: packages/contentstack/README.md
checksum: 68fe850ccf5398d26d3e1f67996284643756ea600bf9440562b54bd162d7afac
- filename: .github/workflows/release.yml
Expand Down
1 change: 1 addition & 0 deletions packages/contentstack-auth/messages/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"CLI_AUTH_LOGOUT_DESCRIPTION": "User session logout",
"CLI_AUTH_LOGOUT_FLAG_FORCE": "Force logging out for skipping the confirmation",
"CLI_AUTH_LOGOUT_ALREADY": "You're already logged out",
"CLI_AUTH_LOGOUT_CANCELLED": "Log out cancelled",
"CLI_AUTH_LOGOUT_NO_AUTHORIZATIONS": "No authorizations found",
"CLI_AUTH_LOGOUT_NO_AUTHORIZATIONS_USER": "No authorizations found for current user",
"CLI_AUTH_WHOAMI_LOGGED_IN_AS": "You are currently logged in with email:",
Expand Down
8 changes: 4 additions & 4 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-auth",
"description": "Contentstack CLI plugin for authentication activities",
"version": "2.0.0-beta.7",
"version": "2.0.0-beta.8",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -22,8 +22,8 @@
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-command": "~2.0.0-beta.2",
"@contentstack/cli-utilities": "~2.0.0-beta.2",
"@contentstack/cli-command": "~2.0.0-beta.3",
"@contentstack/cli-utilities": "~2.0.0-beta.3",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"otplib": "^12.0.1"
Expand Down Expand Up @@ -81,4 +81,4 @@
}
},
"repository": "contentstack/cli"
}
}
5 changes: 4 additions & 1 deletion packages/contentstack-auth/src/commands/auth/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export default class LogoutCommand extends BaseCommand<typeof LogoutCommand> {
confirm,
isAuthenticated: oauthHandler.isAuthenticated(),
});
log.success(messageHandler.parse('CLI_AUTH_LOGOUT_ALREADY'), this.contextDetails);
const messageKey = confirm === false && oauthHandler.isAuthenticated()
? 'CLI_AUTH_LOGOUT_CANCELLED'
: 'CLI_AUTH_LOGOUT_ALREADY';
log.success(messageHandler.parse(messageKey), this.contextDetails);
}
} catch (error) {
log.debug('Logout failed.', { ...this.contextDetails, error: error.message });
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-command",
"description": "Contentstack CLI plugin for configuration",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"author": "Contentstack",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -20,7 +20,7 @@
"test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-utilities": "~2.0.0-beta.2",
"@contentstack/cli-utilities": "~2.0.0-beta.3",
"contentstack": "^3.25.3",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28"
Expand Down Expand Up @@ -65,4 +65,4 @@
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-command/<%- commandPath %>"
},
"repository": "contentstack/cli"
}
}
8 changes: 4 additions & 4 deletions packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-config",
"description": "Contentstack CLI plugin for configuration",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"author": "Contentstack",
"scripts": {
"build": "pnpm compile && oclif manifest && oclif readme",
Expand All @@ -21,8 +21,8 @@
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-command": "~2.0.0-beta.2",
"@contentstack/cli-utilities": "~2.0.0-beta.2",
"@contentstack/cli-command": "~2.0.0-beta.3",
"@contentstack/cli-utilities": "~2.0.0-beta.3",
"@contentstack/utils": "~1.7.0",
"@oclif/core": "^4.8.1",
"@oclif/plugin-help": "^6.2.28",
Expand Down Expand Up @@ -81,4 +81,4 @@
}
},
"repository": "contentstack/cli"
}
}
10 changes: 5 additions & 5 deletions packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-utilities",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"description": "Utilities for contentstack projects",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -44,7 +44,7 @@
"conf": "^10.2.0",
"dotenv": "^16.6.1",
"figures": "^3.2.0",
"inquirer": "8.2.7",
"inquirer": "12.11.1",
"inquirer-search-checkbox": "^1.0.0",
"inquirer-search-list": "^1.2.6",
"js-yaml": "^4.1.1",
Expand All @@ -68,7 +68,7 @@
"@types/inquirer": "^9.0.8",
"@types/mkdirp": "^1.0.2",
"@types/mocha": "^10.0.10",
"@types/node": "^14.18.63",
"@types/node": "^18.11.9",
"@types/sinon": "^21.0.0",
"@types/traverse": "^0.6.37",
"chai": "^4.5.0",
Expand All @@ -80,6 +80,6 @@
"nyc": "^15.1.0",
"sinon": "^21.0.1",
"ts-node": "^10.9.2",
"typescript": "^4.9.5"
"typescript": "^5.0.0"
}
}
}
27 changes: 19 additions & 8 deletions packages/contentstack-utilities/src/cli-ux.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import chalk, { Chalk } from 'chalk';
import { default as inquirer, QuestionCollection, Answers } from 'inquirer';
import inquirer from 'inquirer';
import { ux as cliux, Args, Flags, Command } from '@oclif/core';
import { Ora, default as ora } from 'ora';
import cliProgress from 'cli-progress';
import CLITable, { TableFlags, TableHeader, TableData, TableOptions } from './cli-table';

import messageHandler from './message-handler';
import { PrintOptions, InquirePayload, CliUXPromptOptions } from './interfaces';
import { PrintOptions, InquirePayload, CliUXPromptOptions, InquirerQuestion, Answers } from './interfaces';

inquirer.registerPrompt('table', require('./inquirer-table-prompt'));

Expand Down Expand Up @@ -68,12 +68,23 @@ class CLIInterface {
}

async inquire<T>(inquirePayload: InquirePayload | Array<InquirePayload>): Promise<T> {
if (Array.isArray(inquirePayload)) {
return inquirer.prompt(inquirePayload);
} else {
inquirePayload.message = messageHandler.parse(inquirePayload.message);
const result = await inquirer.prompt(inquirePayload as QuestionCollection<Answers>);
return result[inquirePayload.name] as T;
try {
if (Array.isArray(inquirePayload)) {
return (await inquirer.prompt(inquirePayload)) as T;
} else {
inquirePayload.message = messageHandler.parse(inquirePayload.message);
const result = (await inquirer.prompt(inquirePayload as InquirerQuestion as Parameters<typeof inquirer.prompt>[0])) as Answers;
return result[inquirePayload.name] as T;
}
} catch (err) {
const isExitPrompt =
(err as NodeJS.ErrnoException)?.name === 'ExitPromptError' ||
(err as Error)?.message?.includes('SIGINT') ||
(err as Error)?.message?.includes('force closed');
if (isExitPrompt) {
process.exit(130);
}
throw err;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { client, ContentstackClient, ContentstackConfig } from '@contentstack/ma
import authHandler from './auth-handler';
import { Agent } from 'node:https';
import configHandler, { default as configStore } from './config-handler';
import { getProxyConfig } from './proxy-helper';
import { getProxyConfigForHost, resolveRequestHost, clearProxyEnv } from './proxy-helper';
import dotenv from 'dotenv';

dotenv.config();
Expand All @@ -17,8 +17,15 @@ class ManagementSDKInitiator {
}

async createAPIClient(config): Promise<ContentstackClient> {
// Get proxy configuration with priority: Environment variables > Global config
const proxyConfig = getProxyConfig();
// Resolve host so NO_PROXY applies even when config.host is omitted (e.g. from region.cma)
const host = resolveRequestHost(config);
// NO_PROXY has priority over HTTP_PROXY/HTTPS_PROXY and config-set proxy
const proxyConfig = getProxyConfigForHost(host);

// When bypassing, clear proxy env immediately so SDK never see it (they may read at init or first request).
if (!proxyConfig) {
clearProxyEnv();
}

const option: ContentstackConfig = {
host: config.host,
Expand Down
23 changes: 20 additions & 3 deletions packages/contentstack-utilities/src/http-client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@ import { IHttpClient } from './client-interface';
import { HttpResponse } from './http-response';
import configStore from '../config-handler';
import authHandler from '../auth-handler';
import { hasProxy, getProxyUrl, getProxyConfig } from '../proxy-helper';
import { hasProxy, getProxyUrl, getProxyConfig, getProxyConfigForHost } from '../proxy-helper';

/**
* Derive request host from baseURL or url for NO_PROXY checks.
*/
function getRequestHost(baseURL?: string, url?: string): string | undefined {
const toTry = [baseURL, url].filter(Boolean) as string[];
for (const candidateUrl of toTry) {
try {
const parsed = new URL(candidateUrl.startsWith('http') ? candidateUrl : `https://${candidateUrl}`);
return parsed.hostname || undefined;
} catch {
// Invalid URL; try next candidate (baseURL or url)
}
}
return undefined;
}

export type HttpClientOptions = {
disableEarlyAccessHeaders?: boolean;
Expand Down Expand Up @@ -411,9 +427,10 @@ export class HttpClient implements IHttpClient {
}
}

// Configure proxy if available (priority: request.proxy > getProxyConfig())
// Configure proxy if available. NO_PROXY has priority: hosts in NO_PROXY never use proxy.
if (!this.request.proxy) {
const proxyConfig = getProxyConfig();
const host = getRequestHost(this.request.baseURL, url);
const proxyConfig = host ? getProxyConfigForHost(host) : getProxyConfig();
if (proxyConfig) {
this.request.proxy = proxyConfig;
}
Expand Down
Loading
Loading