-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathTask03_import_sync_products.ts
40 lines (33 loc) · 1.31 KB
/
Task03_import_sync_products.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import {
checkImportOperationStatusById,
checkImportOperationsStatus,
checkImportSummary,
createImportContainer,
importProductDrafts
} from "./handson/importService";
import { log } from "./utils/logger";
const containerKey = "tt-ImportContainer";
// Create an import container
createImportContainer(containerKey).then(log).catch(log);
// import products
// importProductDrafts(containerKey).then(log).catch(log);
// check import summary for your container
// checkImportSummary(containerKey).then(log).catch(log);
// check import operations for your container
// checkImportOperationsStatus(containerKey).then(operations =>
// operations.body.results.forEach(operation =>
// log(operation.id + " : " + operation.state)
// )
// );
// Check the status of import operations by their Ids
// checkImportOperationStatusById("9eee411c-a698-4e13-b1fd-0996180df437").then(log).catch(log);
// checkImportOperationStatusById("340ec151-ebd3-422a-97a8-e7625e85633a").then(log).catch(log);
// https://github.com/commercetools/commercetools-project-sync#run
// docker run \
// -e SOURCE_PROJECT_KEY=xxx \
// -e SOURCE_CLIENT_ID=xxx \
// -e SOURCE_CLIENT_SECRET=xxx \
// -e TARGET_PROJECT_KEY=xxx \
// -e TARGET_CLIENT_ID=xxx \
// -e TARGET_CLIENT_SECRET=xxx \
// commercetools/commercetools-project-sync:5.0.0 -s all