@contentstack/cli-variants 0.0.1-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/export/attributes.d.ts +15 -0
- package/lib/export/attributes.js +62 -0
- package/lib/export/audiences.d.ts +15 -0
- package/lib/export/audiences.js +63 -0
- package/lib/export/events.d.ts +15 -0
- package/lib/export/events.js +63 -0
- package/lib/export/experiences.d.ts +9 -0
- package/lib/export/experiences.js +99 -0
- package/lib/export/index.d.ts +9 -0
- package/lib/export/index.js +21 -0
- package/lib/export/projects.d.ts +9 -0
- package/lib/export/projects.js +73 -0
- package/lib/export/variant-entries.d.ts +18 -0
- package/lib/export/variant-entries.js +109 -0
- package/lib/import/attribute.d.ts +17 -0
- package/lib/import/attribute.js +64 -0
- package/lib/import/audiences.d.ts +19 -0
- package/lib/import/audiences.js +71 -0
- package/lib/import/events.d.ts +17 -0
- package/lib/import/events.js +62 -0
- package/lib/import/experiences.d.ts +46 -0
- package/lib/import/experiences.js +214 -0
- package/lib/import/index.d.ts +14 -0
- package/lib/import/index.js +21 -0
- package/lib/import/project.d.ts +13 -0
- package/lib/import/project.js +74 -0
- package/lib/import/variant-entries.d.ts +98 -0
- package/lib/import/variant-entries.js +407 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +21 -0
- package/lib/messages/index.d.ts +35 -0
- package/lib/messages/index.js +55 -0
- package/lib/types/adapter-helper.d.ts +8 -0
- package/lib/types/adapter-helper.js +2 -0
- package/lib/types/content-types.d.ts +19 -0
- package/lib/types/content-types.js +2 -0
- package/lib/types/export-config.d.ts +264 -0
- package/lib/types/export-config.js +2 -0
- package/lib/types/import-config.d.ts +92 -0
- package/lib/types/import-config.js +2 -0
- package/lib/types/index.d.ts +8 -0
- package/lib/types/index.js +24 -0
- package/lib/types/personalization-api-adapter.d.ts +152 -0
- package/lib/types/personalization-api-adapter.js +2 -0
- package/lib/types/utils.d.ts +7 -0
- package/lib/types/utils.js +2 -0
- package/lib/types/variant-api-adapter.d.ts +49 -0
- package/lib/types/variant-api-adapter.js +2 -0
- package/lib/types/variant-entry.d.ts +47 -0
- package/lib/types/variant-entry.js +2 -0
- package/lib/utils/adapter-helper.d.ts +30 -0
- package/lib/utils/adapter-helper.js +95 -0
- package/lib/utils/attributes-helper.d.ts +7 -0
- package/lib/utils/attributes-helper.js +37 -0
- package/lib/utils/audiences-helper.d.ts +8 -0
- package/lib/utils/audiences-helper.js +49 -0
- package/lib/utils/error-helper.d.ts +6 -0
- package/lib/utils/error-helper.js +27 -0
- package/lib/utils/events-helper.d.ts +8 -0
- package/lib/utils/events-helper.js +27 -0
- package/lib/utils/helper.d.ts +4 -0
- package/lib/utils/helper.js +51 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.js +25 -0
- package/lib/utils/logger.d.ts +3 -0
- package/lib/utils/logger.js +175 -0
- package/lib/utils/personalization-api-adapter.d.ts +73 -0
- package/lib/utils/personalization-api-adapter.js +184 -0
- package/lib/utils/variant-api-adapter.d.ts +79 -0
- package/lib/utils/variant-api-adapter.js +263 -0
- package/package.json +38 -0
- package/src/export/attributes.ts +55 -0
- package/src/export/audiences.ts +57 -0
- package/src/export/events.ts +57 -0
- package/src/export/experiences.ts +80 -0
- package/src/export/index.ts +11 -0
- package/src/export/projects.ts +45 -0
- package/src/export/variant-entries.ts +88 -0
- package/src/import/attribute.ts +60 -0
- package/src/import/audiences.ts +69 -0
- package/src/import/events.ts +58 -0
- package/src/import/experiences.ts +224 -0
- package/src/import/index.ts +16 -0
- package/src/import/project.ts +71 -0
- package/src/import/variant-entries.ts +483 -0
- package/src/index.ts +5 -0
- package/src/messages/index.ts +63 -0
- package/src/types/adapter-helper.ts +10 -0
- package/src/types/content-types.ts +41 -0
- package/src/types/export-config.ts +292 -0
- package/src/types/import-config.ts +95 -0
- package/src/types/index.ts +8 -0
- package/src/types/personalization-api-adapter.ts +197 -0
- package/src/types/utils.ts +8 -0
- package/src/types/variant-api-adapter.ts +56 -0
- package/src/types/variant-entry.ts +61 -0
- package/src/utils/adapter-helper.ts +79 -0
- package/src/utils/attributes-helper.ts +31 -0
- package/src/utils/audiences-helper.ts +50 -0
- package/src/utils/error-helper.ts +26 -0
- package/src/utils/events-helper.ts +26 -0
- package/src/utils/helper.ts +34 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/logger.ts +160 -0
- package/src/utils/personalization-api-adapter.ts +188 -0
- package/src/utils/variant-api-adapter.ts +326 -0
- package/test/unit/export/variant-entries.test.ts +80 -0
- package/test/unit/import/variant-entries.test.ts +200 -0
- package/test/unit/mock/contents/content_types/CT-1.json +7 -0
- package/test/unit/mock/contents/entries/CT-1/en-us/variants/E-1/9b0da6xd7et72y-6gv7he23.json +12 -0
- package/test/unit/mock/contents/entries/CT-1/en-us/variants/E-1/index.json +3 -0
- package/test/unit/mock/contents/entries/CT-1/en-us/variants/E-2/9b0da6xd7et72y-6gv7he23.json +12 -0
- package/test/unit/mock/contents/entries/CT-1/en-us/variants/E-2/index.json +3 -0
- package/test/unit/mock/contents/mapper/assets/uid-mapping.json +6 -0
- package/test/unit/mock/contents/mapper/assets/url-mapping.json +6 -0
- package/test/unit/mock/contents/mapper/entries/data-for-variant-entry.json +6 -0
- package/test/unit/mock/contents/mapper/entries/empty-data/data-for-variant-entry.json +1 -0
- package/test/unit/mock/contents/mapper/entries/uid-mapping.json +6 -0
- package/test/unit/mock/contents/mapper/marketplace_apps/uid-mapping.json +3 -0
- package/test/unit/mock/contents/mapper/personalization/experiences/variants-uid-mapping.json +5 -0
- package/test/unit/mock/contents/mapper/taxonomies/terms/success.json +1 -0
- package/test/unit/mock/export-config.json +48 -0
- package/test/unit/mock/import-config.json +63 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PersonalizationAdapter } from '../utils';
|
|
2
|
+
import { PersonalizationConfig, ExportConfig } from '../types';
|
|
3
|
+
export default class ExportAttributes extends PersonalizationAdapter<ExportConfig> {
|
|
4
|
+
readonly exportConfig: ExportConfig;
|
|
5
|
+
private attributesConfig;
|
|
6
|
+
private attributesFolderPath;
|
|
7
|
+
private attributes;
|
|
8
|
+
personalizationConfig: PersonalizationConfig;
|
|
9
|
+
constructor(exportConfig: ExportConfig);
|
|
10
|
+
start(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* function to remove invalid keys from attributes object
|
|
13
|
+
*/
|
|
14
|
+
sanitizeAttribs(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
18
|
+
const utils_1 = require("../utils");
|
|
19
|
+
class ExportAttributes extends utils_1.PersonalizationAdapter {
|
|
20
|
+
constructor(exportConfig) {
|
|
21
|
+
super({
|
|
22
|
+
config: exportConfig,
|
|
23
|
+
baseURL: exportConfig.modules.personalization.baseURL[exportConfig.region.name],
|
|
24
|
+
headers: { authtoken: exportConfig.auth_token, 'X-Project-Uid': exportConfig.project_id },
|
|
25
|
+
});
|
|
26
|
+
this.exportConfig = exportConfig;
|
|
27
|
+
this.personalizationConfig = exportConfig.modules.personalization;
|
|
28
|
+
this.attributesConfig = exportConfig.modules.attributes;
|
|
29
|
+
this.attributesFolderPath = (0, node_path_1.resolve)((0, cli_utilities_1.sanitizePath)(exportConfig.data), (0, cli_utilities_1.sanitizePath)(exportConfig.branchName || ''), (0, cli_utilities_1.sanitizePath)(this.personalizationConfig.dirName), (0, cli_utilities_1.sanitizePath)(this.attributesConfig.dirName));
|
|
30
|
+
this.attributes = [];
|
|
31
|
+
}
|
|
32
|
+
start() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
var _a;
|
|
35
|
+
try {
|
|
36
|
+
(0, utils_1.log)(this.exportConfig, 'Starting attributes export', 'info');
|
|
37
|
+
yield utils_1.fsUtil.makeDirectory(this.attributesFolderPath);
|
|
38
|
+
this.attributes = (yield this.getAttributes());
|
|
39
|
+
if (!((_a = this.attributes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
40
|
+
(0, utils_1.log)(this.exportConfig, 'No Attributes found with the given project!', 'info');
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.sanitizeAttribs();
|
|
44
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)((0, cli_utilities_1.sanitizePath)(this.attributesFolderPath), (0, cli_utilities_1.sanitizePath)(this.attributesConfig.fileName)), this.attributes);
|
|
45
|
+
(0, utils_1.log)(this.exportConfig, 'All the attributes have been exported successfully!', 'success');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export attributes!`, 'error');
|
|
50
|
+
(0, utils_1.log)(this.config, error, 'error');
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* function to remove invalid keys from attributes object
|
|
56
|
+
*/
|
|
57
|
+
sanitizeAttribs() {
|
|
58
|
+
var _a;
|
|
59
|
+
this.attributes = ((_a = this.attributes) === null || _a === void 0 ? void 0 : _a.map((audience) => (0, omit_1.default)(audience, this.attributesConfig.invalidKeys))) || [];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.default = ExportAttributes;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PersonalizationAdapter } from '../utils';
|
|
2
|
+
import { PersonalizationConfig, ExportConfig } from '../types';
|
|
3
|
+
export default class ExportAudiences extends PersonalizationAdapter<ExportConfig> {
|
|
4
|
+
readonly exportConfig: ExportConfig;
|
|
5
|
+
private audiencesConfig;
|
|
6
|
+
private audiencesFolderPath;
|
|
7
|
+
private audiences;
|
|
8
|
+
personalizationConfig: PersonalizationConfig;
|
|
9
|
+
constructor(exportConfig: ExportConfig);
|
|
10
|
+
start(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* function to remove invalid keys from audience object
|
|
13
|
+
*/
|
|
14
|
+
sanitizeAttribs(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const utils_1 = require("../utils");
|
|
18
|
+
class ExportAudiences extends utils_1.PersonalizationAdapter {
|
|
19
|
+
constructor(exportConfig) {
|
|
20
|
+
super({
|
|
21
|
+
config: exportConfig,
|
|
22
|
+
baseURL: exportConfig.modules.personalization.baseURL[exportConfig.region.name],
|
|
23
|
+
headers: { authtoken: exportConfig.auth_token, 'X-Project-Uid': exportConfig.project_id },
|
|
24
|
+
});
|
|
25
|
+
this.exportConfig = exportConfig;
|
|
26
|
+
this.personalizationConfig = exportConfig.modules.personalization;
|
|
27
|
+
this.audiencesConfig = exportConfig.modules.audiences;
|
|
28
|
+
this.audiencesFolderPath = (0, node_path_1.resolve)(exportConfig.data, exportConfig.branchName || '', this.personalizationConfig.dirName, this.audiencesConfig.dirName);
|
|
29
|
+
this.audiences = [];
|
|
30
|
+
}
|
|
31
|
+
start() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
var _a;
|
|
34
|
+
try {
|
|
35
|
+
(0, utils_1.log)(this.exportConfig, 'Starting audiences export', 'info');
|
|
36
|
+
yield utils_1.fsUtil.makeDirectory(this.audiencesFolderPath);
|
|
37
|
+
this.audiences = (yield this.getAudiences());
|
|
38
|
+
if (!((_a = this.audiences) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
39
|
+
(0, utils_1.log)(this.exportConfig, 'No Audiences found with the given project!', 'info');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.sanitizeAttribs();
|
|
44
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.audiencesFolderPath, this.audiencesConfig.fileName), this.audiences);
|
|
45
|
+
(0, utils_1.log)(this.exportConfig, 'All the audiences have been exported successfully!', 'success');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export audiences!`, 'error');
|
|
51
|
+
(0, utils_1.log)(this.config, error, 'error');
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* function to remove invalid keys from audience object
|
|
57
|
+
*/
|
|
58
|
+
sanitizeAttribs() {
|
|
59
|
+
var _a;
|
|
60
|
+
this.audiences = ((_a = this.audiences) === null || _a === void 0 ? void 0 : _a.map((audience) => (0, omit_1.default)(audience, this.audiencesConfig.invalidKeys))) || [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.default = ExportAudiences;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PersonalizationAdapter } from '../utils';
|
|
2
|
+
import { PersonalizationConfig, ExportConfig } from '../types';
|
|
3
|
+
export default class ExportEvents extends PersonalizationAdapter<ExportConfig> {
|
|
4
|
+
readonly exportConfig: ExportConfig;
|
|
5
|
+
private eventsConfig;
|
|
6
|
+
private eventsFolderPath;
|
|
7
|
+
private events;
|
|
8
|
+
personalizationConfig: PersonalizationConfig;
|
|
9
|
+
constructor(exportConfig: ExportConfig);
|
|
10
|
+
start(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* function to remove invalid keys from event object
|
|
13
|
+
*/
|
|
14
|
+
sanitizeAttribs(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const utils_1 = require("../utils");
|
|
18
|
+
class ExportEvents extends utils_1.PersonalizationAdapter {
|
|
19
|
+
constructor(exportConfig) {
|
|
20
|
+
super({
|
|
21
|
+
config: exportConfig,
|
|
22
|
+
baseURL: exportConfig.modules.personalization.baseURL[exportConfig.region.name],
|
|
23
|
+
headers: { authtoken: exportConfig.auth_token, 'X-Project-Uid': exportConfig.project_id },
|
|
24
|
+
});
|
|
25
|
+
this.exportConfig = exportConfig;
|
|
26
|
+
this.personalizationConfig = exportConfig.modules.personalization;
|
|
27
|
+
this.eventsConfig = exportConfig.modules.events;
|
|
28
|
+
this.eventsFolderPath = (0, node_path_1.resolve)(exportConfig.data, exportConfig.branchName || '', this.personalizationConfig.dirName, this.eventsConfig.dirName);
|
|
29
|
+
this.events = [];
|
|
30
|
+
}
|
|
31
|
+
start() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
var _a;
|
|
34
|
+
try {
|
|
35
|
+
(0, utils_1.log)(this.exportConfig, 'Starting events export', 'info');
|
|
36
|
+
yield utils_1.fsUtil.makeDirectory(this.eventsFolderPath);
|
|
37
|
+
this.events = (yield this.getEvents());
|
|
38
|
+
if (!((_a = this.events) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
39
|
+
(0, utils_1.log)(this.exportConfig, 'No Events found with the given project!', 'info');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.sanitizeAttribs();
|
|
44
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.eventsFolderPath, this.eventsConfig.fileName), this.events);
|
|
45
|
+
(0, utils_1.log)(this.exportConfig, 'All the events have been exported successfully!', 'success');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export events!`, 'error');
|
|
51
|
+
(0, utils_1.log)(this.config, error, 'error');
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* function to remove invalid keys from event object
|
|
57
|
+
*/
|
|
58
|
+
sanitizeAttribs() {
|
|
59
|
+
var _a;
|
|
60
|
+
this.events = ((_a = this.events) === null || _a === void 0 ? void 0 : _a.map((event) => (0, omit_1.default)(event, this.eventsConfig.invalidKeys))) || [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.default = ExportEvents;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PersonalizationConfig, ExportConfig } from '../types';
|
|
2
|
+
import { PersonalizationAdapter } from '../utils';
|
|
3
|
+
export default class ExportExperiences extends PersonalizationAdapter<ExportConfig> {
|
|
4
|
+
private experiencesFolderPath;
|
|
5
|
+
exportConfig: ExportConfig;
|
|
6
|
+
personalizationConfig: PersonalizationConfig;
|
|
7
|
+
constructor(exportConfig: ExportConfig);
|
|
8
|
+
start(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const path = __importStar(require("path"));
|
|
36
|
+
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
37
|
+
const utils_1 = require("../utils");
|
|
38
|
+
class ExportExperiences extends utils_1.PersonalizationAdapter {
|
|
39
|
+
constructor(exportConfig) {
|
|
40
|
+
super({
|
|
41
|
+
config: exportConfig,
|
|
42
|
+
baseURL: exportConfig.modules.personalization.baseURL[exportConfig.region.name],
|
|
43
|
+
headers: { authtoken: exportConfig.auth_token, 'X-Project-Uid': exportConfig.project_id },
|
|
44
|
+
cmaConfig: {
|
|
45
|
+
baseURL: exportConfig.region.cma + `/v3`,
|
|
46
|
+
headers: { authtoken: exportConfig.auth_token, api_key: exportConfig.apiKey },
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
this.exportConfig = exportConfig;
|
|
50
|
+
this.personalizationConfig = exportConfig.modules.personalization;
|
|
51
|
+
this.experiencesFolderPath = path.resolve((0, cli_utilities_1.sanitizePath)(exportConfig.data), (0, cli_utilities_1.sanitizePath)(exportConfig.branchName || ''), (0, cli_utilities_1.sanitizePath)(this.personalizationConfig.dirName), 'experiences');
|
|
52
|
+
}
|
|
53
|
+
start() {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
var _a, _b, _c;
|
|
56
|
+
try {
|
|
57
|
+
// get all experiences
|
|
58
|
+
// loop through experiences and get content types attached to it
|
|
59
|
+
// write experiences in to a file
|
|
60
|
+
(0, utils_1.log)(this.exportConfig, 'Starting experiences export', 'info');
|
|
61
|
+
yield utils_1.fsUtil.makeDirectory(this.experiencesFolderPath);
|
|
62
|
+
const experiences = (yield this.getExperiences()) || [];
|
|
63
|
+
if (!experiences || (experiences === null || experiences === void 0 ? void 0 : experiences.length) < 1) {
|
|
64
|
+
(0, utils_1.log)(this.exportConfig, 'No Experiences found with the give project', 'info');
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
utils_1.fsUtil.writeFile(path.resolve((0, cli_utilities_1.sanitizePath)(this.experiencesFolderPath), 'experiences.json'), experiences);
|
|
68
|
+
const experienceToVariantsStrList = [];
|
|
69
|
+
const experienceToContentTypesMap = {};
|
|
70
|
+
for (let experience of experiences) {
|
|
71
|
+
// create id mapper for experience to variants
|
|
72
|
+
let variants = (_b = (_a = experience === null || experience === void 0 ? void 0 : experience._cms) === null || _a === void 0 ? void 0 : _a.variants) !== null && _b !== void 0 ? _b : {};
|
|
73
|
+
Object.keys(variants).forEach((variantShortId) => {
|
|
74
|
+
const experienceToVariantsStr = `${experience.uid}-${variantShortId}-${variants[variantShortId]}`;
|
|
75
|
+
experienceToVariantsStrList.push(experienceToVariantsStr);
|
|
76
|
+
});
|
|
77
|
+
try {
|
|
78
|
+
// fetch content of experience
|
|
79
|
+
const { variant_groups: [variantGroup] = [] } = (yield this.getVariantGroup({ experienceUid: experience.uid })) || {};
|
|
80
|
+
if ((_c = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.content_types) === null || _c === void 0 ? void 0 : _c.length) {
|
|
81
|
+
experienceToContentTypesMap[experience.uid] = variantGroup.content_types;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
(0, utils_1.log)(this.exportConfig, `Failed to fetch content types of experience ${experience.name}`, 'error');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
utils_1.fsUtil.writeFile(path.resolve((0, cli_utilities_1.sanitizePath)(this.experiencesFolderPath), 'experiences-variants-ids.json'), experienceToVariantsStrList);
|
|
89
|
+
utils_1.fsUtil.writeFile(path.resolve((0, cli_utilities_1.sanitizePath)(this.experiencesFolderPath), 'experiences-content-types.json'), experienceToContentTypesMap);
|
|
90
|
+
(0, utils_1.log)(this.exportConfig, 'All the experiences have been exported successfully!', 'success');
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export experiences!`, 'error');
|
|
94
|
+
(0, utils_1.log)(this.config, error, 'error');
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.default = ExportExperiences;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as ExportProjects } from './projects';
|
|
2
|
+
export { default as ExportExperiences } from './experiences';
|
|
3
|
+
import VariantEntries from './variant-entries';
|
|
4
|
+
export { default as ExportEvents } from './events';
|
|
5
|
+
export { default as ExportAudiences } from './audiences';
|
|
6
|
+
export { default as ExportAttributes } from './attributes';
|
|
7
|
+
export declare const Export: {
|
|
8
|
+
VariantEntries: typeof VariantEntries;
|
|
9
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Export = exports.ExportAttributes = exports.ExportAudiences = exports.ExportEvents = exports.ExportExperiences = exports.ExportProjects = void 0;
|
|
7
|
+
var projects_1 = require("./projects");
|
|
8
|
+
Object.defineProperty(exports, "ExportProjects", { enumerable: true, get: function () { return __importDefault(projects_1).default; } });
|
|
9
|
+
var experiences_1 = require("./experiences");
|
|
10
|
+
Object.defineProperty(exports, "ExportExperiences", { enumerable: true, get: function () { return __importDefault(experiences_1).default; } });
|
|
11
|
+
const variant_entries_1 = __importDefault(require("./variant-entries"));
|
|
12
|
+
var events_1 = require("./events");
|
|
13
|
+
Object.defineProperty(exports, "ExportEvents", { enumerable: true, get: function () { return __importDefault(events_1).default; } });
|
|
14
|
+
var audiences_1 = require("./audiences");
|
|
15
|
+
Object.defineProperty(exports, "ExportAudiences", { enumerable: true, get: function () { return __importDefault(audiences_1).default; } });
|
|
16
|
+
var attributes_1 = require("./attributes");
|
|
17
|
+
Object.defineProperty(exports, "ExportAttributes", { enumerable: true, get: function () { return __importDefault(attributes_1).default; } });
|
|
18
|
+
// NOTE Acting as namespace to avoid the same class name conflicts in other modules
|
|
19
|
+
exports.Export = {
|
|
20
|
+
VariantEntries: variant_entries_1.default,
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExportConfig, PersonalizationConfig } from '../types';
|
|
2
|
+
import { PersonalizationAdapter } from '../utils';
|
|
3
|
+
export default class ExportProjects extends PersonalizationAdapter<ExportConfig> {
|
|
4
|
+
private projectFolderPath;
|
|
5
|
+
exportConfig: ExportConfig;
|
|
6
|
+
personalizationConfig: PersonalizationConfig;
|
|
7
|
+
constructor(exportConfig: ExportConfig);
|
|
8
|
+
start(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const path = __importStar(require("path"));
|
|
36
|
+
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
37
|
+
const utils_1 = require("../utils");
|
|
38
|
+
class ExportProjects extends utils_1.PersonalizationAdapter {
|
|
39
|
+
constructor(exportConfig) {
|
|
40
|
+
super({
|
|
41
|
+
config: exportConfig,
|
|
42
|
+
baseURL: exportConfig.modules.personalization.baseURL[exportConfig.region.name],
|
|
43
|
+
headers: { authtoken: exportConfig.auth_token, organization_uid: exportConfig.org_uid },
|
|
44
|
+
});
|
|
45
|
+
this.exportConfig = exportConfig;
|
|
46
|
+
this.personalizationConfig = exportConfig.modules.personalization;
|
|
47
|
+
this.projectFolderPath = path.resolve((0, cli_utilities_1.sanitizePath)(exportConfig.data), (0, cli_utilities_1.sanitizePath)(exportConfig.branchName || ''), (0, cli_utilities_1.sanitizePath)(this.personalizationConfig.dirName), 'projects');
|
|
48
|
+
}
|
|
49
|
+
start() {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
var _a;
|
|
52
|
+
try {
|
|
53
|
+
(0, utils_1.log)(this.exportConfig, 'Starting projects export', 'info');
|
|
54
|
+
yield utils_1.fsUtil.makeDirectory(this.projectFolderPath);
|
|
55
|
+
const project = yield this.projects({ connectedStackApiKey: this.exportConfig.apiKey });
|
|
56
|
+
if (!project || (project === null || project === void 0 ? void 0 : project.length) < 1) {
|
|
57
|
+
(0, utils_1.log)(this.exportConfig, 'No Personalization Project connected with the given stack', 'info');
|
|
58
|
+
this.exportConfig.personalizationEnabled = false;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.exportConfig.personalizationEnabled = true;
|
|
62
|
+
this.exportConfig.project_id = (_a = project[0]) === null || _a === void 0 ? void 0 : _a.uid;
|
|
63
|
+
utils_1.fsUtil.writeFile(path.resolve((0, cli_utilities_1.sanitizePath)(this.projectFolderPath), 'projects.json'), project);
|
|
64
|
+
(0, utils_1.log)(this.exportConfig, 'Project exported successfully!', 'success');
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export projects!`, 'error');
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.default = ExportProjects;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExportConfig } from '../types';
|
|
2
|
+
import VariantAdapter, { VariantHttpClient } from '../utils/variant-api-adapter';
|
|
3
|
+
export default class VariantEntries extends VariantAdapter<VariantHttpClient<ExportConfig>> {
|
|
4
|
+
readonly config: ExportConfig;
|
|
5
|
+
entriesDirPath: string;
|
|
6
|
+
variantEntryBasePath: string;
|
|
7
|
+
constructor(config: ExportConfig);
|
|
8
|
+
/**
|
|
9
|
+
* This function exports variant entries for a specific content type and locale.
|
|
10
|
+
* @param options - The `exportVariantEntry` function takes in an `options` object with the following
|
|
11
|
+
* properties:
|
|
12
|
+
*/
|
|
13
|
+
exportVariantEntry(options: {
|
|
14
|
+
locale: string;
|
|
15
|
+
contentTypeUid: string;
|
|
16
|
+
entries: Record<string, any>[];
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const fs_1 = require("fs");
|
|
36
|
+
const path_1 = require("path");
|
|
37
|
+
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
38
|
+
const variant_api_adapter_1 = __importStar(require("../utils/variant-api-adapter"));
|
|
39
|
+
const utils_1 = require("../utils");
|
|
40
|
+
class VariantEntries extends variant_api_adapter_1.default {
|
|
41
|
+
constructor(config) {
|
|
42
|
+
const conf = {
|
|
43
|
+
config,
|
|
44
|
+
httpClient: true,
|
|
45
|
+
baseURL: config.host,
|
|
46
|
+
Adapter: (variant_api_adapter_1.VariantHttpClient),
|
|
47
|
+
headers: {
|
|
48
|
+
api_key: config.apiKey,
|
|
49
|
+
branch: config.branchName,
|
|
50
|
+
authtoken: config.auth_token,
|
|
51
|
+
organization_uid: config.org_uid,
|
|
52
|
+
'X-Project-Uid': config.project_id,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
super(Object.assign(config, conf));
|
|
56
|
+
this.config = config;
|
|
57
|
+
this.entriesDirPath = (0, path_1.resolve)((0, cli_utilities_1.sanitizePath)(config.data), (0, cli_utilities_1.sanitizePath)(config.branchName || ''), (0, cli_utilities_1.sanitizePath)(config.modules.entries.dirName));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* This function exports variant entries for a specific content type and locale.
|
|
61
|
+
* @param options - The `exportVariantEntry` function takes in an `options` object with the following
|
|
62
|
+
* properties:
|
|
63
|
+
*/
|
|
64
|
+
exportVariantEntry(options) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const variantEntry = this.config.modules.variantEntry;
|
|
67
|
+
const { entries, locale, contentTypeUid: content_type_uid } = options;
|
|
68
|
+
for (let index = 0; index < entries.length; index++) {
|
|
69
|
+
const entry = entries[index];
|
|
70
|
+
const variantEntryBasePath = (0, path_1.join)((0, cli_utilities_1.sanitizePath)(this.entriesDirPath), (0, cli_utilities_1.sanitizePath)(content_type_uid), (0, cli_utilities_1.sanitizePath)(locale), (0, cli_utilities_1.sanitizePath)(variantEntry.dirName), (0, cli_utilities_1.sanitizePath)(entry.uid));
|
|
71
|
+
const variantEntriesFs = new cli_utilities_1.FsUtility({
|
|
72
|
+
isArray: true,
|
|
73
|
+
keepMetadata: false,
|
|
74
|
+
moduleName: 'variant-entry',
|
|
75
|
+
basePath: variantEntryBasePath,
|
|
76
|
+
indexFileName: variantEntry.fileName,
|
|
77
|
+
chunkFileSize: variantEntry.chunkFileSize || 1,
|
|
78
|
+
createDirIfNotExist: false,
|
|
79
|
+
});
|
|
80
|
+
const callback = (variantEntries) => {
|
|
81
|
+
if (variantEntries === null || variantEntries === void 0 ? void 0 : variantEntries.length) {
|
|
82
|
+
if (!(0, fs_1.existsSync)(variantEntryBasePath)) {
|
|
83
|
+
(0, fs_1.mkdirSync)(variantEntryBasePath, { recursive: true });
|
|
84
|
+
}
|
|
85
|
+
variantEntriesFs.writeIntoFile(variantEntries);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
try {
|
|
89
|
+
yield this.variantInstance.variantEntries({
|
|
90
|
+
callback,
|
|
91
|
+
getAllData: true,
|
|
92
|
+
content_type_uid,
|
|
93
|
+
entry_uid: entry.uid,
|
|
94
|
+
locale,
|
|
95
|
+
});
|
|
96
|
+
if ((0, fs_1.existsSync)(variantEntryBasePath)) {
|
|
97
|
+
variantEntriesFs.completeFile(true);
|
|
98
|
+
(0, utils_1.log)(this.config, `Exported variant entries of type '${entry.title} (${entry.uid})' locale '${locale}'`, 'info');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
(0, utils_1.log)(this.config, `Error exporting variant entries of type '${entry.title} (${entry.uid})' locale '${locale}'`, 'error');
|
|
103
|
+
(0, utils_1.log)(this.config, error, 'error');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.default = VariantEntries;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PersonalizationAdapter } from '../utils';
|
|
2
|
+
import { ImportConfig, LogType } from '../types';
|
|
3
|
+
export default class Attribute extends PersonalizationAdapter<ImportConfig> {
|
|
4
|
+
readonly config: ImportConfig;
|
|
5
|
+
private readonly log;
|
|
6
|
+
private mapperDirPath;
|
|
7
|
+
private attrMapperDirPath;
|
|
8
|
+
private attributesUidMapperPath;
|
|
9
|
+
private attributesUidMapper;
|
|
10
|
+
private personalizationConfig;
|
|
11
|
+
private attributeConfig;
|
|
12
|
+
constructor(config: ImportConfig, log?: LogType);
|
|
13
|
+
/**
|
|
14
|
+
* The function asynchronously imports attributes from a JSON file and creates them in the system.
|
|
15
|
+
*/
|
|
16
|
+
import(): Promise<void>;
|
|
17
|
+
}
|