Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@contentstack/utils

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentstack/utils - npm Package Compare versions

Comparing version
1.6.2
to
1.6.3
+229
dist/lib/assets/regions.json
{
"regions": [
{
"id": "na",
"name": "AWS North America",
"cloudProvider": "AWS",
"location": "North America",
"alias": [
"na",
"us",
"aws-na",
"aws_na",
"NA",
"US",
"AWS-NA",
"AWS_NA"
],
"isDefault": true,
"endpoints": {
"application": "https://app.contentstack.com",
"contentDelivery": "https://cdn.contentstack.io",
"contentManagement": "https://api.contentstack.io",
"auth": "https://auth-api.contentstack.com",
"graphqlDelivery": "https://graphql.contentstack.com",
"preview": "https://rest-preview.contentstack.com",
"graphqlPreview": "https://graphql-preview.contentstack.com",
"images": "https://images.contentstack.io",
"assets": "https://assets.contentstack.io",
"automate": "https://automations-api.contentstack.com",
"launch": "https://launch-api.contentstack.com",
"developerHub": "https://developerhub-api.contentstack.com",
"brandKit": "https://brand-kits-api.contentstack.com",
"genAI": "https://ai.contentstack.com/brand-kits",
"personalizeManagement": "https://personalize-api.contentstack.com",
"personalizeEdge": "https://personalize-edge.contentstack.com"
}
},
{
"id": "eu",
"name": "AWS Europe",
"cloudProvider": "AWS",
"location": "Europe",
"alias": [
"eu",
"aws-eu",
"aws_eu",
"EU",
"AWS-EU",
"AWS_EU"
],
"isDefault": false,
"endpoints": {
"application": "https://eu-app.contentstack.com",
"contentDelivery": "https://eu-cdn.contentstack.com",
"contentManagement": "https://eu-api.contentstack.com",
"auth": "https://eu-auth-api.contentstack.com",
"graphqlDelivery": "https://eu-graphql.contentstack.com",
"preview": "https://eu-rest-preview.contentstack.com",
"graphqlPreview": "https://eu-graphql-preview.contentstack.com",
"images": "https://eu-images.contentstack.com",
"assets": "https://eu-assets.contentstack.com",
"automate": "https://eu-prod-automations-api.contentstack.com",
"launch": "https://eu-launch-api.contentstack.com",
"developerHub": "https://eu-developerhub-api.contentstack.com",
"brandKit": "https://eu-brand-kits-api.contentstack.com",
"genAI": "https://eu-ai.contentstack.com/brand-kits",
"personalizeManagement": "https://eu-personalize-api.contentstack.com",
"personalizeEdge": "https://eu-personalize-edge.contentstack.com"
}
},
{
"id": "au",
"name": "AWS Australia",
"cloudProvider": "AWS",
"location": "Australia",
"alias": [
"au",
"aws-au",
"aws_au",
"AU",
"AWS-AU",
"AWS_AU"
],
"isDefault": false,
"endpoints": {
"application": "https://au-app.contentstack.com",
"contentDelivery": "https://au-cdn.contentstack.com",
"contentManagement": "https://au-api.contentstack.com",
"auth": "https://au-auth-api.contentstack.com",
"graphqlDelivery": "https://au-graphql.contentstack.com",
"preview": "https://au-rest-preview.contentstack.com",
"graphqlPreview": "https://au-graphql-preview.contentstack.com",
"images": "https://au-images.contentstack.com",
"assets": "https://au-assets.contentstack.com",
"automate": "https://au-prod-automations-api.contentstack.com",
"launch": "https://au-launch-api.contentstack.com",
"developerHub": "https://au-developerhub-api.contentstack.com",
"brandKit": "https://au-brand-kits-api.contentstack.com",
"genAI": "https://au-ai.contentstack.com/brand-kits",
"personalizeManagement": "https://au-personalize-api.contentstack.com",
"personalizeEdge": "https://au-personalize-edge.contentstack.com"
}
},
{
"id": "azure-na",
"name": "Azure North America",
"cloudProvider": "Azure",
"location": "North America",
"alias": [
"azure-na",
"azure_na",
"AZURE-NA",
"AZURE_NA"
],
"isDefault": false,
"endpoints": {
"application": "https://azure-na-app.contentstack.com",
"contentDelivery": "https://azure-na-cdn.contentstack.com",
"contentManagement": "https://azure-na-api.contentstack.com",
"auth": "https://azure-na-auth-api.contentstack.com",
"graphqlDelivery": "https://azure-na-graphql.contentstack.com",
"preview": "https://azure-na-rest-preview.contentstack.com",
"graphqlPreview": "https://azure-na-graphql-preview.contentstack.com",
"images": "https://azure-na-images.contentstack.com",
"assets": "https://azure-na-assets.contentstack.com",
"automate": "https://azure-na-automations-api.contentstack.com",
"launch": "https://azure-na-launch-api.contentstack.com",
"developerHub": "https://azure-na-developerhub-api.contentstack.com",
"brandKit": "https://azure-na-brand-kits-api.contentstack.com",
"genAI": "https://azure-na-ai.contentstack.com/brand-kits",
"personalizeManagement": "https://azure-na-personalize-api.contentstack.com",
"personalizeEdge": "https://azure-na-personalize-edge.contentstack.com"
}
},
{
"id": "azure-eu",
"name": "Azure Europe",
"cloudProvider": "Azure",
"location": "Europe",
"alias": [
"azure-eu",
"azure_eu",
"AZURE-EU",
"AZURE_EU"
],
"isDefault": false,
"endpoints": {
"application": "https://azure-eu-app.contentstack.com",
"contentDelivery": "https://azure-eu-cdn.contentstack.com",
"contentManagement": "https://azure-eu-api.contentstack.com",
"auth": "https://azure-eu-auth-api.contentstack.com",
"graphqlDelivery": "https://azure-eu-graphql.contentstack.com",
"preview": "https://azure-eu-rest-preview.contentstack.com",
"graphqlPreview": "https://azure-eu-graphql-preview.contentstack.com",
"images": "https://azure-eu-images.contentstack.com",
"assets": "https://azure-eu-assets.contentstack.com",
"automate": "https://azure-eu-automations-api.contentstack.com",
"launch": "https://azure-eu-launch-api.contentstack.com",
"developerHub": "https://azure-eu-developerhub-api.contentstack.com",
"brandKit": "https://azure-eu-brand-kits-api.contentstack.com",
"genAI": "https://azure-eu-ai.contentstack.com/brand-kits",
"personalizeManagement": "https://azure-eu-personalize-api.contentstack.com",
"personalizeEdge": "https://azure-eu-personalize-edge.contentstack.com"
}
},
{
"id": "gcp-na",
"name": "GCP North America",
"cloudProvider": "GCP",
"location": "North America",
"alias": [
"gcp-na",
"gcp_na",
"GCP-NA",
"GCP_NA"
],
"isDefault": false,
"endpoints": {
"application": "https://gcp-na-app.contentstack.com",
"contentDelivery": "https://gcp-na-cdn.contentstack.com",
"contentManagement": "https://gcp-na-api.contentstack.com",
"auth": "https://gcp-na-auth-api.contentstack.com",
"graphqlDelivery": "https://gcp-na-graphql.contentstack.com",
"preview": "https://gcp-na-rest-preview.contentstack.com",
"graphqlPreview": "https://gcp-na-graphql-preview.contentstack.com",
"images": "https://gcp-na-images.contentstack.com",
"assets": "https://gcp-na-assets.contentstack.com",
"automate": "https://gcp-na-automations-api.contentstack.com",
"launch": "https://gcp-na-launch-api.contentstack.com",
"developerHub": "https://gcp-na-developerhub-api.contentstack.com",
"brandKit": "https://gcp-na-brand-kits-api.contentstack.com",
"genAI": "https://gcp-na-ai.contentstack.com/brand-kits",
"personalizeManagement": "https://gcp-na-personalize-api.contentstack.com",
"personalizeEdge": "https://gcp-na-personalize-edge.contentstack.com"
}
},
{
"id": "gcp-eu",
"name": "GCP Europe",
"cloudProvider": "GCP",
"location": "Europe",
"alias": [
"gcp-eu",
"gcp_eu",
"GCP-EU",
"GCP_EU"
],
"isDefault": false,
"endpoints": {
"application": "https://gcp-eu-app.contentstack.com",
"contentDelivery": "https://gcp-eu-cdn.contentstack.com",
"contentManagement": "https://gcp-eu-api.contentstack.com",
"auth": "https://gcp-eu-auth-api.contentstack.com",
"graphqlDelivery": "https://gcp-eu-graphql.contentstack.com",
"preview": "https://gcp-eu-rest-preview.contentstack.com",
"graphqlPreview": "https://gcp-eu-graphql-preview.contentstack.com",
"images": "https://gcp-eu-images.contentstack.com",
"assets": "https://gcp-eu-assets.contentstack.com",
"automate": "https://gcp-eu-automations-api.contentstack.com",
"launch": "https://gcp-eu-launch-api.contentstack.com",
"developerHub": "https://gcp-eu-developerhub-api.contentstack.com",
"brandKit": "https://gcp-eu-brand-kits-api.contentstack.com",
"genAI": "https://gcp-eu-ai.contentstack.com/brand-kits",
"personalizeManagement": "https://gcp-eu-personalize-api.contentstack.com",
"personalizeEdge": "https://gcp-eu-personalize-edge.contentstack.com"
}
}
]
}
+234
-66
'use strict';
var path = require('path');
var fs = require('fs');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
function replaceHtmlEntities(text) {

@@ -1149,42 +1126,233 @@ return text

/// <reference types="node" />
// Load regions.json at runtime from the dist/lib directory
function loadRegions() {
// Get the directory of the current module
// In CommonJS (compiled output), __dirname is available at runtime
// When packed, the file structure may be different, so we check multiple paths
// __dirname will be available at runtime in CommonJS output from rollup
// Use __dirname directly since it's available at runtime in CommonJS output
var moduleDir = __dirname;
// Try multiple possible paths:
// 1. lib/regions.json (relative to __dirname - for production/packed package)
// Main entry point is dist/index.es.js, so __dirname is dist, file is at dist/lib/regions.json
// 2. dist/lib/regions.json (relative to process.cwd() - for development/tests)
var possiblePaths = [
path__namespace.join(moduleDir, 'lib', 'regions.json'),
path__namespace.join(process.cwd(), 'dist', 'lib', 'regions.json'),
];
for (var _i = 0, possiblePaths_1 = possiblePaths; _i < possiblePaths_1.length; _i++) {
var regionsPath = possiblePaths_1[_i];
if (fs__namespace.existsSync(regionsPath)) {
try {
var regionsData = fs__namespace.readFileSync(regionsPath, 'utf-8');
return JSON.parse(regionsData);
}
catch (error) {
throw new Error("Failed to parse regions.json: ".concat(error instanceof Error ? error.message : String(error)));
}
}
}
// If not found, throw clear error
throw new Error('regions.json file not found. Please ensure the package is properly installed and postinstall script has run.');
}
// Cache the loaded regions data
var cachedRegions = null;
function getRegions() {
if (!cachedRegions) {
cachedRegions = loadRegions();
}
return cachedRegions;
}
var regions = [
{
id: "na",
name: "AWS North America",
cloudProvider: "AWS",
location: "North America",
alias: [
"na",
"us",
"aws-na",
"aws_na",
"NA",
"US",
"AWS-NA",
"AWS_NA"
],
isDefault: true,
endpoints: {
application: "https://app.contentstack.com",
contentDelivery: "https://cdn.contentstack.io",
contentManagement: "https://api.contentstack.io",
auth: "https://auth-api.contentstack.com",
graphqlDelivery: "https://graphql.contentstack.com",
preview: "https://rest-preview.contentstack.com",
graphqlPreview: "https://graphql-preview.contentstack.com",
images: "https://images.contentstack.io",
assets: "https://assets.contentstack.io",
automate: "https://automations-api.contentstack.com",
launch: "https://launch-api.contentstack.com",
developerHub: "https://developerhub-api.contentstack.com",
brandKit: "https://brand-kits-api.contentstack.com",
genAI: "https://ai.contentstack.com/brand-kits",
personalizeManagement: "https://personalize-api.contentstack.com",
personalizeEdge: "https://personalize-edge.contentstack.com"
}
},
{
id: "eu",
name: "AWS Europe",
cloudProvider: "AWS",
location: "Europe",
alias: [
"eu",
"aws-eu",
"aws_eu",
"EU",
"AWS-EU",
"AWS_EU"
],
isDefault: false,
endpoints: {
application: "https://eu-app.contentstack.com",
contentDelivery: "https://eu-cdn.contentstack.com",
contentManagement: "https://eu-api.contentstack.com",
auth: "https://eu-auth-api.contentstack.com",
graphqlDelivery: "https://eu-graphql.contentstack.com",
preview: "https://eu-rest-preview.contentstack.com",
graphqlPreview: "https://eu-graphql-preview.contentstack.com",
images: "https://eu-images.contentstack.com",
assets: "https://eu-assets.contentstack.com",
automate: "https://eu-prod-automations-api.contentstack.com",
launch: "https://eu-launch-api.contentstack.com",
developerHub: "https://eu-developerhub-api.contentstack.com",
brandKit: "https://eu-brand-kits-api.contentstack.com",
genAI: "https://eu-ai.contentstack.com/brand-kits",
personalizeManagement: "https://eu-personalize-api.contentstack.com",
personalizeEdge: "https://eu-personalize-edge.contentstack.com"
}
},
{
id: "au",
name: "AWS Australia",
cloudProvider: "AWS",
location: "Australia",
alias: [
"au",
"aws-au",
"aws_au",
"AU",
"AWS-AU",
"AWS_AU"
],
isDefault: false,
endpoints: {
application: "https://au-app.contentstack.com",
contentDelivery: "https://au-cdn.contentstack.com",
contentManagement: "https://au-api.contentstack.com",
auth: "https://au-auth-api.contentstack.com",
graphqlDelivery: "https://au-graphql.contentstack.com",
preview: "https://au-rest-preview.contentstack.com",
graphqlPreview: "https://au-graphql-preview.contentstack.com",
images: "https://au-images.contentstack.com",
assets: "https://au-assets.contentstack.com",
automate: "https://au-prod-automations-api.contentstack.com",
launch: "https://au-launch-api.contentstack.com",
developerHub: "https://au-developerhub-api.contentstack.com",
brandKit: "https://au-brand-kits-api.contentstack.com",
genAI: "https://au-ai.contentstack.com/brand-kits",
personalizeManagement: "https://au-personalize-api.contentstack.com",
personalizeEdge: "https://au-personalize-edge.contentstack.com"
}
},
{
id: "azure-na",
name: "Azure North America",
cloudProvider: "Azure",
location: "North America",
alias: [
"azure-na",
"azure_na",
"AZURE-NA",
"AZURE_NA"
],
isDefault: false,
endpoints: {
application: "https://azure-na-app.contentstack.com",
contentDelivery: "https://azure-na-cdn.contentstack.com",
contentManagement: "https://azure-na-api.contentstack.com",
auth: "https://azure-na-auth-api.contentstack.com",
graphqlDelivery: "https://azure-na-graphql.contentstack.com",
preview: "https://azure-na-rest-preview.contentstack.com",
graphqlPreview: "https://azure-na-graphql-preview.contentstack.com",
images: "https://azure-na-images.contentstack.com",
assets: "https://azure-na-assets.contentstack.com",
automate: "https://azure-na-automations-api.contentstack.com",
launch: "https://azure-na-launch-api.contentstack.com",
developerHub: "https://azure-na-developerhub-api.contentstack.com",
brandKit: "https://azure-na-brand-kits-api.contentstack.com",
genAI: "https://azure-na-ai.contentstack.com/brand-kits",
personalizeManagement: "https://azure-na-personalize-api.contentstack.com",
personalizeEdge: "https://azure-na-personalize-edge.contentstack.com"
}
},
{
id: "azure-eu",
name: "Azure Europe",
cloudProvider: "Azure",
location: "Europe",
alias: [
"azure-eu",
"azure_eu",
"AZURE-EU",
"AZURE_EU"
],
isDefault: false,
endpoints: {
application: "https://azure-eu-app.contentstack.com",
contentDelivery: "https://azure-eu-cdn.contentstack.com",
contentManagement: "https://azure-eu-api.contentstack.com",
auth: "https://azure-eu-auth-api.contentstack.com",
graphqlDelivery: "https://azure-eu-graphql.contentstack.com",
preview: "https://azure-eu-rest-preview.contentstack.com",
graphqlPreview: "https://azure-eu-graphql-preview.contentstack.com",
images: "https://azure-eu-images.contentstack.com",
assets: "https://azure-eu-assets.contentstack.com",
automate: "https://azure-eu-automations-api.contentstack.com",
launch: "https://azure-eu-launch-api.contentstack.com",
developerHub: "https://azure-eu-developerhub-api.contentstack.com",
brandKit: "https://azure-eu-brand-kits-api.contentstack.com",
genAI: "https://azure-eu-ai.contentstack.com/brand-kits",
personalizeManagement: "https://azure-eu-personalize-api.contentstack.com",
personalizeEdge: "https://azure-eu-personalize-edge.contentstack.com"
}
},
{
id: "gcp-na",
name: "GCP North America",
cloudProvider: "GCP",
location: "North America",
alias: [
"gcp-na",
"gcp_na",
"GCP-NA",
"GCP_NA"
],
isDefault: false,
endpoints: {
application: "https://gcp-na-app.contentstack.com",
contentDelivery: "https://gcp-na-cdn.contentstack.com",
contentManagement: "https://gcp-na-api.contentstack.com",
auth: "https://gcp-na-auth-api.contentstack.com",
graphqlDelivery: "https://gcp-na-graphql.contentstack.com",
preview: "https://gcp-na-rest-preview.contentstack.com",
graphqlPreview: "https://gcp-na-graphql-preview.contentstack.com",
images: "https://gcp-na-images.contentstack.com",
assets: "https://gcp-na-assets.contentstack.com",
automate: "https://gcp-na-automations-api.contentstack.com",
launch: "https://gcp-na-launch-api.contentstack.com",
developerHub: "https://gcp-na-developerhub-api.contentstack.com",
brandKit: "https://gcp-na-brand-kits-api.contentstack.com",
genAI: "https://gcp-na-ai.contentstack.com/brand-kits",
personalizeManagement: "https://gcp-na-personalize-api.contentstack.com",
personalizeEdge: "https://gcp-na-personalize-edge.contentstack.com"
}
},
{
id: "gcp-eu",
name: "GCP Europe",
cloudProvider: "GCP",
location: "Europe",
alias: [
"gcp-eu",
"gcp_eu",
"GCP-EU",
"GCP_EU"
],
isDefault: false,
endpoints: {
application: "https://gcp-eu-app.contentstack.com",
contentDelivery: "https://gcp-eu-cdn.contentstack.com",
contentManagement: "https://gcp-eu-api.contentstack.com",
auth: "https://gcp-eu-auth-api.contentstack.com",
graphqlDelivery: "https://gcp-eu-graphql.contentstack.com",
preview: "https://gcp-eu-rest-preview.contentstack.com",
graphqlPreview: "https://gcp-eu-graphql-preview.contentstack.com",
images: "https://gcp-eu-images.contentstack.com",
assets: "https://gcp-eu-assets.contentstack.com",
automate: "https://gcp-eu-automations-api.contentstack.com",
launch: "https://gcp-eu-launch-api.contentstack.com",
developerHub: "https://gcp-eu-developerhub-api.contentstack.com",
brandKit: "https://gcp-eu-brand-kits-api.contentstack.com",
genAI: "https://gcp-eu-ai.contentstack.com/brand-kits",
personalizeManagement: "https://gcp-eu-personalize-api.contentstack.com",
personalizeEdge: "https://gcp-eu-personalize-edge.contentstack.com"
}
}
];
var regionsData = {
regions: regions
};
function getContentstackEndpoint(region, service, omitHttps) {

@@ -1198,11 +1366,11 @@ if (region === void 0) { region = 'us'; }

}
var regionsData = getRegions();
var regions = regionsData;
// Normalize the region input
var normalizedRegion = region.toLowerCase().trim() || 'us';
// Check if regions data is malformed
if (!Array.isArray(regionsData.regions)) {
if (!Array.isArray(regions.regions)) {
throw new Error('Invalid Regions file. Please install the SDK again to fix this issue.');
}
// Find the region by ID or alias
var regionData = findRegionByIDOrAlias(regionsData.regions, normalizedRegion);
var regionData = findRegionByIDOrAlias(regions.regions, normalizedRegion);
if (!regionData) {

@@ -1209,0 +1377,0 @@ throw new Error("Invalid region: ".concat(region));

@@ -1,43 +0,2 @@

/// <reference types="node" />
import * as path from 'path';
import * as fs from 'fs';
// Load regions.json at runtime from the dist/lib directory
function loadRegions() {
// Get the directory of the current module
// In CommonJS (compiled output), __dirname is available at runtime
// When packed, the file structure may be different, so we check multiple paths
// __dirname will be available at runtime in CommonJS output from rollup
// Use __dirname directly since it's available at runtime in CommonJS output
var moduleDir = __dirname;
// Try multiple possible paths:
// 1. lib/regions.json (relative to __dirname - for production/packed package)
// Main entry point is dist/index.es.js, so __dirname is dist, file is at dist/lib/regions.json
// 2. dist/lib/regions.json (relative to process.cwd() - for development/tests)
var possiblePaths = [
path.join(moduleDir, 'lib', 'regions.json'),
path.join(process.cwd(), 'dist', 'lib', 'regions.json'),
];
for (var _i = 0, possiblePaths_1 = possiblePaths; _i < possiblePaths_1.length; _i++) {
var regionsPath = possiblePaths_1[_i];
if (fs.existsSync(regionsPath)) {
try {
var regionsData = fs.readFileSync(regionsPath, 'utf-8');
return JSON.parse(regionsData);
}
catch (error) {
throw new Error("Failed to parse regions.json: ".concat(error instanceof Error ? error.message : String(error)));
}
}
}
// If not found, throw clear error
throw new Error('regions.json file not found. Please ensure the package is properly installed and postinstall script has run.');
}
// Cache the loaded regions data
var cachedRegions = null;
function getRegions() {
if (!cachedRegions) {
cachedRegions = loadRegions();
}
return cachedRegions;
}
import regionsData from './assets/regions.json';
export function getContentstackEndpoint(region, service, omitHttps) {

@@ -51,11 +10,11 @@ if (region === void 0) { region = 'us'; }

}
var regionsData = getRegions();
var regions = regionsData;
// Normalize the region input
var normalizedRegion = region.toLowerCase().trim() || 'us';
// Check if regions data is malformed
if (!Array.isArray(regionsData.regions)) {
if (!Array.isArray(regions.regions)) {
throw new Error('Invalid Regions file. Please install the SDK again to fix this issue.');
}
// Find the region by ID or alias
var regionData = findRegionByIDOrAlias(regionsData.regions, normalizedRegion);
var regionData = findRegionByIDOrAlias(regions.regions, normalizedRegion);
if (!regionData) {

@@ -62,0 +21,0 @@ throw new Error("Invalid region: ".concat(region));

@@ -1,1 +0,1 @@

{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/endpoints.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAuBzB,2DAA2D;AAC3D,SAAS,WAAW;IAClB,0CAA0C;IAC1C,mEAAmE;IACnE,+EAA+E;IAC/E,wEAAwE;IACxE,4EAA4E;IAC5E,IAAM,SAAS,GAAG,SAAS,CAAC;IAE5B,+BAA+B;IAC/B,8EAA8E;IAC9E,kGAAkG;IAClG,+EAA+E;IAC/E,IAAM,aAAa,GAAG;QACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAA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OAAO,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;KAC7C;SAAM;QACL,IAAM,MAAM,GAA0B,EAAE,CAAC;QACzC,KAAK,IAAM,GAAG,IAAI,QAAQ,EAAE;YAC1B,MAAM,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;SACzC;QACD,OAAO,MAAM,CAAC;KACf;AACH,CAAC"}
{
"name": "@contentstack/utils",
"version": "1.6.2",
"version": "1.6.3",
"description": "Contentstack utilities for Javascript",

@@ -24,16 +24,11 @@ "main": "dist/index.es.js",

"pretest": "npm run build",
"test": "npm run clear:reports && pwd && jest --ci --json --coverage --testLocationInResults --outputFile=./reports/report.json",
"test": "npm run clear:reports && jest --ci --json --coverage --testLocationInResults --outputFile=./reports/report.json",
"test:badges": "npm run clear:badges && npm run test && jest-coverage-badges --input ./reports/coverage/coverage-summary.json --output ./badges",
"test:debug": "jest --watchAll --runInBand",
"prebuild": "rimraf dist && mkdir -p dist/lib && npm run download-regions",
"download-regions": "curl -v --max-time 30 --fail https://artifacts.contentstack.com/regions.json -o dist/lib/regions.json || echo 'Warning: Failed to download regions.json'",
"download-regions": "mkdir -p src/assets && curl -s --max-time 30 --fail https://artifacts.contentstack.com/regions.json -o src/assets/regions.json || echo 'Warning: Failed to download regions.json'",
"build": "tsc && rollup -c",
"format": "prettier --write \"src/**/*.ts\"",
"prepare": "husky install && npm run build",
"prepublishOnly": "npm test",
"pre-commit": "husky install && husky && chmod +x .husky/pre-commit && ./.husky/pre-commit",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags",
"postinstall": "npm run download-regions",
"postupdate": "npm run download-regions"
"prepublishOnly": "npm test"
},

@@ -74,8 +69,3 @@ "author": "Contentstack",

}
},
"husky": {
"hooks": {
"pre-commit": "$TALISMAN_HOME/talisman_hook_script pre-commit && other-scripts"
}
}
}
{
"regions": [
{
"id": "na",
"name": "AWS North America",
"cloudProvider": "AWS",
"location": "North America",
"alias": [
"na",
"us",
"aws-na",
"aws_na",
"NA",
"US",
"AWS-NA",
"AWS_NA"
],
"isDefault": true,
"endpoints": {
"application": "https://app.contentstack.com",
"contentDelivery": "https://cdn.contentstack.io",
"contentManagement": "https://api.contentstack.io",
"auth": "https://auth-api.contentstack.com",
"graphqlDelivery": "https://graphql.contentstack.com",
"preview": "https://rest-preview.contentstack.com",
"graphqlPreview": "https://graphql-preview.contentstack.com",
"images": "https://images.contentstack.io",
"assets": "https://assets.contentstack.io",
"automate": "https://automations-api.contentstack.com",
"launch": "https://launch-api.contentstack.com",
"developerHub": "https://developerhub-api.contentstack.com",
"brandKit": "https://brand-kits-api.contentstack.com",
"genAI": "https://ai.contentstack.com",
"personalizeManagement": "https://personalize-api.contentstack.com",
"personalizeEdge": "https://personalize-edge.contentstack.com"
}
},
{
"id": "eu",
"name": "AWS Europe",
"cloudProvider": "AWS",
"location": "Europe",
"alias": [
"eu",
"aws-eu",
"aws_eu",
"EU",
"AWS-EU",
"AWS_EU"
],
"isDefault": false,
"endpoints": {
"application": "https://eu-app.contentstack.com",
"contentDelivery": "https://eu-cdn.contentstack.com",
"contentManagement": "https://eu-api.contentstack.com",
"auth": "https://eu-auth-api.contentstack.com",
"graphqlDelivery": "https://eu-graphql.contentstack.com",
"preview": "https://eu-rest-preview.contentstack.com",
"graphqlPreview": "https://eu-graphql-preview.contentstack.com",
"images": "https://eu-images.contentstack.com",
"assets": "https://eu-assets.contentstack.com",
"automate": "https://eu-prod-automations-api.contentstack.com",
"launch": "https://eu-launch-api.contentstack.com",
"developerHub": "https://eu-developerhub-api.contentstack.com",
"brandKit": "https://eu-brand-kits-api.contentstack.com",
"genAI": "https://eu-ai.contentstack.com",
"personalizeManagement": "https://eu-personalize-api.contentstack.com",
"personalizeEdge": "https://eu-personalize-edge.contentstack.com"
}
},
{
"id": "au",
"name": "AWS Australia",
"cloudProvider": "AWS",
"location": "Australia",
"alias": [
"au",
"aws-au",
"aws_au",
"AU",
"AWS-AU",
"AWS_AU"
],
"isDefault": false,
"endpoints": {
"application": "https://au-app.contentstack.com",
"contentDelivery": "https://au-cdn.contentstack.com",
"contentManagement": "https://au-api.contentstack.com",
"auth": "https://au-auth-api.contentstack.com",
"graphqlDelivery": "https://au-graphql.contentstack.com",
"preview": "https://au-rest-preview.contentstack.com",
"graphqlPreview": "https://au-graphql-preview.contentstack.com",
"images": "https://au-images.contentstack.com",
"assets": "https://au-assets.contentstack.com",
"automate": "https://au-prod-automations-api.contentstack.com",
"launch": "https://au-launch-api.contentstack.com",
"developerHub": "https://au-developerhub-api.contentstack.com",
"brandKit": "https://au-brand-kits-api.contentstack.com",
"genAI": "https://au-ai.contentstack.com",
"personalizeManagement": "https://au-personalize-api.contentstack.com",
"personalizeEdge": "https://au-personalize-edge.contentstack.com"
}
},
{
"id": "azure-na",
"name": "Azure North America",
"cloudProvider": "Azure",
"location": "North America",
"alias": [
"azure-na",
"azure_na",
"AZURE-NA",
"AZURE_NA"
],
"isDefault": false,
"endpoints": {
"application": "https://azure-na-app.contentstack.com",
"contentDelivery": "https://azure-na-cdn.contentstack.com",
"contentManagement": "https://azure-na-api.contentstack.com",
"auth": "https://azure-na-auth-api.contentstack.com",
"graphqlDelivery": "https://azure-na-graphql.contentstack.com",
"preview": "https://azure-na-rest-preview.contentstack.com",
"graphqlPreview": "https://azure-na-graphql-preview.contentstack.com",
"images": "https://azure-na-images.contentstack.com",
"assets": "https://azure-na-assets.contentstack.com",
"automate": "https://azure-na-automations-api.contentstack.com",
"launch": "https://azure-na-launch-api.contentstack.com",
"developerHub": "https://azure-na-developerhub-api.contentstack.com",
"brandKit": "https://azure-na-brand-kits-api.contentstack.com",
"genAI": "https://azure-na-ai.contentstack.com",
"personalizeManagement": "https://azure-na-personalize-api.contentstack.com",
"personalizeEdge": "https://azure-na-personalize-edge.contentstack.com"
}
},
{
"id": "azure-eu",
"name": "Azure Europe",
"cloudProvider": "Azure",
"location": "Europe",
"alias": [
"azure-eu",
"azure_eu",
"AZURE-EU",
"AZURE_EU"
],
"isDefault": false,
"endpoints": {
"application": "https://azure-eu-app.contentstack.com",
"contentDelivery": "https://azure-eu-cdn.contentstack.com",
"contentManagement": "https://azure-eu-api.contentstack.com",
"auth": "https://azure-eu-auth-api.contentstack.com",
"graphqlDelivery": "https://azure-eu-graphql.contentstack.com",
"preview": "https://azure-eu-rest-preview.contentstack.com",
"graphqlPreview": "https://azure-eu-graphql-preview.contentstack.com",
"images": "https://azure-eu-images.contentstack.com",
"assets": "https://azure-eu-assets.contentstack.com",
"automate": "https://azure-eu-automations-api.contentstack.com",
"launch": "https://azure-eu-launch-api.contentstack.com",
"developerHub": "https://azure-eu-developerhub-api.contentstack.com",
"brandKit": "https://azure-eu-brand-kits-api.contentstack.com",
"genAI": "https://azure-eu-ai.contentstack.com",
"personalizeManagement": "https://azure-eu-personalize-api.contentstack.com",
"personalizeEdge": "https://azure-eu-personalize-edge.contentstack.com"
}
},
{
"id": "gcp-na",
"name": "GCP North America",
"cloudProvider": "GCP",
"location": "North America",
"alias": [
"gcp-na",
"gcp_na",
"GCP-NA",
"GCP_NA"
],
"isDefault": false,
"endpoints": {
"application": "https://gcp-na-app.contentstack.com",
"contentDelivery": "https://gcp-na-cdn.contentstack.com",
"contentManagement": "https://gcp-na-api.contentstack.com",
"auth": "https://gcp-na-auth-api.contentstack.com",
"graphqlDelivery": "https://gcp-na-graphql.contentstack.com",
"preview": "https://gcp-na-rest-preview.contentstack.com",
"graphqlPreview": "https://gcp-na-graphql-preview.contentstack.com",
"images": "https://gcp-na-images.contentstack.com",
"assets": "https://gcp-na-assets.contentstack.com",
"automate": "https://gcp-na-automations-api.contentstack.com",
"launch": "https://gcp-na-launch-api.contentstack.com",
"developerHub": "https://gcp-na-developerhub-api.contentstack.com",
"brandKit": "https://gcp-na-brand-kits-api.contentstack.com",
"genAI": "https://gcp-na-brand-kits-api.contentstack.com",
"personalizeManagement": "https://gcp-na-personalize-api.contentstack.com",
"personalizeEdge": "https://gcp-na-personalize-edge.contentstack.com"
}
},
{
"id": "gcp-eu",
"name": "GCP Europe",
"cloudProvider": "GCP",
"location": "Europe",
"alias": [
"gcp-eu",
"gcp_eu",
"GCP-EU",
"GCP_EU"
],
"isDefault": false,
"endpoints": {
"application": "https://gcp-eu-app.contentstack.com",
"contentDelivery": "https://gcp-eu-cdn.contentstack.com",
"contentManagement": "https://gcp-eu-api.contentstack.com",
"auth": "https://gcp-eu-auth-api.contentstack.com",
"graphqlDelivery": "https://gcp-eu-graphql.contentstack.com",
"preview": "https://gcp-eu-rest-preview.contentstack.com",
"graphqlPreview": "https://gcp-eu-graphql-preview.contentstack.com",
"images": "https://gcp-eu-images.contentstack.com",
"assets": "https://gcp-eu-assets.contentstack.com",
"automate": "https://gcp-eu-automations-api.contentstack.com",
"launch": "https://gcp-eu-launch-api.contentstack.com",
"developerHub": "https://gcp-eu-developerhub-api.contentstack.com",
"brandKit": "https://gcp-eu-brand-kits-api.contentstack.com",
"genAI": "https://gcp-eu-brand-kits-api.contentstack.com",
"personalizeManagement": "https://gcp-eu-personalize-api.contentstack.com",
"personalizeEdge": "https://gcp-eu-personalize-edge.contentstack.com"
}
}
]
}

Sorry, the diff of this file is too big to display