From c933f8112d867a4e3bf21835eb9e7e0c01ef8c8b Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Thu, 9 May 2024 11:05:37 +0530 Subject: [PATCH 1/3] feat: handled variant api errors --- package-lock.json | 18 +-- .../src/export/modules/personalization.ts | 3 +- .../src/import/modules/personalization.ts | 4 + .../src/export/attributes.ts | 6 +- .../src/export/audiences.ts | 6 +- .../src/export/events.ts | 6 +- .../src/export/experiences.ts | 2 +- .../src/export/projects.ts | 4 +- .../src/import/attribute.ts | 6 +- .../src/import/audiences.ts | 6 +- .../src/import/events.ts | 6 +- .../src/import/experiences.ts | 9 +- .../src/messages/index.ts | 2 +- .../src/types/personalization-api-adapter.ts | 25 +++- .../src/utils/personalization-api-adapter.ts | 113 +++++++++++++++--- pnpm-lock.yaml | 15 --- 16 files changed, 142 insertions(+), 89 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90c7ebb541..7650cf1b41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23515,10 +23515,6 @@ "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", "dev": true }, - "node_modules/variant-test": { - "resolved": "packages/variant-test", - "link": true - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -28492,6 +28488,7 @@ }, "packages/variant-test": { "version": "1.0.0", + "extraneous": true, "license": "ISC", "dependencies": { "@contentstack/cli-cm-import": "^1.14.1", @@ -28502,19 +28499,6 @@ "devDependencies": { "typescript": "^5.4.5" } - }, - "packages/variant-test/node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } } } } diff --git a/packages/contentstack-export/src/export/modules/personalization.ts b/packages/contentstack-export/src/export/modules/personalization.ts index 17096edb25..fe511e4e06 100644 --- a/packages/contentstack-export/src/export/modules/personalization.ts +++ b/packages/contentstack-export/src/export/modules/personalization.ts @@ -39,8 +39,7 @@ export default class ExportPersonalization { } } catch (error) { this.exportConfig.personalizationEnabled = false; - log(this.exportConfig, `Failed to export Personalization project. ${formatError(error)}`, 'error'); - log(this.exportConfig, error, 'error'); + log(this.exportConfig, `Failed to export Personalization project! ${error}`, 'error'); } } } diff --git a/packages/contentstack-import/src/import/modules/personalization.ts b/packages/contentstack-import/src/import/modules/personalization.ts index f9f6aac841..2389ff9b65 100644 --- a/packages/contentstack-import/src/import/modules/personalization.ts +++ b/packages/contentstack-import/src/import/modules/personalization.ts @@ -35,7 +35,11 @@ export default class ImportPersonalization { } } } catch (error) { + this.config.modules.personalization.importData = false; // Stop personalization import if project creation fails log(this.config, error, 'error'); + if (!this.personalization.importData){ + log(this.config, 'Skipping personalization migration...', 'warn') + } } } } diff --git a/packages/contentstack-variants/src/export/attributes.ts b/packages/contentstack-variants/src/export/attributes.ts index e57c467ea8..f4a0bc8f89 100644 --- a/packages/contentstack-variants/src/export/attributes.ts +++ b/packages/contentstack-variants/src/export/attributes.ts @@ -42,10 +42,8 @@ export default class ExportAttributes extends PersonalizationAdapter { log(this.exportConfig, 'All the events have been exported successfully!', 'success'); return; } - } catch (error: any) { - if (error?.errorMessage || error?.message || error?.error_message) { - log(this.exportConfig, `Failed to export events! ${formatError(error)}`, 'error'); - } + } catch (error) { + log(this.exportConfig, `Failed to export events!`, 'error'); throw error; } } diff --git a/packages/contentstack-variants/src/export/experiences.ts b/packages/contentstack-variants/src/export/experiences.ts index c5fe00c646..d4589b918b 100644 --- a/packages/contentstack-variants/src/export/experiences.ts +++ b/packages/contentstack-variants/src/export/experiences.ts @@ -51,7 +51,7 @@ export default class ExportExperiences extends PersonalizationAdapter this.exportConfig.personalizationEnabled = false; return; } - this.exportConfig.project_id = project[0].uid; this.exportConfig.personalizationEnabled = true; this.exportConfig.project_id = project[0]?.uid; fsUtil.writeFile(path.resolve(this.projectFolderPath, 'projects.json'), project); + log(this.exportConfig, 'Project exported successfully!', 'success'); } catch (error) { - log(this.exportConfig, `Failed to export projects ${formatError(error)}`, 'error'); + log(this.exportConfig, `Failed to export projects!`, 'error'); throw error; } } diff --git a/packages/contentstack-variants/src/import/attribute.ts b/packages/contentstack-variants/src/import/attribute.ts index 1d8ad68b42..76b2a83e94 100644 --- a/packages/contentstack-variants/src/import/attribute.ts +++ b/packages/contentstack-variants/src/import/attribute.ts @@ -51,10 +51,8 @@ export default class Attribute extends PersonalizationAdapter { fsUtil.writeFile(this.attributesUidMapperPath, this.attributesUidMapper); this.log(this.config, this.$t(this.messages.CREATE_SUCCESS, { module: 'Attributes' }), 'info'); - } catch (error: any) { - if (error?.errorMessage || error?.message || error?.error_message) { - this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Attributes' }), 'error'); - } + } catch (error) { + this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Attributes' }), 'error'); throw error; } } diff --git a/packages/contentstack-variants/src/import/audiences.ts b/packages/contentstack-variants/src/import/audiences.ts index 2b1d42053f..51e7d1d32c 100644 --- a/packages/contentstack-variants/src/import/audiences.ts +++ b/packages/contentstack-variants/src/import/audiences.ts @@ -60,10 +60,8 @@ export default class Audiences extends PersonalizationAdapter { fsUtil.writeFile(this.audiencesUidMapperPath, this.audiencesUidMapper); this.log(this.config, this.$t(this.messages.CREATE_SUCCESS, { module: 'Audiences' }), 'info'); - } catch (error: any) { - if (error?.errorMessage || error?.message || error?.error_message) { - this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Audiences' }), 'error'); - } + } catch (error) { + this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Audiences' }), 'error'); throw error; } } diff --git a/packages/contentstack-variants/src/import/events.ts b/packages/contentstack-variants/src/import/events.ts index 1c0335d813..40ca315f78 100644 --- a/packages/contentstack-variants/src/import/events.ts +++ b/packages/contentstack-variants/src/import/events.ts @@ -49,10 +49,8 @@ export default class Events extends PersonalizationAdapter { fsUtil.writeFile(this.eventsUidMapperPath, this.eventsUidMapper); this.log(this.config, this.$t(this.messages.CREATE_SUCCESS, { module: 'Events' }), 'info'); - } catch (error: any) { - if (error?.errorMessage || error?.message || error?.error_message) { - this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Events' }), 'error'); - } + } catch (error) { + this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Events' }), 'error'); throw error; } } diff --git a/packages/contentstack-variants/src/import/experiences.ts b/packages/contentstack-variants/src/import/experiences.ts index bd627ea13e..583fcb0719 100644 --- a/packages/contentstack-variants/src/import/experiences.ts +++ b/packages/contentstack-variants/src/import/experiences.ts @@ -111,12 +111,9 @@ export default class Experiences extends PersonalizationAdapter { } await this.createVariantIdMapper(); - } catch (error: any) { - if (error?.errorMessage || error?.message || error?.error_message) { - this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Experiences' }), 'error'); - } else { - this.log(this.config, error, 'error'); - } + } catch (error) { + this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Experiences' }), 'error'); + throw error; } } } diff --git a/packages/contentstack-variants/src/messages/index.ts b/packages/contentstack-variants/src/messages/index.ts index bfaf6d2b9c..4439565169 100644 --- a/packages/contentstack-variants/src/messages/index.ts +++ b/packages/contentstack-variants/src/messages/index.ts @@ -1,7 +1,7 @@ import memoize from 'lodash/memoize'; const errors = { - CREATE_FAILURE: '{module} created failed!', + CREATE_FAILURE: '{module} creation failed!', }; const commonMsg = { diff --git a/packages/contentstack-variants/src/types/personalization-api-adapter.ts b/packages/contentstack-variants/src/types/personalization-api-adapter.ts index dd6d278780..f81dc602ce 100644 --- a/packages/contentstack-variants/src/types/personalization-api-adapter.ts +++ b/packages/contentstack-variants/src/types/personalization-api-adapter.ts @@ -114,7 +114,7 @@ export type ExperienceStruct = { _cms?: { variantGroup: object; variants: Record; - } + }; } & AnyProperty; export interface CreateExperienceInput { @@ -138,6 +138,25 @@ export interface CMSExperienceStruct { contentTypes: string[]; } +export type VariantAPIRes = + | ProjectStruct[] + | ProjectStruct + | AttributeStruct[] + | AttributeStruct + | ExperienceStruct[] + | EventStruct[] + | AudienceStruct[] + | ExperienceStruct + | EventStruct + | AudienceStruct + | CMSExperienceStruct + | Error; + +export interface APIResponse { + status: number; + data: any; + } + export interface Personalization extends AdapterHelperInterface { projects(options: GetProjectsParams): Promise; @@ -157,5 +176,7 @@ export interface Personalization extends AdapterHelperInterface; - updateCTsInExperience(experience: UpdateExperienceInput, experienceUid: string): Promise; + updateCTsInExperience(experience: UpdateExperienceInput, experienceUid: string): Promise; + + handleVariantAPIRes(res: any): VariantAPIRes; } diff --git a/packages/contentstack-variants/src/utils/personalization-api-adapter.ts b/packages/contentstack-variants/src/utils/personalization-api-adapter.ts index 8112570036..64d9949f13 100644 --- a/packages/contentstack-variants/src/utils/personalization-api-adapter.ts +++ b/packages/contentstack-variants/src/utils/personalization-api-adapter.ts @@ -18,15 +18,19 @@ import { ExperienceStruct, UpdateExperienceInput, CMSExperienceStruct, + VariantAPIRes, + APIResponse } from '../types'; + export class PersonalizationAdapter extends AdapterHelper implements Personalization { constructor(options: APIConfig) { super(options); } - async projects(options: GetProjectsParams, projects: ProjectStruct[] = []): Promise { + async projects(options: GetProjectsParams): Promise { const getProjectEndPoint = `/projects?connectedStackApiKey=${options.connectedStackApiKey}`; - return (await this.apiClient.get(getProjectEndPoint)).data; + const data = await this.apiClient.get(getProjectEndPoint); + return this.handleVariantAPIRes(data) as ProjectStruct[]; } /** @@ -39,8 +43,9 @@ export class PersonalizationAdapter extends AdapterHelper impl * @returns The `createProject` function is returning a Promise that resolves to either a * `ProjectStruct` object or `void`. */ - async createProject(project: CreateProjectInput): Promise { - return (await this.apiClient.post('/projects', project)).data; + async createProject(project: CreateProjectInput): Promise { + const data = await this.apiClient.post('/projects', project); + return this.handleVariantAPIRes(data) as ProjectStruct; } /** @@ -52,41 +57,49 @@ export class PersonalizationAdapter extends AdapterHelper impl * `/attributes` endpoint using the `apiClient` with the input provided. The data returned is of type * `ProjectStruct`. */ - async createAttribute(attribute: CreateAttributeInput): Promise { - return (await this.apiClient.post('/attributes', attribute)).data; + async createAttribute(attribute: CreateAttributeInput): Promise { + const data = await this.apiClient.post('/attributes', attribute); + return this.handleVariantAPIRes(data) as AttributeStruct; } - async getExperiences(): Promise { + async getExperiences(): Promise { const getExperiencesEndPoint = `/experiences`; - return (await this.apiClient.get(getExperiencesEndPoint)).data; + const data = await this.apiClient.get(getExperiencesEndPoint); + return this.handleVariantAPIRes(data) as ExperienceStruct[]; } - async getExperience(experienceUid: string): Promise { + async getExperience(experienceUid: string): Promise { const getExperiencesEndPoint = `/experiences/${experienceUid}`; - return (await this.apiClient.get(getExperiencesEndPoint)).data; + const data = await this.apiClient.get(getExperiencesEndPoint); + return this.handleVariantAPIRes(data) as ExperienceStruct; } async getVariantGroup(input: GetVariantGroupInput): Promise { const getVariantGroupEndPoint = `/experiences/${input.experienceUid}`; - return (await this.apiClient.get(getVariantGroupEndPoint)).data; + const data = await this.apiClient.get(getVariantGroupEndPoint); + return this.handleVariantAPIRes(data) as ExperienceStruct; } async updateVariantGroup(input: unknown): Promise {} async getEvents(): Promise { - return (await this.apiClient.get('/events')).data; + const data = await this.apiClient.get('/events'); + return this.handleVariantAPIRes(data) as EventStruct[]; } async createEvents(event: CreateEventInput): Promise { - return (await this.apiClient.post('/events', event)).data; + const data = await this.apiClient.post('/events', event); + return this.handleVariantAPIRes(data) as EventStruct; } async getAudiences(): Promise { - return (await this.apiClient.get('/audiences')).data; + const data = await this.apiClient.get('/audiences'); + return this.handleVariantAPIRes(data) as AudienceStruct[]; } async getAttributes(): Promise { - return (await this.apiClient.get('/attributes')).data; + const data = await this.apiClient.get('/attributes'); + return this.handleVariantAPIRes(data) as AttributeStruct[]; } /** @@ -98,7 +111,8 @@ export class PersonalizationAdapter extends AdapterHelper impl * `AudienceStruct`. */ async createAudience(audience: CreateAudienceInput): Promise { - return (await this.apiClient.post('/audiences', audience)).data; + const data = await this.apiClient.post('/audiences', audience); + return this.handleVariantAPIRes(data) as AudienceStruct; } /** @@ -110,7 +124,8 @@ export class PersonalizationAdapter extends AdapterHelper impl * `ExperienceStruct`. */ async createExperience(experience: CreateExperienceInput): Promise { - return (await this.apiClient.post('/experiences', experience)).data; + const data = await this.apiClient.post('/experiences', experience); + return this.handleVariantAPIRes(data) as ExperienceStruct; } /** @@ -123,7 +138,8 @@ export class PersonalizationAdapter extends AdapterHelper impl experienceUid: string, ): Promise { const updateCTInExpEndPoint = `/experiences/${experienceUid}/cms-integration/variant-group`; - return (await this.apiClient.post(updateCTInExpEndPoint, experience)).data; + const data = await this.apiClient.post(updateCTInExpEndPoint, experience); + return this.handleVariantAPIRes(data) as CMSExperienceStruct; } /** @@ -133,6 +149,65 @@ export class PersonalizationAdapter extends AdapterHelper impl */ async getCTsFromExperience(experienceUid: string): Promise { const getCTFromExpEndPoint = `/experiences/${experienceUid}/cms-integration/variant-group`; - return (await this.apiClient.get(getCTFromExpEndPoint)).data; + const data = await this.apiClient.get(getCTFromExpEndPoint); + return this.handleVariantAPIRes(data) as CMSExperienceStruct; + } + + /** + * Handles the API response for variant requests. + * @param res - The API response object. + * @returns The variant API response data. + * @throws If the API response status is not within the success range, an error message is thrown. + */ + handleVariantAPIRes(res: APIResponse): VariantAPIRes { + const { status, data } = res; + + if (status >= 200 && status < 300) { + return data; + } + + let errorMsg: string; + if(data){ + if (data?.errors && Object.keys(data.errors).length > 0) { + errorMsg = this.formatErrors(data.errors); + } else if (data?.error_message) { + errorMsg = data.error_message; + } else if (data?.message) { + errorMsg = data.message; + } else { + errorMsg = data; + } + }else{ + errorMsg = 'Something went wrong while processing your request!'; + } + + throw errorMsg; + } + + /** + * Formats the errors into a single string. + * @param errors - The errors to be formatted. + * @returns The formatted errors as a string. + */ + formatErrors(errors: any): string { + const errorMessages: string[] = []; + + for (const errorKey in errors) { + const errorValue = errors[errorKey]; + if (Array.isArray(errorValue)) { + errorMessages.push(...errorValue.map((error: any) => this.formatError(error))); + } else { + errorMessages.push(this.formatError(errorValue)); + } + } + + return errorMessages.join(' '); + } + + formatError(error: any): string { + if (typeof error === 'object') { + return Object.values(error).join(' '); + } + return String(error); } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f671cc0567..f9df31b3ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1179,21 +1179,6 @@ importers: tslib: 2.6.2 typescript: 5.4.5 - packages/variant-test: - specifiers: - '@contentstack/cli-cm-import': ^1.14.1 - '@contentstack/cli-utilities': ^1.5.12 - '@contentstack/cli-variants': ^0.0.1-alpha - lodash: ^4.17.21 - typescript: ^5.4.5 - dependencies: - '@contentstack/cli-cm-import': link:../contentstack-import - '@contentstack/cli-utilities': link:../contentstack-utilities - '@contentstack/cli-variants': link:../contentstack-variants - lodash: 4.17.21 - devDependencies: - typescript: 5.4.5 - packages: /@aashutoshrathi/word-wrap/1.2.6: From c63319932279feecd8de14a1fc14888e305cdf3e Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Thu, 9 May 2024 11:28:35 +0530 Subject: [PATCH 2/3] fix: attribute, audience, event & experience fail cases --- .../contentstack-export/src/export/modules/personalization.ts | 2 +- packages/contentstack-import/src/config/index.ts | 2 +- packages/contentstack-variants/src/export/attributes.ts | 4 +--- packages/contentstack-variants/src/export/audiences.ts | 2 +- packages/contentstack-variants/src/export/events.ts | 2 +- packages/contentstack-variants/src/export/experiences.ts | 2 +- packages/contentstack-variants/src/import/attribute.ts | 2 +- packages/contentstack-variants/src/import/audiences.ts | 2 +- packages/contentstack-variants/src/import/events.ts | 2 +- packages/contentstack-variants/src/import/experiences.ts | 2 +- 10 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/contentstack-export/src/export/modules/personalization.ts b/packages/contentstack-export/src/export/modules/personalization.ts index fe511e4e06..423a00d7ce 100644 --- a/packages/contentstack-export/src/export/modules/personalization.ts +++ b/packages/contentstack-export/src/export/modules/personalization.ts @@ -39,7 +39,7 @@ export default class ExportPersonalization { } } catch (error) { this.exportConfig.personalizationEnabled = false; - log(this.exportConfig, `Failed to export Personalization project! ${error}`, 'error'); + log(this.exportConfig, error, 'error'); } } } diff --git a/packages/contentstack-import/src/config/index.ts b/packages/contentstack-import/src/config/index.ts index c3145358ee..418000cd05 100644 --- a/packages/contentstack-import/src/config/index.ts +++ b/packages/contentstack-import/src/config/index.ts @@ -15,7 +15,7 @@ const config: DefaultConfig = { // locales: ['fr-fr'], host: 'https://api.contentstack.io/v3', extensionHost: 'https://app.contentstack.com', - personalizationHost: 'https://personalization-api.contentstack.com', + personalizationHost: 'https://dev-personalization-api.csnonprod.com', developerHubUrls: { 'https://api.contentstack.io': 'https://developerhub-api.contentstack.com', 'https://eu-api.contentstack.com': 'https://eu-developerhub-api.contentstack.com', diff --git a/packages/contentstack-variants/src/export/attributes.ts b/packages/contentstack-variants/src/export/attributes.ts index f4a0bc8f89..1f2a875398 100644 --- a/packages/contentstack-variants/src/export/attributes.ts +++ b/packages/contentstack-variants/src/export/attributes.ts @@ -35,16 +35,14 @@ export default class ExportAttributes extends PersonalizationAdapter { } } catch (error) { log(this.exportConfig, `Failed to export events!`, 'error'); - throw error; + log(this.config, error, 'error'); } } diff --git a/packages/contentstack-variants/src/export/experiences.ts b/packages/contentstack-variants/src/export/experiences.ts index d4589b918b..ab7861b3fa 100644 --- a/packages/contentstack-variants/src/export/experiences.ts +++ b/packages/contentstack-variants/src/export/experiences.ts @@ -52,7 +52,7 @@ export default class ExportExperiences extends PersonalizationAdapter { this.log(this.config, this.$t(this.messages.CREATE_SUCCESS, { module: 'Attributes' }), 'info'); } catch (error) { this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Attributes' }), 'error'); - throw error; + this.log(this.config, error, 'error'); } } } diff --git a/packages/contentstack-variants/src/import/audiences.ts b/packages/contentstack-variants/src/import/audiences.ts index 51e7d1d32c..3349bbcbca 100644 --- a/packages/contentstack-variants/src/import/audiences.ts +++ b/packages/contentstack-variants/src/import/audiences.ts @@ -62,7 +62,7 @@ export default class Audiences extends PersonalizationAdapter { this.log(this.config, this.$t(this.messages.CREATE_SUCCESS, { module: 'Audiences' }), 'info'); } catch (error) { this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Audiences' }), 'error'); - throw error; + this.log(this.config, error, 'error'); } } } diff --git a/packages/contentstack-variants/src/import/events.ts b/packages/contentstack-variants/src/import/events.ts index 40ca315f78..0529df22d7 100644 --- a/packages/contentstack-variants/src/import/events.ts +++ b/packages/contentstack-variants/src/import/events.ts @@ -51,7 +51,7 @@ export default class Events extends PersonalizationAdapter { this.log(this.config, this.$t(this.messages.CREATE_SUCCESS, { module: 'Events' }), 'info'); } catch (error) { this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Events' }), 'error'); - throw error; + this.log(this.config, error, 'error'); } } } diff --git a/packages/contentstack-variants/src/import/experiences.ts b/packages/contentstack-variants/src/import/experiences.ts index 583fcb0719..83736d0176 100644 --- a/packages/contentstack-variants/src/import/experiences.ts +++ b/packages/contentstack-variants/src/import/experiences.ts @@ -113,7 +113,7 @@ export default class Experiences extends PersonalizationAdapter { await this.createVariantIdMapper(); } catch (error) { this.log(this.config, this.$t(this.messages.CREATE_FAILURE, { module: 'Experiences' }), 'error'); - throw error; + this.log(this.config, error, 'error'); } } } From d70f22dc11943f8510c24958230b15849c1e539b Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Thu, 9 May 2024 11:33:24 +0530 Subject: [PATCH 3/3] revert dev url --- packages/contentstack-import/src/config/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contentstack-import/src/config/index.ts b/packages/contentstack-import/src/config/index.ts index 418000cd05..c3145358ee 100644 --- a/packages/contentstack-import/src/config/index.ts +++ b/packages/contentstack-import/src/config/index.ts @@ -15,7 +15,7 @@ const config: DefaultConfig = { // locales: ['fr-fr'], host: 'https://api.contentstack.io/v3', extensionHost: 'https://app.contentstack.com', - personalizationHost: 'https://dev-personalization-api.csnonprod.com', + personalizationHost: 'https://personalization-api.contentstack.com', developerHubUrls: { 'https://api.contentstack.io': 'https://developerhub-api.contentstack.com', 'https://eu-api.contentstack.com': 'https://eu-developerhub-api.contentstack.com',