From c4f604ad7474baf67e5b6a73fc9e472644481648 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Fri, 9 Feb 2024 19:07:06 +0530 Subject: [PATCH] replaced cdn by appHost for generating the rest-preview urls --- .../contentstack-auth/test/integration/auth.test.ts | 2 +- .../contentstack-auth/test/unit/auth-handler.test.ts | 6 +++--- .../test/unit/commands/login.test.ts | 6 +++--- .../test/unit/commands/logout.test.ts | 2 +- .../test/unit/commands/whoami.test.ts | 4 ++-- .../contentstack-bootstrap/src/bootstrap/utils.ts | 2 +- .../test/integration/init.test.js | 2 +- packages/contentstack-import/.env.sample | 4 ++-- .../test/integration/init.test.js | 2 +- .../test/dummy/entriesResponse.json | 12 ++++++------ packages/contentstack-migration/README.md | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/contentstack-auth/test/integration/auth.test.ts b/packages/contentstack-auth/test/integration/auth.test.ts index 410f69636d..6404a19998 100644 --- a/packages/contentstack-auth/test/integration/auth.test.ts +++ b/packages/contentstack-auth/test/integration/auth.test.ts @@ -10,7 +10,7 @@ const messageFilePath = path.join(__dirname, '..', '..', '..', 'contentstack-uti const crypto = new NodeCrypto({ typeIdentifier: '◈', algorithm: 'aes-192-cbc', - encryptionKey: process.env.ENCRYPTION_KEY || '***REMOVED***' + encryptionKey: process.env.ENCRYPTION_KEY || 'gjh67567mn' }); const username = process.env.ENCRYPTION_KEY ? crypto.decrypt(process.env.USERNAME) : process.env.USERNAME const password = process.env.ENCRYPTION_KEY ? crypto.decrypt(process.env.PASSWORD) : process.env.PASSWORD diff --git a/packages/contentstack-auth/test/unit/auth-handler.test.ts b/packages/contentstack-auth/test/unit/auth-handler.test.ts index ead258f36f..72b30f0e68 100644 --- a/packages/contentstack-auth/test/unit/auth-handler.test.ts +++ b/packages/contentstack-auth/test/unit/auth-handler.test.ts @@ -4,9 +4,9 @@ import { authHandler, interactive } from '../../src/utils'; import { CLIError, cliux } from '@contentstack/cli-utilities'; import { User } from '../../src/interfaces'; -const user: User = { email: '***REMOVED***', authtoken: 'testtoken' }; -const credentials = { email: '***REMOVED***', password: 'testpassword' }; -const invalidCredentials = { email: '***REMOVED***', password: 'invalidpassword' }; +const user: User = { email: 'test@contentstack.com', authtoken: 'testtoken' }; +const credentials = { email: 'test@contentstack.com', password: 'testpassword' }; +const invalidCredentials = { email: 'test@contentstack.com', password: 'invalidpassword' }; let TFAEnabled = false; let TFAChannel = 'authy'; const TFATestToken = '24563992'; diff --git a/packages/contentstack-auth/test/unit/commands/login.test.ts b/packages/contentstack-auth/test/unit/commands/login.test.ts index c91a4d106f..f89c83bd4f 100644 --- a/packages/contentstack-auth/test/unit/commands/login.test.ts +++ b/packages/contentstack-auth/test/unit/commands/login.test.ts @@ -6,9 +6,9 @@ import { configHandler, cliux } from '@contentstack/cli-utilities'; const config = configHandler; -const user = { email: '***REMOVED***', authtoken: 'testtoken' }; -const credentials = { email: '***REMOVED***', password: 'testpassword' }; -const invalidCredentials = { email: '***REMOVED***', password: 'invalidpassword' }; +const user = { email: 'test@contentstack.com', authtoken: 'testtoken' }; +const credentials = { email: 'test@contentstack.com', password: 'testpassword' }; +const invalidCredentials = { email: 'test@contentstack.com', password: 'invalidpassword' }; const TFATestToken = '24563992'; describe('Login Command', () => { diff --git a/packages/contentstack-auth/test/unit/commands/logout.test.ts b/packages/contentstack-auth/test/unit/commands/logout.test.ts index 6ccf39abed..0b16451c64 100644 --- a/packages/contentstack-auth/test/unit/commands/logout.test.ts +++ b/packages/contentstack-auth/test/unit/commands/logout.test.ts @@ -4,7 +4,7 @@ import LogoutCommand from '../../../src/commands/auth/logout'; import { authHandler } from '../../../src/utils'; import { CLIError, cliux } from '@contentstack/cli-utilities'; -const user = { email: '***REMOVED***', authtoken: 'testtoken' }; +const user = { email: 'test@contentstack.com', authtoken: 'testtoken' }; const validAuthToken = 'bltadjkjdkjfd'; describe('Logout Command', () => { diff --git a/packages/contentstack-auth/test/unit/commands/whoami.test.ts b/packages/contentstack-auth/test/unit/commands/whoami.test.ts index b259141a5e..f90b00b2b9 100644 --- a/packages/contentstack-auth/test/unit/commands/whoami.test.ts +++ b/packages/contentstack-auth/test/unit/commands/whoami.test.ts @@ -7,7 +7,7 @@ describe('Whoami Command', () => { let getEmailStub; before(function () { getEmailStub = sinon.stub(WhoamiCommand.prototype, 'email').get(function getterFn() { - return '***REMOVED***'; + return 'test@contentstack.com'; }); }); @@ -17,7 +17,7 @@ describe('Whoami Command', () => { it('Logged in user, displays the username', async function () { const getEmailStub = sinon.stub(WhoamiCommand.prototype, 'email').get(function getterFn() { - return '***REMOVED***'; + return 'test@contentstack.com'; }); const successMessageStub = sinon.stub(cliux, 'print').returns(); await WhoamiCommand.run([]); diff --git a/packages/contentstack-bootstrap/src/bootstrap/utils.ts b/packages/contentstack-bootstrap/src/bootstrap/utils.ts index 13e2bfab4d..daa053e1ae 100644 --- a/packages/contentstack-bootstrap/src/bootstrap/utils.ts +++ b/packages/contentstack-bootstrap/src/bootstrap/utils.ts @@ -143,7 +143,7 @@ const envFileHandler = async ( let appHost: string; const managementAPIHost = region?.cma?.substring('8'); const regionName = region && region.name && region.name.toLowerCase(); - previewHost = region?.cda?.substring(8)?.replace('cdn', 'rest-preview'); + previewHost = region?.uiHost?.substring(8)?.replace('app', 'rest-preview'); appHost = region?.uiHost?.substring(8); const isUSRegion = regionName === 'us' || regionName === 'na'; if (regionName !== 'eu' && !isUSRegion) { diff --git a/packages/contentstack-export/test/integration/init.test.js b/packages/contentstack-export/test/integration/init.test.js index 105e507ce8..7f6f01d8b8 100644 --- a/packages/contentstack-export/test/integration/init.test.js +++ b/packages/contentstack-export/test/integration/init.test.js @@ -14,7 +14,7 @@ const { APP_ENV, DELIMITER, KEY_VAL_DELIMITER } = process.env const crypto = new NodeCrypto({ typeIdentifier: '◈', algorithm: 'aes-192-cbc', - encryptionKey: ENCRYPTION_KEY || '***REMOVED***' + encryptionKey: ENCRYPTION_KEY || 'gjh67567mn' }); module.exports = (region) => { diff --git a/packages/contentstack-import/.env.sample b/packages/contentstack-import/.env.sample index f408e61bf1..8015940072 100644 --- a/packages/contentstack-import/.env.sample +++ b/packages/contentstack-import/.env.sample @@ -1,8 +1,8 @@ APP_ENV=DEV # PROD, STAGE -NA_PASSWORD=***REMOVED*** -NA_USERNAME=***REMOVED*** +NA_PASSWORD=Test1234 +NA_USERNAME=test@contentstack.com # Config package specific ENCRYPT_CONF=true diff --git a/packages/contentstack-import/test/integration/init.test.js b/packages/contentstack-import/test/integration/init.test.js index 67e8998b17..a0490052d1 100644 --- a/packages/contentstack-import/test/integration/init.test.js +++ b/packages/contentstack-import/test/integration/init.test.js @@ -14,7 +14,7 @@ const { DELIMITER, KEY_VAL_DELIMITER } = process.env; const crypto = new NodeCrypto({ typeIdentifier: '◈', algorithm: 'aes-192-cbc', - encryptionKey: ENCRYPTION_KEY || '***REMOVED***' + encryptionKey: ENCRYPTION_KEY || 'gjh67567mn' }); module.exports = (region) => { diff --git a/packages/contentstack-migrate-rte/test/dummy/entriesResponse.json b/packages/contentstack-migrate-rte/test/dummy/entriesResponse.json index b8dcbb7c9c..314af01eb4 100644 --- a/packages/contentstack-migrate-rte/test/dummy/entriesResponse.json +++ b/packages/contentstack-migrate-rte/test/dummy/entriesResponse.json @@ -260,7 +260,7 @@ "file_size": "344996", "tags": [], "filename": "image.png", - "url": "***REMOVED***bltab83acc0e405b6f8/60fe92d4fe65cc54a3e7e5c3/image.png", + "url": "***REMOVED***46cc5/bltab83acc0e405b6f8/60fe92d4fe65cc54a3e7e5c3/image.png", "ACL": [], "is_dir": false, "parent_uid": null, @@ -287,7 +287,7 @@ "file_size": "7701", "tags": [], "filename": "48558898.jpeg", - "url": "***REMOVED***bltb13b08635ebffdc4/6048c0c887ab224351aab15f/48558898.jpeg", + "url": "***REMOVED***46cc5/bltb13b08635ebffdc4/6048c0c887ab224351aab15f/48558898.jpeg", "ACL": [], "is_dir": false, "parent_uid": null, @@ -309,7 +309,7 @@ "file_size": "5403", "tags": [], "filename": "download.jpeg", - "url": "***REMOVED***bltb85f710a4a984858/6049fa897477c27b7b34443d/download.jpeg", + "url": "***REMOVED***46cc5/bltb85f710a4a984858/6049fa897477c27b7b34443d/download.jpeg", "ACL": [], "is_dir": false, "parent_uid": null, @@ -332,7 +332,7 @@ "file_size": "5906", "tags": [], "filename": "download_(2).jpeg", - "url": "***REMOVED***blt3d60320b8e0b9b0a/6040b819116a7015b467265e/download_(2).jpeg", + "url": "***REMOVED***46cc5/blt3d60320b8e0b9b0a/6040b819116a7015b467265e/download_(2).jpeg", "ACL": [], "is_dir": false, "parent_uid": null, @@ -363,7 +363,7 @@ "file_size": "344996", "tags": [], "filename": "image.png", - "url": "***REMOVED***bltab83acc0e405b6f8/60fe92d4fe65cc54a3e7e5c3/image.png", + "url": "***REMOVED***46cc5/bltab83acc0e405b6f8/60fe92d4fe65cc54a3e7e5c3/image.png", "ACL": [], "is_dir": false, "parent_uid": null, @@ -394,7 +394,7 @@ "file_size": "344996", "tags": [], "filename": "image.png", - "url": "***REMOVED***bltab83acc0e405b6f8/60fe92d4fe65cc54a3e7e5c3/image.png", + "url": "***REMOVED***46cc5/bltab83acc0e405b6f8/60fe92d4fe65cc54a3e7e5c3/image.png", "ACL": [], "is_dir": false, "parent_uid": null, diff --git a/packages/contentstack-migration/README.md b/packages/contentstack-migration/README.md index 53eda842c2..71128f8bff 100644 --- a/packages/contentstack-migration/README.md +++ b/packages/contentstack-migration/README.md @@ -5,7 +5,7 @@ The Contentstack CLI’s “Migration” plugin allows developers to automate th [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io) [![Version](https://img.shields.io/npm/v/@contentstack/cli-migration.svg)](https://npmjs.org/package/@contentstack/cli-migration) [![Downloads/week](https://img.shields.io/npm/dw/@contentstack/cli-migration.svg)](https://npmjs.org/package/@contentstack/cli-migration) -[![License](https://img.shields.io/npm/l/@contentstack/cli-migration.svg)](https://github.com/***REMOVED***/cli-migration/blob/master/package.json) +[![License](https://img.shields.io/npm/l/@contentstack/cli-migration.svg)](https://github.com/ninadhatkar/cli-migration/blob/master/package.json) * [@contentstack/cli-migration](#contentstackcli-migration)