Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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,817 changes: 1,389 additions & 1,428 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "1.18.0",
"version": "1.18.1",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand All @@ -19,7 +19,7 @@
],
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@oclif/plugin-plugins": "^5.4.54",
Expand Down
4 changes: 2 additions & 2 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": "1.7.3",
"version": "1.7.4",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -23,7 +23,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"otplib": "^12.0.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.18.4",
"version": "1.18.5",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -19,7 +19,7 @@
"@contentstack/cli-cm-seed": "~1.14.3",
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-config": "~1.19.0",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.37",
"inquirer": "8.2.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@contentstack/cli-cm-branches",
"description": "Contentstack CLI plugin to do branches operations",
"version": "1.6.3",
"version": "1.6.4",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"chalk": "^4.1.2",
"just-diff": "^6.0.2",
"lodash": "^4.17.23"
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-bulk-publish",
"description": "Contentstack CLI plugin for bulk publish actions",
"version": "1.10.7",
"version": "1.10.8",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-config": "~1.19.0",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.20.1",
"version": "1.20.2",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.23.2",
"@contentstack/cli-cm-import": "~1.31.3",
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
4 changes: 2 additions & 2 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": "1.7.2",
"version": "1.7.3",
"author": "Contentstack",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -19,7 +19,7 @@
"test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"contentstack": "^3.25.3",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28"
Expand Down
4 changes: 2 additions & 2 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": "1.19.0",
"version": "1.19.1",
"author": "Contentstack",
"scripts": {
"build": "npm run clean && npm run compile",
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@contentstack/utils": "~1.7.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-export-to-csv/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-export-to-csv",
"description": "Export entries, taxonomies, terms, or organization users to CSV",
"version": "1.11.0",
"version": "1.11.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@oclif/core": "^4.8.0",
"@oclif/plugin-help": "^6.2.32",
"fast-csv": "^4.3.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "1.23.2",
"version": "1.23.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@oclif/core": "^4.3.3",
"@contentstack/cli-variants": "~1.3.8",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"async": "^3.2.6",
"big-json": "^3.2.0",
"bluebird": "^3.7.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-import-setup/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-import-setup",
"description": "Contentstack CLI plugin to setup the mappers and configurations for the import command",
"version": "1.7.3",
"version": "1.7.4",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@oclif/core": "^4.3.0",
"big-json": "^3.2.0",
"chalk": "^4.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.31.3",
"version": "1.31.4",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-audit": "~1.18.0",
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@contentstack/cli-variants": "~1.3.8",
"@oclif/core": "^4.3.0",
"big-json": "^3.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-migrate-rte/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-migrate-rte",
"description": "Contentstack CLI plugin to migrate HTML RTE to JSON RTE",
"version": "1.6.4",
"version": "1.6.5",
"author": "contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@contentstack/json-rte-serializer": "~2.1.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-migration/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@contentstack/cli-migration",
"version": "1.11.0",
"version": "1.11.1",
"author": "@contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"async": "^3.2.6",
Expand Down Expand Up @@ -56,7 +56,7 @@
"postpack": "rm -f oclif.manifest.json",
"generate-api-ref-md-doc": "nyc jsdoc2md ./src/modules/*.ts > ./docs/api-reference.md || true",
"compile": "tsc -b tsconfig.json",
"prepack": "pnpm compile && oclif manifest && oclif readme",
"prepack": "rm -rf lib tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && pnpm compile && oclif manifest && oclif readme",
"pretest": "tsc -p test",
"test": "mocha --forbid-only \"test/unit/**/*.test.ts\"",
"test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\"",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-seed",
"description": "create a Stack from existing content types, entries, assets, etc.",
"version": "1.14.3",
"version": "1.14.4",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-cm-import": "~1.31.3",
"@contentstack/cli-command": "~1.7.2",
"@contentstack/cli-utilities": "~1.17.4",
"@contentstack/cli-utilities": "~1.18.0",
"inquirer": "8.2.7",
"mkdirp": "^1.0.4",
"tar": "^7.5.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-utilities",
"version": "1.17.4",
"version": "1.18.0",
"description": "Utilities for contentstack projects",
"main": "lib/index.js",
"types": "lib/index.d.ts",
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,11 +17,18 @@ 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/deps never see it (they may read at init or first request).
if (!proxyConfig) {
clearProxyEnv();
}

const option: ContentstackConfig = {
host: config.host,
host: config.host || host || undefined,
maxContentLength: config.maxContentLength || 100000000,
maxBodyLength: config.maxBodyLength || 1000000000,
maxRequests: 10,
Expand Down Expand Up @@ -112,6 +119,7 @@ class ManagementSDKInitiator {
if (proxyConfig) {
option.proxy = proxyConfig;
}
// When host is in NO_PROXY, do not add proxy to option at all
if (config.endpoint) {
option.endpoint = config.endpoint;
}
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 u of toTry) {
try {
const parsed = new URL(u.startsWith('http') ? u : `https://${u}`);
return parsed.hostname || undefined;
} catch {
// ignore
}
}
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