Skip to content
Merged
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
53 changes: 45 additions & 8 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,46 @@
fileignoreconfig:
- filename: .github/workflows/secrets-scan.yml
ignore_detectors:
- filecontent
- filename: package-lock.json
checksum: 563bfe30f9c5a79ccd7fe9d455442fad803de044e5fee543a415f5798b198129
- filename: packages/contentstack-utilities/src/helpers.ts
checksum: 54b0927001dfbb16beb8c8dd574fa5ae8c86feb8e060b026633bceaec14ec6b1
version: "1.0"
- filename: packages/contentstack-import/test/integration/auth-token-modules/environments.test.js
checksum: bc6f06b75d082aaf99e2f2f4b932b143765e2f14086967fb8973fe1b2ca6c03e
- filename: packages/contentstack-import/test/integration/environments.test.js
checksum: e71f033dad8944ffeafdf22d0514bda1d20c43e8fea0d62c96e774f3414beb31
- filename: packages/contentstack-import/test/integration/auth-token-modules/extensions.test.js
checksum: 9c79540ab8522736f17c3ae1c9bfea07784b6ed0aa41f5617c90ba6812b91e72
- filename: packages/contentstack-import/test/integration/auth-token-modules/workflows.test.js
checksum: 1c77d21cff245157bc9a9863cc264d29bd81591447de3b27ae3aff67239e2937
- filename: packages/contentstack-import/test/integration/auth-token-modules/global-fields.test.js
checksum: db5b7aedcd89d783760eb988a2369243c34edc9c12e93a41b2b08fb0da02afdc
- filename: packages/contentstack-import/test/integration/auth-token-modules/custom-roles.test.js
checksum: 429bd7cfe81f22266da6230eae538c36a846b0267de17d0e55f611a9311eef78
- filename: packages/contentstack-import/test/integration/auth-token-modules/locales.test.js
checksum: e3ae0c7c1e7cf15d74918711f8939e46e9257b2525bf936e41d85d6328d4a018
- filename: packages/contentstack-import/test/integration/auth-token-modules/assets.test.js
checksum: 844ac7242268fab10c0fd22cfd4e98284d6461de95d55d22925f61e1b1f29433
- filename: packages/contentstack-import/test/integration/auth-token-modules/webhooks.test.js
checksum: 06290dce8c950c394d061427ad5ecce10e5f36644372d46ee542bffa09a76185
- filename: packages/contentstack-import/test/integration/content-types.test.js
checksum: 0f15d1b877cc99ac27cd89ad31082c00f902667e631e1941d5d97d73e74d39e2
- filename: packages/contentstack-import/test/integration/auth-token-modules/entries.test.js
checksum: 75f2c3b007488e9dd0ff43bcc624f9edc9a3daf1dbb1dfd24203a488a986937d
- filename: packages/contentstack-import/test/integration/custom-roles.test.js
checksum: 58d77f9139c9c01a4471d9ce821fbc683eaea4650787bfc510959e7817084ed6
- filename: packages/contentstack-import/test/integration/entries.test.js
checksum: 5e33da22b28afd09ce105a6714a90e27c1e2ad559e6b9d8b41f59de02e83894c
- filename: packages/contentstack-import/test/integration/auth-token.test.js
checksum: 05a5a9917440203efc6db1c5d46ba2c7ce61db4648c379db28b36e08cfe049ef
- filename: packages/contentstack-import/test/integration/auth-token-modules/content-types.test.js
checksum: b24e5dee9677453088b2ecbd5c70b077cf99756f8fe927c4f38670e6041da94d
- filename: packages/contentstack-import/test/integration/assets.test.js
checksum: ca95054274b7262f3e0325ed312dac3fc09965acf4097a79184a42913c08ecb7
- filename: packages/contentstack-import/test/integration/workflows.test.js
checksum: 07cfe3cbb586d30b143a0169e7001a1f91ce50a1a5ae4485b2518c2181973cf7
- filename: packages/contentstack-import/test/integration/webhooks.test.js
checksum: eb11a310516a3cdfd5c2dc77bdfe7143eb268b1ab1e0e33babbe9352c5b72c38
- filename: packages/contentstack-import/test/integration/global-fields.test.js
checksum: 16ead9a66c7834e4d24ca27eb11c6a1c70a02304c39a6c0483802e1851438903
- filename: packages/contentstack-import/test/integration/extensions.test.js
checksum: 2e62534faf6b3c5d9fd9bc001fd45e900430e835f899a2afd70b781098d2add7
- filename: packages/contentstack-import/test/integration/locales.test.js
checksum: f3b6c73302f5883a40dad4e878a37bfc9780c39743c3745402037baa0cd7eab4
- filename: packages/contentstack-import/test/integration/management-token.test.js
checksum: 095187d8b5fee8466f39a13e5cbc9f3c78f3dd0eb07d2c5af3929aca8aff8f2d
version: ''
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions packages/contentstack-auth/test/unit/tokens-validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ describe('Tokens Validation', () => {
const invalidDeliveryToken = '';
const validManagementToken = '';
const invalidManagementToken = '';
const validEnvironemnt = '';
const validEnvironment = '';
const invalidEnvironemnt = 'invalid';
const validRegion = 'NA';
const validRegion = 'AWS-NA';
const validHost = '';
let contentStackClient: {
stack: any;
Expand Down Expand Up @@ -50,7 +50,7 @@ describe('Tokens Validation', () => {
return contentStackClient;
}),
fetch: sinon.stub().callsFake(() => {
if (contentStackClient.environmentName === validEnvironemnt) {
if (contentStackClient.environmentName === validEnvironment) {
return Promise.resolve({ name: contentStackClient.environmentName });
} else if (!contentStackClient.environmentName && contentStackClient.apiKey === validAPIkey) {
return Promise.resolve({ api_key: contentStackClient.apiKey });
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('Tokens Validation', () => {
contentStackClientStub,
validAPIkey,
validDeliveryToken,
validEnvironemnt,
validEnvironment,
validRegion,
validHost,
);
Expand All @@ -96,7 +96,7 @@ describe('Tokens Validation', () => {
contentStackClient,
validAPIkey,
invalidDeliveryToken,
validEnvironemnt,
validEnvironment,
validRegion,
validHost,
);
Expand All @@ -105,7 +105,7 @@ describe('Tokens Validation', () => {
});
describe('#Environment', function () {
it('Valid environment, should return true', async function () {
const result = await tokenValidation.validateEnvironment(contentStackClient, validAPIkey, validEnvironemnt);
const result = await tokenValidation.validateEnvironment(contentStackClient, validAPIkey, validEnvironment);
expect(result.valid).to.be.true;
});
it('invalid environment, should return false', async function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/test/bootstrap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const mock = {
master_locale: 'en-us',
},
region: {
name: 'NA',
name: 'AWS-NA',
cda: 'https://cdn.contentstack.com',
cma: 'https://api.contentstack.com',
uiHost: 'https://app.contentstack.com',
Expand Down
11 changes: 6 additions & 5 deletions packages/contentstack-bootstrap/test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Utils', function () {
const livePreviewEnabled = true;
const clonedDirectory = await getDirectory();
const region = {
name: 'NA',
name: 'AWS-NA',
cda: 'https://cdn.contentstack.com',
cma: 'https://api.contentstack.com',
uiHost: 'https://app.contentstack.com'
Expand Down Expand Up @@ -106,7 +106,7 @@ describe('Utils', function () {
const livePreviewEnabled = false;
const clonedDirectory = await getDirectory();
const region = {
name: 'NA',
name: 'AWS-NA',
cda: 'https://cdn.contentstack.com',
cma: 'https://api.contentstack.com',
uiHost: 'https://app.contentstack.com',
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('Utils', function () {
};
const clonedDirectory = await getDirectory();
const region = {
name: 'NA',
name: 'AWS-NA',
cda: 'https://app.contentstack.com',
cma: 'https://api.contentstack.com',
};
Expand Down Expand Up @@ -194,6 +194,7 @@ describe('Utils', function () {
expect(error).to.be.instanceOf(Error);
}
});

it('Create env with invalid app config, should throw an error', async () => {
const environments = {};
const token = 'mock-delivery-token';
Expand All @@ -203,7 +204,7 @@ describe('Utils', function () {
};
const clonedDirectory = await getDirectory();
const region = {
name: 'NA',
name: 'AWS-NA',
cda: 'https://app.contentstack.com',
cma: 'https://app.contentstack.com',
};
Expand Down Expand Up @@ -240,7 +241,7 @@ describe('Utils', function () {
};
const clonedDirectory = await getDirectory();
const region = {
name: 'NA',
name: 'AWS-NA',
cda: 'https://app.contentstack.com',
cma: 'https://app.contentstack.com',
};
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.16.2",
"@contentstack/cli-cm-import": "~1.23.0",
"@contentstack/cli-cm-export": "~1.16.3",
"@contentstack/cli-cm-import": "~1.23.1",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.12.0",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/messages/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"CLI_CONFIG_SET_REGION_FLAG_D_DESCRIPTION": "Custom host to set for content delivery API, if this flag is added then cma and name flags are required",
"CLI_CONFIG_SET_REGION_FLAG_M_DESCRIPTION": "Custom host to set for content management API, , if this flag is added then cda and name flags are required",
"CLI_CONFIG_SET_REGION_FLAG_N_DESCRIPTION": "Name for the region, if this flag is added then cda and cma flags are required",
"CLI_CONFIG_SET_REGION_DEFAULT": "No argument or custom flag provided. Setting region to default NA",
"CLI_CONFIG_SET_REGION_DEFAULT": "No argument or custom flag provided. Setting region to default AWS-NA",
"CLI_CONFIG_GET_REGION_DESCRIPTION": "Get current region set for CLI",
"CLI_CONFIG_GET_REGION_NOT_FOUND": "No region found, please set by running command $ csdx config:set:region",
"CLI_CONFIG_INQUIRE_REGION_NAME": "Enter custom region name",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-config/src/utils/region-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class UserConfig {
/**
*
* Set region to config store
* @param {string} region It Can be NA, EU
* @param {string} region It Can be AWS-NA, AWS-EU, AWS-AU, AZURE-NA, AZURE-EU, GCP-NA, GCP-EU
* @returns {object} region object with cma, cda, region property
*/
setRegion(region) {
Expand All @@ -133,8 +133,8 @@ class UserConfig {
const regionDetails = configHandler.get('region');
if (regionDetails) return regionDetails;

// returns NA region if not found in config
return regions.NA;
// returns AWS-NA region if not found in config
return regions['AWS-NA'];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/test/integration/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"PRINT_LOGS": false,
"CDA": "https://cdn.contentstack.io",
"CMA": "https://api.contentstack.io",
"REGION_NAME": "NA"
"REGION_NAME": "AWS-NA"
}
6 changes: 3 additions & 3 deletions packages/contentstack-config/test/integration/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ describe('ContentStack-Config Plugin Tests', () => {
expect(output).to.include('CMA HOST:');
});

it("Should execute 'config:set:region NA' and set NA region", () => {
const result = spawnSync('csdx', ['config:set:region', 'NA'], { encoding: 'utf-8' });
it("Should execute 'config:set:region AWS-NA' and set AWS-NA region", () => {
const result = spawnSync('csdx', ['config:set:region', 'AWS-NA'], { encoding: 'utf-8' });
const output = result.stdout + result.stderr;

expect(output).to.include('Region has been set to NA');
expect(output).to.include('Region has been set to AWS-NA');
expect(output).to.include('CDA HOST: https://cdn.contentstack.io');
expect(output).to.include('CMA HOST: https://api.contentstack.io');
});
Expand Down
17 changes: 6 additions & 11 deletions packages/contentstack-config/test/unit/commands/region.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ describe('Region command', function () {
launchHubUrl: 'https://launch-api.contentstack.com',
personalizeUrl: 'https://personalization-api.contentstack.com',
};
let cliuxPrintStub;
let configGetStub;
let configSetStub;
let cliuxPrintStub: sinon.SinonStub;
let configGetStub: sinon.SinonStub;
let configSetStub: sinon.SinonStub;
beforeEach(function () {
configGetStub = sinon.stub(config, 'get').callsFake((key) => {
if (key === 'region') return region.name;
Expand Down Expand Up @@ -176,18 +176,13 @@ describe('Region command', function () {
});
});

it('should set a valid region', function () {
const region = UserConfig.setRegion('NA');
expect(region).to.have.property('name', 'NA');
});

it('should get the default region if none is set', function () {
configGetStub.callsFake((key) => {
if (key === 'region') return undefined;
return undefined;
});
const region = UserConfig.getRegion();
expect(region).to.have.property('name', 'NA');
expect(region).to.have.property('name', 'AWS-NA');
});

it('should set a custom region with valid data', function () {
Expand Down Expand Up @@ -308,9 +303,9 @@ describe('Region Handler', function () {
});

it('askRegions should return selected region', async function () {
inquireStub.returns(Promise.resolve('NA'));
inquireStub.returns(Promise.resolve('AWS-NA'));
const result = await askRegions();
expect(result).to.equal('NA');
expect(result).to.equal('AWS-NA');
});

it('askCustomRegion should return custom region details', async function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-export/1.16.2 darwin-arm64 node-v22.14.0
@contentstack/cli-cm-export/1.16.3 darwin-x64 node-v22.16.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "1.16.2",
"version": "1.16.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
8 changes: 7 additions & 1 deletion packages/contentstack-export/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ const config: DefaultConfig = {
},
personalize: {
baseURL: {
NA: 'https://personalize-api.contentstack.com',
'AWS-NA': 'https://personalize-api.contentstack.com',
'AWS-EU': 'https://eu-personalize-api.contentstack.com',
'AWS-AU': 'https://au-personalize-api.contentstack.com',
'AZURE-NA': 'https://azure-na-personalize-api.contentstack.com',
'AZURE-EU': 'https://azure-eu-personalize-api.contentstack.com',
'GCP-NA': 'https://gcp-na-personalize-api.contentstack.com',
'GCP-EU': 'https://gcp-eu-personalize-api.contentstack.com',
},
dirName: 'personalize',
exportOrder: ['attributes', 'audiences', 'events', 'experiences'],
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"UNIT_EXECUTION_ORDER": [],
"INTEGRATION_EXECUTION_ORDER": [],
"ENABLE_PREREQUISITES": true,
"REGIONS": ["NA", "EU", "AZURE-NA", "AZURE-EU"],
"REGIONS": ["AWS-NA", "AWS-EU", "AWS-AU", "AZURE-NA", "AZURE-EU", "GCP-NA", "GCP-EU"],
"apiKey": "***REMOVED***"
}
2 changes: 1 addition & 1 deletion packages/contentstack-export/test/integration/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"PRINT_LOGS": true,
"REGION_NAME": "NA",
"REGION_NAME": "AWS-NA",
"DEFAULT_TIMEOUT": 600000,
"EXPORT_PATH": "./contents",
"ALIAS_NAME": "marketplace_api",
Expand Down
Loading
Loading