diff --git a/packages/contentstack-utilities/src/contentstack-management-sdk.ts b/packages/contentstack-utilities/src/contentstack-management-sdk.ts index 77600cc31f..9c029ff1fd 100644 --- a/packages/contentstack-utilities/src/contentstack-management-sdk.ts +++ b/packages/contentstack-utilities/src/contentstack-management-sdk.ts @@ -2,7 +2,12 @@ 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 { getProxyConfigForHost, resolveRequestHost, clearProxyEnv } from './proxy-helper'; +import { + getProxyConfigForHost, + resolveRequestHost, + clearProxyEnv, + shouldBypassProxy, +} from './proxy-helper'; import dotenv from 'dotenv'; dotenv.config(); @@ -118,6 +123,8 @@ class ManagementSDKInitiator { if (proxyConfig) { option.proxy = proxyConfig; + } else if (host && shouldBypassProxy(host)) { + option.proxy = false; } if (config.endpoint) { option.endpoint = config.endpoint; diff --git a/packages/contentstack-utilities/src/http-client/client.ts b/packages/contentstack-utilities/src/http-client/client.ts index 2fd213d2ed..a9a89104bb 100644 --- a/packages/contentstack-utilities/src/http-client/client.ts +++ b/packages/contentstack-utilities/src/http-client/client.ts @@ -1,481 +1,490 @@ -import Axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; -import { IHttpClient } from './client-interface'; -import { HttpResponse } from './http-response'; -import configStore from '../config-handler'; -import authHandler from '../auth-handler'; -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; -}; -export class HttpClient implements IHttpClient { - /** - * The request configuration. - */ - private request: AxiosRequestConfig; - - /** - * The request configuration. - */ - private readonly axiosInstance: AxiosInstance; - - private disableEarlyAccessHeaders: boolean; - - /** - * The payload format for a JSON or form-url-encoded request. - */ - private bodyFormat: BodyFormat = 'json'; - - /** - * Createa new pending HTTP request instance. - */ - constructor(request: AxiosRequestConfig = {}, options: HttpClientOptions = {}) { - this.request = request; - this.axiosInstance = Axios.create(); - this.disableEarlyAccessHeaders = options.disableEarlyAccessHeaders || false; - - // Sets payload format as json by default - this.asJson(); - } - - /** - * Create a reusable HttpClient instance. - * - * @returns {HttpClient} - */ - static create(request: AxiosRequestConfig = {}): HttpClient { - return new this(request); - } - - /** - * Returns the Axios request config. - * - * @returns {AxiosRequestConfig} - */ - requestConfig(): AxiosRequestConfig { - return this.request; - } - - /** - * Resets the request config. - * - * @returns {AxiosRequestConfig} - */ - resetConfig(): HttpClient { - this.request = {}; - return this; - } - - /** - * Use the given `baseUrl` for all requests. - * - * @param {String} baseUrl - * - * @returns {HttpClient} - */ - baseUrl(baseUrl: string): HttpClient { - if (typeof baseUrl !== 'string') { - throw new Error(`The base URL must be a string. Received "${typeof baseUrl}"`); - } - - this.request.baseURL = baseUrl; - - return this; - } - - /** - * Add request headers. - * @returns {HttpClient} - */ - headers(headers: any): HttpClient { - this.request.headers = { ...this.request.headers, ...headers }; - - return this; - } - - /** - * Add query parameters to the request. - * - * @param {Object} queryParams - * - * @returns {HttpClient} - */ - queryParams(queryParams: object): HttpClient { - this.request.params = { ...this.request.params, ...queryParams }; - - return this; - } - - /** - * Add basic authentication via `username` and `password` to the request. - * - * @param {String} username - * @param {String} password - * - * @returns {HttpClient} - */ - basicAuth(username: string, password: string): HttpClient { - this.request.auth = { username, password }; - - return this; - } - - /** - * Add an authorization `token` to the request. - * - * @param {String} token - * @param {String} type - * - * @returns {HttpClient} - */ - token(token: string, type: string = 'Bearer'): HttpClient { - return this.headers({ - Authorization: `${type} ${token}`.trim(), - }); - } - - /** - * Merge your own custom Axios options into the request. - * - * @param {Object} options - * - * @returns {HttpClient} - */ - options(options: AxiosRequestConfig = {}): HttpClient { - Object.assign(this.request, options); - - return this; - } - - /** - * Add a request payload. - * - * @param {*} data - * - * @returns {HttpClient} - */ - payload(data: any): HttpClient { - this.request.data = data; - - return this; - } - - /** - * Define the request `timeout` in milliseconds. - * - * @param {Number} timeout - * - * @returns {HttpClient} - */ - timeout(timeout: number): HttpClient { - this.request.timeout = timeout; - - return this; - } - - /** - * Tell HttpClient to send the request as JSON payload. - * - * @returns {HttpClient} - */ - asJson(): HttpClient { - return this.payloadFormat('json').contentType('application/json'); - } - - /** - * Tell HttpClient to send the request as form parameters, - * encoded as URL query parameters. - * - * @returns {HttpClient} - */ - asFormParams(): HttpClient { - return this.payloadFormat('formParams').contentType('application/x-www-form-urlencoded'); - } - - /** - * Set the request payload format. - * - * @param {String} format - * - * @returns {HttpClient} - */ - payloadFormat(format: BodyFormat): HttpClient { - this.bodyFormat = format; - - return this; - } - - /** - * Set the `Accept` request header. This indicates what - * content type the server should return. - * - * @param {String} accept - * - * @returns {HttpClient} - */ - accept(accept: string): HttpClient { - return this.headers({ Accept: accept }); - } - - /** - * Set the `Accept` request header to JSON. This indicates - * that the server should return JSON data. - * - * @param {String} accept - * - * @returns {HttpClient} - */ - acceptJson(): HttpClient { - return this.accept('application/json'); - } - - /** - * Set the `Content-Type` request header. - * - * @param {String} contentType - * - * @returns {HttpClient} - */ - contentType(contentType: string): HttpClient { - return this.headers({ 'Content-Type': contentType }); - } - - /** - * Send an HTTP GET request, optionally with the given `queryParams`. - * - * @param {String} url - * @param {Object} queryParams - * - * @returns {HttpResponse} - * - * @throws - */ - async get(url: string, queryParams: object = {}): Promise> { - this.queryParams(queryParams); - - return this.send('GET', url); - } - - /** - * Send an HTTP POST request, optionally with the given `payload`. - * - * @param {String} url - * @param {Object} payload - * - * @returns {HttpResponse} - * - * @throws - */ - async post(url: string, payload?: any): Promise> { - if (payload) { - this.payload(payload); - } - - return this.send('POST', url); - } - - /** - * Send an HTTP PUT request, optionally with the given `payload`. - * - * @param {String} url - * @param {Object} payload - * - * @returns {HttpResponse} - * - * @throws - */ - async put(url: string, payload?: any): Promise> { - if (payload) { - this.payload(payload); - } - - return this.send('PUT', url); - } - - /** - * Send an HTTP PATCH request, optionally with the given `payload`. - * - * @param {String} url - * @param {Object} payload - * - * @returns {HttpResponse} - * - * @throws - */ - async patch(url: string, payload?: any): Promise> { - if (payload) { - this.payload(payload); - } - - return this.send('PATCH', url); - } - - /** - * Send an HTTP DELETE request, optionally with the given `queryParams`. - * - * @param {String} url - * @param {Object} queryParams - * - * @returns {HttpResponse} - * - * @throws - */ - async delete(url: string, queryParams: object = {}): Promise> { - this.queryParams(queryParams); - - return this.send('DELETE', url); - } - - /** - * Send the HTTP request. - * - * @param {String} method - * @param {String} url - * - * @returns {HttpResponse} - * - * @throws - */ - async send(method: HttpMethod, url: string): Promise> { - try { - return new HttpResponse(await this.createAndSendRequest(method, url)); - } catch (error: any) { - if (error.response) { - return new HttpResponse(error.response); - } - - throw error; - } - } - - /** - * Create and send the HTTP request. - * - * @param {String} method - * @param {String} url - * - * @returns {Request} - */ - async createAndSendRequest(method: HttpMethod, url: string): Promise { - let counter = 0; - this.axiosInstance.interceptors.response.use(null, async (error) => { - const { message, response, code } = error; - - // Don't retry proxy connection errors - fail fast - const proxyErrorCodes = ['ECONNREFUSED', 'ETIMEDOUT', 'ENOTFOUND', 'ERR_BAD_RESPONSE']; - const isProxyConfigured = this.request.proxy || hasProxy(); - - if (isProxyConfigured && (proxyErrorCodes.includes(code) || message?.includes('ERR_BAD_RESPONSE'))) { - const proxyUrl = this.request.proxy && typeof this.request.proxy === 'object' - ? `${this.request.proxy.protocol}://${this.request.proxy.host}:${this.request.proxy.port}` - : getProxyUrl(); - - return Promise.reject(new Error(`Proxy error: Unable to connect to proxy server at ${proxyUrl}. Please verify your proxy configuration.`)); - } - - if (response?.data?.error_message?.includes('access token is invalid or expired')) { - const token = await this.refreshToken(); - this.headers({ ...this.request.headers, authorization: token.authorization }); - return await this.axiosInstance({ - url, - method, - withCredentials: true, - ...this.request, - data: this.prepareRequestPayload(), - }); - } - - if ( - !(message.includes('timeout') || message.includes('Network Error') || message.includes('getaddrinfo ENOTFOUND')) - ) { - return Promise.reject(error); - } - if (counter < 1) { - counter++; - return await this.axiosInstance({ - url, - method, - withCredentials: true, - ...this.request, - data: this.prepareRequestPayload(), - }); - } - return Promise.reject(error); - }); - - if (!this.disableEarlyAccessHeaders) { - // Add early access header by default - const earlyAccessHeaders = configStore.get(`earlyAccessHeaders`); - if (earlyAccessHeaders && Object.keys(earlyAccessHeaders).length > 0) { - this.headers({ 'x-header-ea': Object.values(earlyAccessHeaders).join(',') }); - } - } - - // Configure proxy if available. NO_PROXY has priority: hosts in NO_PROXY never use proxy. - if (!this.request.proxy) { - const host = getRequestHost(this.request.baseURL, url); - const proxyConfig = host ? getProxyConfigForHost(host) : getProxyConfig(); - if (proxyConfig) { - this.request.proxy = proxyConfig; - } - } - - return await this.axiosInstance({ - url, - method, - withCredentials: true, - ...this.request, - data: this.prepareRequestPayload(), - }); - } - - /** - * Get the axios instance for interceptor access - */ - get interceptors() { - return this.axiosInstance.interceptors; - } - - /** - * Returns the request payload depending on the selected request payload format. - */ - prepareRequestPayload(): any { - return this.bodyFormat === 'formParams' ? new URLSearchParams(this.request.data).toString() : this.request.data; - } - - async refreshToken() { - const authorisationType = configStore.get('authorisationType'); - if (authorisationType === 'BASIC') { - return Promise.reject('Your session is timed out, please login to proceed'); - } else if (authorisationType === 'OAUTH') { - return authHandler - .compareOAuthExpiry(true) - .then(() => Promise.resolve({ authorization: `Bearer ${configStore.get('oauthAccessToken')}` })) - .catch((error) => Promise.reject(error)); - } else { - return Promise.reject('You do not have permissions to perform this action, please login to proceed'); - } - } -} - -export interface HttpRequestConfig extends AxiosRequestConfig {} - -type BodyFormat = 'json' | 'formParams'; - -type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS'; +import Axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; +import { IHttpClient } from './client-interface'; +import { HttpResponse } from './http-response'; +import configStore from '../config-handler'; +import authHandler from '../auth-handler'; +import { + hasProxy, + getProxyUrl, + getProxyConfigForHost, + resolveRequestHost, + shouldBypassProxy, +} 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; +}; +export class HttpClient implements IHttpClient { + /** + * The request configuration. + */ + private request: AxiosRequestConfig; + + /** + * The request configuration. + */ + private readonly axiosInstance: AxiosInstance; + + private disableEarlyAccessHeaders: boolean; + + /** + * The payload format for a JSON or form-url-encoded request. + */ + private bodyFormat: BodyFormat = 'json'; + + /** + * Createa new pending HTTP request instance. + */ + constructor(request: AxiosRequestConfig = {}, options: HttpClientOptions = {}) { + this.request = request; + this.axiosInstance = Axios.create(); + this.disableEarlyAccessHeaders = options.disableEarlyAccessHeaders || false; + + // Sets payload format as json by default + this.asJson(); + } + + /** + * Create a reusable HttpClient instance. + * + * @returns {HttpClient} + */ + static create(request: AxiosRequestConfig = {}): HttpClient { + return new this(request); + } + + /** + * Returns the Axios request config. + * + * @returns {AxiosRequestConfig} + */ + requestConfig(): AxiosRequestConfig { + return this.request; + } + + /** + * Resets the request config. + * + * @returns {AxiosRequestConfig} + */ + resetConfig(): HttpClient { + this.request = {}; + return this; + } + + /** + * Use the given `baseUrl` for all requests. + * + * @param {String} baseUrl + * + * @returns {HttpClient} + */ + baseUrl(baseUrl: string): HttpClient { + if (typeof baseUrl !== 'string') { + throw new Error(`The base URL must be a string. Received "${typeof baseUrl}"`); + } + + this.request.baseURL = baseUrl; + + return this; + } + + /** + * Add request headers. + * @returns {HttpClient} + */ + headers(headers: any): HttpClient { + this.request.headers = { ...this.request.headers, ...headers }; + + return this; + } + + /** + * Add query parameters to the request. + * + * @param {Object} queryParams + * + * @returns {HttpClient} + */ + queryParams(queryParams: object): HttpClient { + this.request.params = { ...this.request.params, ...queryParams }; + + return this; + } + + /** + * Add basic authentication via `username` and `password` to the request. + * + * @param {String} username + * @param {String} password + * + * @returns {HttpClient} + */ + basicAuth(username: string, password: string): HttpClient { + this.request.auth = { username, password }; + + return this; + } + + /** + * Add an authorization `token` to the request. + * + * @param {String} token + * @param {String} type + * + * @returns {HttpClient} + */ + token(token: string, type: string = 'Bearer'): HttpClient { + return this.headers({ + Authorization: `${type} ${token}`.trim(), + }); + } + + /** + * Merge your own custom Axios options into the request. + * + * @param {Object} options + * + * @returns {HttpClient} + */ + options(options: AxiosRequestConfig = {}): HttpClient { + Object.assign(this.request, options); + + return this; + } + + /** + * Add a request payload. + * + * @param {*} data + * + * @returns {HttpClient} + */ + payload(data: any): HttpClient { + this.request.data = data; + + return this; + } + + /** + * Define the request `timeout` in milliseconds. + * + * @param {Number} timeout + * + * @returns {HttpClient} + */ + timeout(timeout: number): HttpClient { + this.request.timeout = timeout; + + return this; + } + + /** + * Tell HttpClient to send the request as JSON payload. + * + * @returns {HttpClient} + */ + asJson(): HttpClient { + return this.payloadFormat('json').contentType('application/json'); + } + + /** + * Tell HttpClient to send the request as form parameters, + * encoded as URL query parameters. + * + * @returns {HttpClient} + */ + asFormParams(): HttpClient { + return this.payloadFormat('formParams').contentType('application/x-www-form-urlencoded'); + } + + /** + * Set the request payload format. + * + * @param {String} format + * + * @returns {HttpClient} + */ + payloadFormat(format: BodyFormat): HttpClient { + this.bodyFormat = format; + + return this; + } + + /** + * Set the `Accept` request header. This indicates what + * content type the server should return. + * + * @param {String} accept + * + * @returns {HttpClient} + */ + accept(accept: string): HttpClient { + return this.headers({ Accept: accept }); + } + + /** + * Set the `Accept` request header to JSON. This indicates + * that the server should return JSON data. + * + * @param {String} accept + * + * @returns {HttpClient} + */ + acceptJson(): HttpClient { + return this.accept('application/json'); + } + + /** + * Set the `Content-Type` request header. + * + * @param {String} contentType + * + * @returns {HttpClient} + */ + contentType(contentType: string): HttpClient { + return this.headers({ 'Content-Type': contentType }); + } + + /** + * Send an HTTP GET request, optionally with the given `queryParams`. + * + * @param {String} url + * @param {Object} queryParams + * + * @returns {HttpResponse} + * + * @throws + */ + async get(url: string, queryParams: object = {}): Promise> { + this.queryParams(queryParams); + + return this.send('GET', url); + } + + /** + * Send an HTTP POST request, optionally with the given `payload`. + * + * @param {String} url + * @param {Object} payload + * + * @returns {HttpResponse} + * + * @throws + */ + async post(url: string, payload?: any): Promise> { + if (payload) { + this.payload(payload); + } + + return this.send('POST', url); + } + + /** + * Send an HTTP PUT request, optionally with the given `payload`. + * + * @param {String} url + * @param {Object} payload + * + * @returns {HttpResponse} + * + * @throws + */ + async put(url: string, payload?: any): Promise> { + if (payload) { + this.payload(payload); + } + + return this.send('PUT', url); + } + + /** + * Send an HTTP PATCH request, optionally with the given `payload`. + * + * @param {String} url + * @param {Object} payload + * + * @returns {HttpResponse} + * + * @throws + */ + async patch(url: string, payload?: any): Promise> { + if (payload) { + this.payload(payload); + } + + return this.send('PATCH', url); + } + + /** + * Send an HTTP DELETE request, optionally with the given `queryParams`. + * + * @param {String} url + * @param {Object} queryParams + * + * @returns {HttpResponse} + * + * @throws + */ + async delete(url: string, queryParams: object = {}): Promise> { + this.queryParams(queryParams); + + return this.send('DELETE', url); + } + + /** + * Send the HTTP request. + * + * @param {String} method + * @param {String} url + * + * @returns {HttpResponse} + * + * @throws + */ + async send(method: HttpMethod, url: string): Promise> { + try { + return new HttpResponse(await this.createAndSendRequest(method, url)); + } catch (error: any) { + if (error.response) { + return new HttpResponse(error.response); + } + + throw error; + } + } + + /** + * Create and send the HTTP request. + * + * @param {String} method + * @param {String} url + * + * @returns {Request} + */ + async createAndSendRequest(method: HttpMethod, url: string): Promise { + let counter = 0; + this.axiosInstance.interceptors.response.use(null, async (error) => { + const { message, response, code } = error; + + // Don't retry proxy connection errors - fail fast + const proxyErrorCodes = ['ECONNREFUSED', 'ETIMEDOUT', 'ENOTFOUND', 'ERR_BAD_RESPONSE']; + const isProxyConfigured = this.request.proxy || hasProxy(); + + if (isProxyConfigured && (proxyErrorCodes.includes(code) || message?.includes('ERR_BAD_RESPONSE'))) { + const proxyUrl = this.request.proxy && typeof this.request.proxy === 'object' + ? `${this.request.proxy.protocol}://${this.request.proxy.host}:${this.request.proxy.port}` + : getProxyUrl(); + + return Promise.reject(new Error(`Proxy error: Unable to connect to proxy server at ${proxyUrl}. Please verify your proxy configuration.`)); + } + + if (response?.data?.error_message?.includes('access token is invalid or expired')) { + const token = await this.refreshToken(); + this.headers({ ...this.request.headers, authorization: token.authorization }); + return await this.axiosInstance({ + url, + method, + withCredentials: true, + ...this.request, + data: this.prepareRequestPayload(), + }); + } + + if ( + !(message.includes('timeout') || message.includes('Network Error') || message.includes('getaddrinfo ENOTFOUND')) + ) { + return Promise.reject(error); + } + if (counter < 1) { + counter++; + return await this.axiosInstance({ + url, + method, + withCredentials: true, + ...this.request, + data: this.prepareRequestPayload(), + }); + } + return Promise.reject(error); + }); + + if (!this.disableEarlyAccessHeaders) { + // Add early access header by default + const earlyAccessHeaders = configStore.get(`earlyAccessHeaders`); + if (earlyAccessHeaders && Object.keys(earlyAccessHeaders).length > 0) { + this.headers({ 'x-header-ea': Object.values(earlyAccessHeaders).join(',') }); + } + } + + // Configure proxy if available. NO_PROXY has priority: hosts in NO_PROXY never use proxy. + // Resolve host from the request URL and fall back to region CMA so NO_PROXY applies when baseURL/url omit hostname. + if (!this.request.proxy) { + const host = getRequestHost(this.request.baseURL, url) || resolveRequestHost({}); + const proxyConfig = getProxyConfigForHost(host); + if (proxyConfig) { + this.request.proxy = proxyConfig; + } else if (host && shouldBypassProxy(host)) { + this.request.proxy = false; + } + } + + return await this.axiosInstance({ + url, + method, + withCredentials: true, + ...this.request, + data: this.prepareRequestPayload(), + }); + } + + /** + * Get the axios instance for interceptor access + */ + get interceptors() { + return this.axiosInstance.interceptors; + } + + /** + * Returns the request payload depending on the selected request payload format. + */ + prepareRequestPayload(): any { + return this.bodyFormat === 'formParams' ? new URLSearchParams(this.request.data).toString() : this.request.data; + } + + async refreshToken() { + const authorisationType = configStore.get('authorisationType'); + if (authorisationType === 'BASIC') { + return Promise.reject('Your session is timed out, please login to proceed'); + } else if (authorisationType === 'OAUTH') { + return authHandler + .compareOAuthExpiry(true) + .then(() => Promise.resolve({ authorization: `Bearer ${configStore.get('oauthAccessToken')}` })) + .catch((error) => Promise.reject(error)); + } else { + return Promise.reject('You do not have permissions to perform this action, please login to proceed'); + } + } +} + +export interface HttpRequestConfig extends AxiosRequestConfig {} + +type BodyFormat = 'json' | 'formParams'; + +type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS'; diff --git a/packages/contentstack-utilities/src/proxy-helper.ts b/packages/contentstack-utilities/src/proxy-helper.ts index 68de79fc8d..4c1863ad25 100644 --- a/packages/contentstack-utilities/src/proxy-helper.ts +++ b/packages/contentstack-utilities/src/proxy-helper.ts @@ -81,81 +81,71 @@ export function shouldBypassProxy(host: string): boolean { return false; } +function proxyConfigFromUrlString(proxyUrl: string): ProxyConfig | undefined { + try { + const url = new URL(proxyUrl); + const defaultPort = url.protocol === 'https:' ? 443 : 80; + const port = url.port ? Number.parseInt(url.port, 10) : defaultPort; + + if (Number.isNaN(port) || port < 1 || port > 65535) { + return undefined; + } + + const protocol = url.protocol.replace(':', '') as 'http' | 'https'; + const proxyConfig: ProxyConfig = { + protocol, + host: url.hostname, + port, + }; + + if (url.username || url.password) { + proxyConfig.auth = { + username: url.username, + password: url.password, + }; + } + + return proxyConfig; + } catch { + return undefined; + } +} + +function proxyFromGlobalStore(): ProxyConfig | undefined { + const globalProxyConfig = configStore.get('proxy'); + if (!globalProxyConfig) { + return undefined; + } + if (typeof globalProxyConfig === 'object') { + const port = globalProxyConfig.port; + if (port !== undefined && !Number.isNaN(port) && port >= 1 && port <= 65535) { + return globalProxyConfig as ProxyConfig; + } + return undefined; + } + if (typeof globalProxyConfig === 'string') { + return proxyConfigFromUrlString(globalProxyConfig); + } + return undefined; +} + /** - * Get proxy configuration. Sources (in order): env (HTTP_PROXY/HTTPS_PROXY), then global config - * from `csdx config:set:proxy --host --port --protocol `. + * Get proxy configuration. Sources (in order): global config from + * `csdx config:set:proxy`, then environment (HTTPS_PROXY / HTTP_PROXY). * For per-request use, prefer getProxyConfigForHost(host) so NO_PROXY overrides both sources. * @returns ProxyConfig object or undefined if no proxy is configured */ export function getProxyConfig(): ProxyConfig | undefined { - // Priority 1: Environment variables (HTTPS_PROXY or HTTP_PROXY) + const fromGlobal = proxyFromGlobalStore(); + if (fromGlobal) { + return fromGlobal; + } + const proxyUrl = process.env.HTTPS_PROXY || process.env.HTTP_PROXY; - if (proxyUrl) { - try { - const url = new URL(proxyUrl); - const defaultPort = url.protocol === 'https:' ? 443 : 80; - const port = url.port ? Number.parseInt(url.port, 10) : defaultPort; - - if (!Number.isNaN(port) && port >= 1 && port <= 65535) { - const protocol = url.protocol.replace(':', '') as 'http' | 'https'; - const proxyConfig: ProxyConfig = { - protocol: protocol, - host: url.hostname, - port: port, - }; - - if (url.username || url.password) { - proxyConfig.auth = { - username: url.username, - password: url.password, - }; - } - - return proxyConfig; - } - } catch { - // Invalid URL, continue to check global config - } + return proxyConfigFromUrlString(proxyUrl); } - - // Priority 2: Global config (csdx config:set:proxy) - const globalProxyConfig = configStore.get('proxy'); - if (globalProxyConfig) { - if (typeof globalProxyConfig === 'object') { - const port = globalProxyConfig.port; - if (port !== undefined && !Number.isNaN(port) && port >= 1 && port <= 65535) { - return globalProxyConfig as ProxyConfig; - } - } else if (typeof globalProxyConfig === 'string') { - try { - const url = new URL(globalProxyConfig); - const defaultPort = url.protocol === 'https:' ? 443 : 80; - const port = url.port ? Number.parseInt(url.port, 10) : defaultPort; - - if (!Number.isNaN(port) && port >= 1 && port <= 65535) { - const protocol = url.protocol.replace(':', '') as 'http' | 'https'; - const proxyConfig: ProxyConfig = { - protocol: protocol, - host: url.hostname, - port: port, - }; - - if (url.username || url.password) { - proxyConfig.auth = { - username: url.username, - password: url.password, - }; - } - - return proxyConfig; - } - } catch { - // Invalid URL, return undefined - } - } - } - + return undefined; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cf86254a2a..a6afc4630a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,59 +18,59 @@ importers: packages/contentstack: dependencies: '@contentstack/cli-audit': - specifier: ~1.19.0-beta.0 - version: 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.19.0-beta.1 + version: 1.19.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-auth': - specifier: ~1.8.0-beta.0 + specifier: ~1.8.0-beta.1 version: link:../contentstack-auth '@contentstack/cli-cm-bootstrap': - specifier: ~1.19.0-beta.0 - version: 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.19.0-beta.1 + version: 1.19.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-cm-branches': - specifier: ~1.7.0-beta.0 - version: 1.7.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.7.0-beta.1 + version: 1.7.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-cm-bulk-publish': - specifier: ~1.11.0-beta.0 - version: 1.11.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.11.0-beta.1 + version: 1.11.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-cm-clone': - specifier: ~1.21.0-beta.0 - version: 1.21.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.21.0-beta.1 + version: 1.21.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-cm-export': - specifier: ~1.24.0-beta.0 - version: 1.24.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.24.0-beta.1 + version: 1.24.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-cm-export-to-csv': - specifier: ~1.12.0-beta.0 - version: 1.12.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.12.0-beta.1 + version: 1.12.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-cm-import': - specifier: ~1.32.0-beta.0 - version: 1.32.0-beta.0(@types/node@14.18.63) + specifier: ~1.32.0-beta.1 + version: 1.32.0-beta.1(@types/node@14.18.63) '@contentstack/cli-cm-import-setup': - specifier: ~1.8.0-beta.0 - version: 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.8.0-beta.1 + version: 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-cm-migrate-rte': specifier: ~1.6.4 version: 1.6.4(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-cm-seed': - specifier: ~1.15.0-beta.0 - version: 1.15.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.15.0-beta.1 + version: 1.15.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-command': - specifier: ~1.8.0-beta.0 + specifier: ~1.8.0-beta.1 version: link:../contentstack-command '@contentstack/cli-config': - specifier: ~1.20.0-beta.0 + specifier: ~1.20.0-beta.1 version: link:../contentstack-config '@contentstack/cli-launch': specifier: ^1.9.6 version: 1.9.6(@types/node@14.18.63)(debug@4.4.3)(tslib@2.8.1)(typescript@4.9.5) '@contentstack/cli-migration': - specifier: ~1.12.0-beta.0 - version: 1.12.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.12.0-beta.1 + version: 1.12.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/cli-utilities': - specifier: ~1.18.0-beta.0 - version: 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.19.0-beta.0 + version: link:../contentstack-utilities '@contentstack/cli-variants': - specifier: ~1.4.0-beta.0 - version: 1.4.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + specifier: ~1.4.0-beta.1 + version: 1.4.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@contentstack/management': specifier: ~1.27.5 version: 1.27.6(debug@4.4.3) @@ -819,61 +819,61 @@ packages: resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} engines: {node: '>=0.1.90'} - '@contentstack/cli-audit@1.19.0-beta.0': - resolution: {integrity: sha512-uO4BYdMdEmSXO+2r8Sjf2NfHkqWjx69WuMi/sJQzuWEK7l/BppjL6a/sKepGINaylbkz11yA1TZFT5IW/K2wBA==} + '@contentstack/cli-audit@1.19.0-beta.1': + resolution: {integrity: sha512-09xNCNX01YR5fxGuyrDY1LgQiPlpAJPjB4dtIguMAjR9Vov9m+EUNbGTALWFKVZKpoInYxVHWJ/JH5aKI15pBg==} engines: {node: '>=16'} hasBin: true - '@contentstack/cli-cm-bootstrap@1.19.0-beta.0': - resolution: {integrity: sha512-FKFNLQjuX6R6Ywg2fFndnVmL9t/KfaYIcLRRPxWgRMrgbxAYwKpCa77pu/DzxaKMUvPS9J99Ek8cHHwMZ0SN7A==} + '@contentstack/cli-cm-bootstrap@1.19.0-beta.1': + resolution: {integrity: sha512-Dlj/BgzuBLzQKgd/WNREWdOVf35SrK2eydfe/06XV1MUrFAbBJuTRxl+U4/6QSv2+ZaxuREpq8u79vkriXT+Aw==} engines: {node: '>=14.0.0'} - '@contentstack/cli-cm-branches@1.7.0-beta.0': - resolution: {integrity: sha512-Ght08vXubRZM9hOEoauotptFxyLR9x0czQLtv+lCzXrvuDQSJp+/ll4+6hSE97/VG2kM+F/LbLvI8Xey/if3Qw==} + '@contentstack/cli-cm-branches@1.7.0-beta.1': + resolution: {integrity: sha512-YvfXmBXx4fK82J8jFr8Xt6CzoMMK6q9kI+NC8Rf1/mI+KO+sM5xemS+qqWhzYHs+yN/9lfZoT3ZfCjY5mCGy/g==} engines: {node: '>=14.0.0'} - '@contentstack/cli-cm-bulk-publish@1.11.0-beta.0': - resolution: {integrity: sha512-H44N+EBkdWXMMkiWHCamDHtrZan+g8JQTxUEKuZUAKjE4B3B+X/qfBDRCQpdAznJo8mexiL86whg8dirwd7+YA==} + '@contentstack/cli-cm-bulk-publish@1.11.0-beta.1': + resolution: {integrity: sha512-8hq5VwF2PXiVsYAyyRecg93S4w6ePR0BIICRzXwpcbdh6p6CA+QjUGRB4xbJsq57CHgytjEdkVgirTmPYPTnmg==} engines: {node: '>=14.0.0'} - '@contentstack/cli-cm-clone@1.21.0-beta.0': - resolution: {integrity: sha512-14wmr2nLPbNBWuBAZCchSWWEHMVbxGHIHKd+PQcxbNIywmLF+TBrq/moj+BJk7x3L0mAfFRnx+R7X6qyiYaBtw==} + '@contentstack/cli-cm-clone@1.21.0-beta.1': + resolution: {integrity: sha512-Hma48qEJw8M/ithb+E2oEr47UVVtNQsd6nzMiVF9seqDfDqeYeLzjWjfeK8+37Wm5rGmXB58ssBxK1sOBuPxAQ==} engines: {node: '>=14.0.0'} - '@contentstack/cli-cm-export-to-csv@1.12.0-beta.0': - resolution: {integrity: sha512-uSs8PP9hnr8BlpKecgi01Fm8FzG41rkGScoGpxgk2zFlyziwHBg7bauKrSWM0R95RnmvrsWnMQF79zml3lHdJQ==} + '@contentstack/cli-cm-export-to-csv@1.12.0-beta.1': + resolution: {integrity: sha512-3ZcAjq1KnLxP6KZ6LE6m9ynpBucxUFGVJ/Xu2Zgp9LFA0NcywXF7m6+54ycDlK1TB6uURwwX70nuALfBhD+YKw==} engines: {node: '>=18.0.0'} - '@contentstack/cli-cm-export@1.24.0-beta.0': - resolution: {integrity: sha512-sGT1NMBrJ136bcsQZHC1Cnepub5Pgdw+NkUCvZFuB5hhepzSEv4ggJAJa53ETzFlaBdbSmUJpg5/zd/9zY3tUA==} + '@contentstack/cli-cm-export@1.24.0-beta.1': + resolution: {integrity: sha512-DWoM0P540E5BXJdm79gpTwaOBCZVLudbm3k9DEQ0Q4GobCrOkP7K6p9b3BRp1FtSXWxELqJzJQJvu5li49ZBvQ==} engines: {node: '>=14.0.0'} - '@contentstack/cli-cm-import-setup@1.8.0-beta.0': - resolution: {integrity: sha512-S04EvTE/D2uZuptGM0WSPF+1lP8dRLrpBeXyEYPlcOSLMBdMyNrHY/SCK6AcuJbCMYvIM10zknlpYuPpwbDXKQ==} + '@contentstack/cli-cm-import-setup@1.8.0-beta.1': + resolution: {integrity: sha512-dLMHzAA2pldHStIOxs3RvJZwO9lRdX4EOL6lPHyHRCz3k5K6JzwtUAZhu/Chf/IlvD/GuseV7KeWIa3RCHH3Pw==} engines: {node: '>=14.0.0'} - '@contentstack/cli-cm-import@1.32.0-beta.0': - resolution: {integrity: sha512-i60DfjDqa+8oADSx+FloQdq4zVBUlTp/NGtjdWcnSFXn3LF84WWckZunI1dmEL1ObK2K8e5biyMRVgJJsRV1Xw==} + '@contentstack/cli-cm-import@1.32.0-beta.1': + resolution: {integrity: sha512-GylQIftiP+gvchTmJZOyWLqEfwgsH1tFUKichRC4PL9PPNvSB/k24QWZ6MO5FNdkCEmvWIHeiyduAwIVuMQMug==} engines: {node: '>=14.0.0'} '@contentstack/cli-cm-migrate-rte@1.6.4': resolution: {integrity: sha512-TKswWWtq+DmUDXv+Fx88vxBAhS3kqfBoRXIOGJQNIdpQzHzaLxiCyOdmcCFyK1YhYDWzU19ad/s0GLBlv0D8fg==} engines: {node: '>=14.0.0'} - '@contentstack/cli-cm-seed@1.15.0-beta.0': - resolution: {integrity: sha512-5eYxRr1KWIHPtle+7mi8f2SyU1qsQ77L0oMNGV4GN+kcZy9zopMupLooG/a4Rg9odgzXzrtr/Ad8OGJasy3XOw==} + '@contentstack/cli-cm-seed@1.15.0-beta.1': + resolution: {integrity: sha512-qUsiryoqzgWXzzOJGANNkPbuRgkMjKdf/YpIDWtKvlrLHTCiJjhOCkPjhPUBukM5/mHWyKvejpNX0hrl1DHftw==} engines: {node: '>=14.0.0'} '@contentstack/cli-command@1.7.2': resolution: {integrity: sha512-dtXc3gIcnivfLegADy5/PZb+1x/esZ65H2E1CjO/pg50UC8Vy1U+U0ozS0hJZTFoaVjeG+1VJRoxf5MrtUGnNA==} engines: {node: '>=14.0.0'} - '@contentstack/cli-command@1.8.0-beta.0': - resolution: {integrity: sha512-BPBwABvpea16dQIBJT+YFjBUFpo9Nq+8D79F2ycjpDUkZh1P/2rDCypD6EGB1LY+F+1KX0kWRNQNlcqrz7AMNg==} + '@contentstack/cli-command@1.8.0-beta.1': + resolution: {integrity: sha512-36SpO377yd5WeMdRlosCMcsUwmwzt0PJW9YUbVKfLNPhNgz1VvRMdmWVBt4YzL45JtOd7ESdKZJBfsyRePE/Jw==} engines: {node: '>=14.0.0'} - '@contentstack/cli-config@1.20.0-beta.0': - resolution: {integrity: sha512-V3KMwiM74U2JL/QeNl9uqgN9q5mybRvcT8gLSt3s809BYMacfw8GWOEk9wIyVLziWD95LA5/ZklW8ENe1PpCiA==} + '@contentstack/cli-config@1.20.0-beta.1': + resolution: {integrity: sha512-jlIKeB8COxX7TtTD1tlEfOxqNqEqnlQgcWRa0E3pMVlchxhO2p6tEAbMXR5nzkJuusojKUqlWSjLDwT1Iclo0Q==} engines: {node: '>=14.0.0'} '@contentstack/cli-launch@1.9.6': @@ -881,18 +881,18 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - '@contentstack/cli-migration@1.12.0-beta.0': - resolution: {integrity: sha512-/jP+T5EbkLXMM5NPY1dRTrA6NnptHZjPP6g6x8fKaKGRCz4QNFn6FECCTZjlCIY/i1F2f+JPKSApQU98d07+bQ==} + '@contentstack/cli-migration@1.12.0-beta.1': + resolution: {integrity: sha512-BkI0k4TASeqnTd5GwdZ4z9Zm4Ut4ELZFZ1ZykrbmGuoJQJ8x1H2jjOuj12TM390covccuILBEhTjQtrz+XrrTg==} engines: {node: '>=8.3.0'} '@contentstack/cli-utilities@1.17.4': resolution: {integrity: sha512-45Ujy0lNtQiU0FhZrtfGEfte4kjy3tlOnlVz6REH+cW/y1Dgg1nMh+YVgygbOh+6b8PkvTYVlEvb15UxRarNiA==} - '@contentstack/cli-utilities@1.18.0-beta.0': - resolution: {integrity: sha512-3MyfkRUsj8RdctA5Oaz6aUOBSYaAh3H0A2IkIZQaCuaoBXzzy6V5Nm7uMX/QPdCEqrFe5YbNpNzSNW39i3bzGg==} + '@contentstack/cli-utilities@1.19.0-beta.0': + resolution: {integrity: sha512-yralWYC0Lw/+jjgBwetMUXXZN9gQa8OA9TphnIlNgpJjeGk2Pc/jGKTbeJk5oQBVfUsjsXaa4WGFsxs4X99wwg==} - '@contentstack/cli-variants@1.4.0-beta.0': - resolution: {integrity: sha512-sd0aNBkKHm9g9p3xqdZf85vz3cWxafVMyhEZ7kUTw9c5M8CBJvQ32Syet4PT9KMXpp/kYLBxrqt1IYyK5isN4A==} + '@contentstack/cli-variants@1.4.0-beta.1': + resolution: {integrity: sha512-RY6lsK1vqt0D+LmP5SCVXk7wNBjtOwm71qz7iRSTfY/kizSxLyvJeFkhQ0ZBMFg78UnWM4clc2c5QF9ksEFE8w==} '@contentstack/json-rte-serializer@2.1.0': resolution: {integrity: sha512-klw+0kH5UtL4mHGDP7A8olZIaA4CoyAVzveYqso8uxeDXKkTvwF8D5HBhCqQLr0NXwhofl+FF431cbzGZ3TNCg==} @@ -5370,8 +5370,8 @@ packages: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} - tar@7.5.10: - resolution: {integrity: sha512-8mOPs1//5q/rlkNSPcCegA6hiHJYDmSLEI8aMH/CdSQJNWztHC9WHNam5zdQlfpTwB9Xp7IBEsHfV5LKMJGVAw==} + tar@7.5.12: + resolution: {integrity: sha512-9TsuLcdhOn4XztcQqhNyq1KOwOOED/3k58JAvtULiYqbO8B/0IBAAIE1hj0Svmm58k27TmcigyDI0deMlgG3uw==} engines: {node: '>=18'} test-exclude@6.0.0: @@ -6467,10 +6467,10 @@ snapshots: '@colors/colors@1.6.0': {} - '@contentstack/cli-audit@1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-audit@1.19.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 '@oclif/plugin-plugins': 5.4.56 @@ -6485,26 +6485,26 @@ snapshots: - debug - supports-color - '@contentstack/cli-cm-bootstrap@1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-cm-bootstrap@1.19.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-cm-seed': 1.15.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-config': 1.20.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-cm-seed': 1.15.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-config': 1.20.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 inquirer: 8.2.7(@types/node@14.18.63) mkdirp: 1.0.4 - tar: 7.5.10 + tar: 7.5.12 transitivePeerDependencies: - '@types/node' - debug - supports-color - '@contentstack/cli-cm-branches@1.7.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-cm-branches@1.7.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 chalk: 4.1.2 @@ -6514,11 +6514,11 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-cm-bulk-publish@1.11.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-cm-bulk-publish@1.11.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-config': 1.20.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-config': 1.20.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 chalk: 4.1.2 @@ -6530,13 +6530,13 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-cm-clone@1.21.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-cm-clone@1.21.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: '@colors/colors': 1.6.0 - '@contentstack/cli-cm-export': 1.24.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-cm-import': 1.32.0-beta.0(@types/node@14.18.63) - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-cm-export': 1.24.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-cm-import': 1.32.0-beta.1(@types/node@14.18.63) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 chalk: 4.1.2 @@ -6551,10 +6551,10 @@ snapshots: - debug - supports-color - '@contentstack/cli-cm-export-to-csv@1.12.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-cm-export-to-csv@1.12.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 fast-csv: 4.3.6 @@ -6565,11 +6565,11 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-cm-export@1.24.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-cm-export@1.24.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-variants': 1.4.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-variants': 1.4.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 async: 3.2.6 big-json: 3.2.0 @@ -6585,10 +6585,10 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-cm-import-setup@1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-cm-import-setup@1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 big-json: 3.2.0 chalk: 4.1.2 @@ -6601,12 +6601,12 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-cm-import@1.32.0-beta.0(@types/node@14.18.63)': + '@contentstack/cli-cm-import@1.32.0-beta.1(@types/node@14.18.63)': dependencies: - '@contentstack/cli-audit': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-variants': 1.4.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-audit': 1.19.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-variants': 1.4.0-beta.1(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 big-json: 3.2.0 bluebird: 3.7.2 @@ -6647,14 +6647,14 @@ snapshots: - supports-color - utf-8-validate - '@contentstack/cli-cm-seed@1.15.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-cm-seed@1.15.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-cm-import': 1.32.0-beta.0(@types/node@14.18.63) - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-cm-import': 1.32.0-beta.1(@types/node@14.18.63) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) inquirer: 8.2.7(@types/node@14.18.63) mkdirp: 1.0.4 - tar: 7.5.10 + tar: 7.5.12 tmp: 0.2.5 transitivePeerDependencies: - '@types/node' @@ -6671,9 +6671,9 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-command@1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-command@1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 contentstack: 3.26.4 @@ -6681,10 +6681,10 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-config@1.20.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-config@1.20.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@contentstack/utils': 1.7.1 '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 @@ -6731,10 +6731,10 @@ snapshots: - tslib - typescript - '@contentstack/cli-migration@1.12.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-migration@1.12.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-command': 1.8.0-beta.0(@types/node@14.18.63)(debug@4.4.3) - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-command': 1.8.0-beta.1(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 async: 3.2.6 @@ -6785,7 +6785,7 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-utilities@1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-utilities@1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': dependencies: '@contentstack/management': 1.27.6(debug@4.4.3) '@contentstack/marketplace-sdk': 1.5.0(debug@4.4.3) @@ -6820,9 +6820,9 @@ snapshots: - '@types/node' - debug - '@contentstack/cli-variants@1.4.0-beta.0(@types/node@14.18.63)(debug@4.4.3)': + '@contentstack/cli-variants@1.4.0-beta.1(@types/node@14.18.63)(debug@4.4.3)': dependencies: - '@contentstack/cli-utilities': 1.18.0-beta.0(@types/node@14.18.63)(debug@4.4.3) + '@contentstack/cli-utilities': 1.19.0-beta.0(@types/node@14.18.63)(debug@4.4.3) '@oclif/core': 4.8.3 '@oclif/plugin-help': 6.2.37 lodash: 4.17.23 @@ -9226,8 +9226,8 @@ snapshots: '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5) '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@4.9.5) eslint-config-xo-space: 0.35.0(eslint@8.57.1) - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@8.57.1) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1) eslint-plugin-mocha: 10.5.0(eslint@8.57.1) eslint-plugin-n: 15.7.0(eslint@8.57.1) eslint-plugin-perfectionist: 2.11.0(eslint@8.57.1)(typescript@4.9.5) @@ -9262,8 +9262,8 @@ snapshots: eslint-config-oclif: 5.2.2(eslint@8.57.1) eslint-config-xo: 0.49.0(eslint@8.57.1) eslint-config-xo-space: 0.35.0(eslint@8.57.1) - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) eslint-plugin-jsdoc: 50.8.0(eslint@8.57.1) eslint-plugin-mocha: 10.5.0(eslint@8.57.1) eslint-plugin-n: 17.24.0(eslint@8.57.1)(typescript@4.9.5) @@ -9304,7 +9304,22 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1): + eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1): + dependencies: + '@nolyfill/is-core-module': 1.0.39 + debug: 4.4.3(supports-color@8.1.1) + eslint: 8.57.1 + get-tsconfig: 4.13.6 + is-bun-module: 2.0.0 + stable-hash: 0.0.5 + tinyglobby: 0.2.15 + unrs-resolver: 1.11.1 + optionalDependencies: + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + transitivePeerDependencies: + - supports-color + + eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@8.57.1): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.3(supports-color@8.1.1) @@ -9315,29 +9330,29 @@ snapshots: tinyglobby: 0.2.15 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-module-utils@2.12.1(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@4.9.5) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@8.57.1) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.56.1(eslint@8.57.1)(typescript@4.9.5) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1) transitivePeerDependencies: - supports-color @@ -9354,7 +9369,7 @@ snapshots: eslint-utils: 2.1.0 regexpp: 3.2.0 - eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -9365,7 +9380,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -9383,7 +9398,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -9394,7 +9409,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.56.1(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -11908,7 +11923,7 @@ snapshots: tapable@2.3.0: {} - tar@7.5.10: + tar@7.5.12: dependencies: '@isaacs/fs-minipass': 4.0.1 chownr: 3.0.0