@commercetools-frontend-extensions/operations 0.0.0
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/CHANGELOG.md +55 -0
- package/README.md +169 -0
- package/babel.config.js +6 -0
- package/dist/commercetools-frontend-extensions-operations.cjs.d.ts +2 -0
- package/dist/commercetools-frontend-extensions-operations.cjs.dev.js +2469 -0
- package/dist/commercetools-frontend-extensions-operations.cjs.js +7 -0
- package/dist/commercetools-frontend-extensions-operations.cjs.prod.js +2461 -0
- package/dist/commercetools-frontend-extensions-operations.esm.js +2316 -0
- package/dist/declarations/src/@api/export-operations.d.ts +5 -0
- package/dist/declarations/src/@api/fetcher.d.ts +17 -0
- package/dist/declarations/src/@api/file-upload.d.ts +3 -0
- package/dist/declarations/src/@api/import-containers.d.ts +35 -0
- package/dist/declarations/src/@api/import-operations.d.ts +6 -0
- package/dist/declarations/src/@api/index.d.ts +8 -0
- package/dist/declarations/src/@api/process-file.d.ts +3 -0
- package/dist/declarations/src/@api/test-fixtures.d.ts +272 -0
- package/dist/declarations/src/@api/urls.d.ts +44 -0
- package/dist/declarations/src/@components/file-drop-area/active-drag-drop-area.d.ts +10 -0
- package/dist/declarations/src/@components/file-drop-area/disabled-drop-area.d.ts +5 -0
- package/dist/declarations/src/@components/file-drop-area/drop-area-wrapper.d.ts +11 -0
- package/dist/declarations/src/@components/file-drop-area/enabled-drop-area.d.ts +7 -0
- package/dist/declarations/src/@components/file-drop-area/file-drop-area.d.ts +14 -0
- package/dist/declarations/src/@components/file-drop-area/file-dropped-area.d.ts +6 -0
- package/dist/declarations/src/@components/file-drop-area/index.d.ts +7 -0
- package/dist/declarations/src/@components/file-drop-area/styles.d.ts +9 -0
- package/dist/declarations/src/@components/icons/file-icon.d.ts +2 -0
- package/dist/declarations/src/@components/icons/index.d.ts +2 -0
- package/dist/declarations/src/@components/icons/lock-icon.d.ts +2 -0
- package/dist/declarations/src/@components/index.d.ts +6 -0
- package/dist/declarations/src/@components/info-box/index.d.ts +1 -0
- package/dist/declarations/src/@components/info-box/info-box.d.ts +7 -0
- package/dist/declarations/src/@components/upload-separator/index.d.ts +1 -0
- package/dist/declarations/src/@components/upload-separator/upload-separator.d.ts +12 -0
- package/dist/declarations/src/@components/upload-settings/index.d.ts +1 -0
- package/dist/declarations/src/@components/upload-settings/upload-settings.d.ts +11 -0
- package/dist/declarations/src/@components/uploading-modal/index.d.ts +1 -0
- package/dist/declarations/src/@components/uploading-modal/uploading-modal.d.ts +12 -0
- package/dist/declarations/src/@constants/delimiters.d.ts +8 -0
- package/dist/declarations/src/@constants/import-tags.d.ts +7 -0
- package/dist/declarations/src/@constants/index.d.ts +4 -0
- package/dist/declarations/src/@constants/resource-links.d.ts +10 -0
- package/dist/declarations/src/@constants/upload-limits.d.ts +10 -0
- package/dist/declarations/src/@errors/http-error.d.ts +6 -0
- package/dist/declarations/src/@errors/index.d.ts +8 -0
- package/dist/declarations/src/@errors/invalid-response-error.d.ts +3 -0
- package/dist/declarations/src/@errors/no-resources-to-export-error.d.ts +3 -0
- package/dist/declarations/src/@errors/project-key-not-available-error.d.ts +3 -0
- package/dist/declarations/src/@errors/query-predicate-error.d.ts +4 -0
- package/dist/declarations/src/@errors/unexpected-column-error.d.ts +3 -0
- package/dist/declarations/src/@errors/unexpected-operation-state-error.d.ts +4 -0
- package/dist/declarations/src/@errors/unexpected-resource-type-error.d.ts +3 -0
- package/dist/declarations/src/@hooks/index.d.ts +5 -0
- package/dist/declarations/src/@hooks/use-fetch-export-operations.d.ts +15 -0
- package/dist/declarations/src/@hooks/use-fetch-import-container-details.d.ts +15 -0
- package/dist/declarations/src/@hooks/use-fetch-import-operations.d.ts +16 -0
- package/dist/declarations/src/@hooks/use-fetch-import-summaries.d.ts +20 -0
- package/dist/declarations/src/@hooks/use-import-container-upload.d.ts +18 -0
- package/dist/declarations/src/@types/api.d.ts +13 -0
- package/dist/declarations/src/@types/basic-error-data-type.d.ts +5 -0
- package/dist/declarations/src/@types/export-operation.d.ts +95 -0
- package/dist/declarations/src/@types/file-upload.d.ts +63 -0
- package/dist/declarations/src/@types/import-container.d.ts +53 -0
- package/dist/declarations/src/@types/import-operation.d.ts +13 -0
- package/dist/declarations/src/@types/import-states.d.ts +9 -0
- package/dist/declarations/src/@types/import-summary.d.ts +15 -0
- package/dist/declarations/src/@types/index.d.ts +9 -0
- package/dist/declarations/src/@types/shared.d.ts +7 -0
- package/dist/declarations/src/@utils/error-mapping.d.ts +19 -0
- package/dist/declarations/src/@utils/file-upload.d.ts +46 -0
- package/dist/declarations/src/@utils/form.d.ts +1 -0
- package/dist/declarations/src/@utils/format.d.ts +5 -0
- package/dist/declarations/src/@utils/import-container.d.ts +8 -0
- package/dist/declarations/src/@utils/index.d.ts +6 -0
- package/dist/declarations/src/@utils/url.d.ts +6 -0
- package/dist/declarations/src/index.d.ts +26 -0
- package/index.js +1 -0
- package/jest.test.config.js +11 -0
- package/package.json +63 -0
- package/src/@api/export-operations.ts +26 -0
- package/src/@api/fetcher.spec.ts +51 -0
- package/src/@api/fetcher.ts +127 -0
- package/src/@api/file-upload.spec.ts +83 -0
- package/src/@api/file-upload.ts +46 -0
- package/src/@api/import-containers.ts +256 -0
- package/src/@api/import-operations.ts +33 -0
- package/src/@api/index.ts +8 -0
- package/src/@api/process-file.spec.ts +74 -0
- package/src/@api/process-file.ts +53 -0
- package/src/@api/test-fixtures.ts +772 -0
- package/src/@api/urls.ts +118 -0
- package/src/@components/file-drop-area/active-drag-drop-area.tsx +33 -0
- package/src/@components/file-drop-area/disabled-drop-area.tsx +17 -0
- package/src/@components/file-drop-area/drop-area-wrapper.tsx +38 -0
- package/src/@components/file-drop-area/enabled-drop-area.tsx +27 -0
- package/src/@components/file-drop-area/file-drop-area.tsx +74 -0
- package/src/@components/file-drop-area/file-dropped-area.tsx +29 -0
- package/src/@components/file-drop-area/index.ts +7 -0
- package/src/@components/file-drop-area/styles.ts +67 -0
- package/src/@components/icons/file-icon.tsx +30 -0
- package/src/@components/icons/index.ts +2 -0
- package/src/@components/icons/lock-icon.tsx +34 -0
- package/src/@components/index.ts +6 -0
- package/src/@components/info-box/index.ts +1 -0
- package/src/@components/info-box/info-box.tsx +23 -0
- package/src/@components/upload-separator/index.ts +1 -0
- package/src/@components/upload-separator/upload-separator.tsx +61 -0
- package/src/@components/upload-settings/index.ts +1 -0
- package/src/@components/upload-settings/upload-settings.tsx +36 -0
- package/src/@components/uploading-modal/index.ts +1 -0
- package/src/@components/uploading-modal/uploading-modal.tsx +64 -0
- package/src/@constants/delimiters.ts +14 -0
- package/src/@constants/import-tags.ts +9 -0
- package/src/@constants/index.ts +4 -0
- package/src/@constants/resource-links.ts +61 -0
- package/src/@constants/upload-limits.ts +11 -0
- package/src/@errors/http-error.ts +17 -0
- package/src/@errors/index.ts +8 -0
- package/src/@errors/invalid-response-error.ts +6 -0
- package/src/@errors/no-resources-to-export-error.ts +6 -0
- package/src/@errors/project-key-not-available-error.ts +6 -0
- package/src/@errors/query-predicate-error.ts +10 -0
- package/src/@errors/unexpected-column-error.ts +6 -0
- package/src/@errors/unexpected-operation-state-error.ts +8 -0
- package/src/@errors/unexpected-resource-type-error.ts +6 -0
- package/src/@hooks/index.ts +5 -0
- package/src/@hooks/messages.ts +11 -0
- package/src/@hooks/use-fetch-export-operations.ts +34 -0
- package/src/@hooks/use-fetch-import-container-details.ts +31 -0
- package/src/@hooks/use-fetch-import-operations.ts +42 -0
- package/src/@hooks/use-fetch-import-summaries.ts +47 -0
- package/src/@hooks/use-fetch.spec.ts +76 -0
- package/src/@hooks/use-fetch.ts +80 -0
- package/src/@hooks/use-import-container-upload.spec.ts +294 -0
- package/src/@hooks/use-import-container-upload.ts +126 -0
- package/src/@types/api.ts +14 -0
- package/src/@types/basic-error-data-type.ts +5 -0
- package/src/@types/export-operation.ts +144 -0
- package/src/@types/file-upload.ts +81 -0
- package/src/@types/import-container.ts +104 -0
- package/src/@types/import-operation.ts +31 -0
- package/src/@types/import-states.ts +9 -0
- package/src/@types/import-summary.ts +22 -0
- package/src/@types/index.ts +9 -0
- package/src/@types/shared.ts +52 -0
- package/src/@utils/error-mapping.spec.ts +126 -0
- package/src/@utils/error-mapping.ts +39 -0
- package/src/@utils/file-upload.spec.ts +151 -0
- package/src/@utils/file-upload.ts +150 -0
- package/src/@utils/form.ts +20 -0
- package/src/@utils/format.spec.ts +62 -0
- package/src/@utils/format.ts +53 -0
- package/src/@utils/import-container.spec.ts +26 -0
- package/src/@utils/import-container.ts +34 -0
- package/src/@utils/index.ts +6 -0
- package/src/@utils/url.spec.ts +75 -0
- package/src/@utils/url.ts +18 -0
- package/src/index.ts +27 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type PaginatedExportOperationResponse, type ExportOperationQueryParams } from "../@types/index.js";
|
|
2
|
+
export declare function fetchExportOperations({ projectKey, queryParams, }: {
|
|
3
|
+
projectKey: string;
|
|
4
|
+
queryParams: ExportOperationQueryParams;
|
|
5
|
+
}): Promise<PaginatedExportOperationResponse>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Fetcher } from "../@types/index.js";
|
|
2
|
+
export declare const fetcher: <Data>({ url, payload, config }: Fetcher) => Promise<any>;
|
|
3
|
+
export declare const fetchUsingXhr: ({ url, payload, config, onProgress, onSuccess, onError, }: {
|
|
4
|
+
url: string;
|
|
5
|
+
payload: FormData;
|
|
6
|
+
config: {
|
|
7
|
+
abortSignal?: AbortSignal | undefined;
|
|
8
|
+
proxy?: string | undefined;
|
|
9
|
+
method: string;
|
|
10
|
+
headers?: {
|
|
11
|
+
[key: string]: string | null;
|
|
12
|
+
} | undefined;
|
|
13
|
+
};
|
|
14
|
+
onProgress: (progress: number) => void;
|
|
15
|
+
onSuccess: (data: any) => void;
|
|
16
|
+
onError: (error: Error) => void;
|
|
17
|
+
}) => XMLHttpRequest;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type FileUploadResponse, type FileUploadRequestParameters } from "../@types/index.js";
|
|
2
|
+
export declare function uploadFileForImport({ projectKey, importContainerKey, resourceType, file, abortSignal, onSuccess, onProgress, onError, }: FileUploadRequestParameters): XMLHttpRequest;
|
|
3
|
+
export declare function assertFileUploadResponse(maybeFileUploadResponse: unknown): asserts maybeFileUploadResponse is FileUploadResponse;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ImportContainer, ImportContainerPagedResponse } from '@commercetools/importapi-sdk';
|
|
2
|
+
import { ImportStates, type ImportContainerQueryParams, type CancelContainerResponse, type ImportSummary, type ExtendedImportContainerDraft, type ImportContainerDetails, type ImportSummaries } from "../@types/index.js";
|
|
3
|
+
export declare function getImportState(importSummary: ImportSummary): ImportStates;
|
|
4
|
+
export declare function createImportContainerForFileUpload({ importContainerDraft, projectKey, }: {
|
|
5
|
+
importContainerDraft: ExtendedImportContainerDraft;
|
|
6
|
+
projectKey: string;
|
|
7
|
+
}): Promise<unknown>;
|
|
8
|
+
export declare function deleteImportContainer({ projectKey, importContainerKey, }: {
|
|
9
|
+
projectKey: string;
|
|
10
|
+
importContainerKey: string;
|
|
11
|
+
}): Promise<unknown>;
|
|
12
|
+
export declare function fetchImportSummary({ projectKey, importContainerKey, }: {
|
|
13
|
+
projectKey: string;
|
|
14
|
+
importContainerKey: string;
|
|
15
|
+
}): Promise<ImportSummary>;
|
|
16
|
+
export declare function fetchImportContainers({ projectKey, queryParams, }: {
|
|
17
|
+
projectKey: string;
|
|
18
|
+
queryParams: ImportContainerQueryParams;
|
|
19
|
+
}): Promise<ImportContainerPagedResponse>;
|
|
20
|
+
export declare function fetchImportSummaries({ projectKey, queryParams, }: {
|
|
21
|
+
projectKey: string;
|
|
22
|
+
queryParams: ImportContainerQueryParams;
|
|
23
|
+
}): Promise<ImportSummaries>;
|
|
24
|
+
export declare function fetchImportContainerDetails({ projectKey, importContainerKey, }: {
|
|
25
|
+
projectKey: string;
|
|
26
|
+
importContainerKey: string;
|
|
27
|
+
}): Promise<ImportContainerDetails>;
|
|
28
|
+
export declare function fetchImportContainerByKey({ projectKey, importContainerKey, }: {
|
|
29
|
+
projectKey: string;
|
|
30
|
+
importContainerKey: string;
|
|
31
|
+
}): Promise<ImportContainer>;
|
|
32
|
+
export declare function cancelImportContainerByKey({ projectKey, importContainerKey, }: {
|
|
33
|
+
projectKey: string;
|
|
34
|
+
importContainerKey: string;
|
|
35
|
+
}): Promise<CancelContainerResponse>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ExtendedImportOperationPagedResponse, type ImportOperationQueryParams } from "../@types/index.js";
|
|
2
|
+
export declare function fetchImportOperations({ projectKey, importContainerKey, queryParams, }: {
|
|
3
|
+
projectKey: string;
|
|
4
|
+
importContainerKey: string;
|
|
5
|
+
queryParams: ImportOperationQueryParams;
|
|
6
|
+
}): Promise<ExtendedImportOperationPagedResponse>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./fetcher.js";
|
|
2
|
+
export * from "./file-upload.js";
|
|
3
|
+
export * from "./import-containers.js";
|
|
4
|
+
export * from "./import-operations.js";
|
|
5
|
+
export * from "./export-operations.js";
|
|
6
|
+
export * from "./process-file.js";
|
|
7
|
+
export * from "./urls.js";
|
|
8
|
+
export * from "./test-fixtures.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ProcessUploadedFileRequestParameters, ProcessFileResponse } from "../@types/index.js";
|
|
2
|
+
export declare function processUploadedFile({ projectKey, importContainerKey, resourceType, action, }: ProcessUploadedFileRequestParameters): Promise<ProcessFileResponse>;
|
|
3
|
+
export declare function assertProcessFileResponse(maybeProcessFileResponse: unknown): asserts maybeProcessFileResponse is ProcessFileResponse;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { type ProcessFileResponse, type ExportOperation, ImportStates, type ImportSummary, FileUploadResponse } from "../@types/index.js";
|
|
2
|
+
export declare const automatedImportContainerKey = "automated-container-key";
|
|
3
|
+
export declare const fileUploadImportContainerKey = "eyJ0aW1lc3RhbXAiOiAxNzA1MDc0MzIxODY4LCAiZmlsZU5hbWUiOiAiZmlsZS11cGxvYWQtY29udGFpbmVyLWtleS5jc3YifQ";
|
|
4
|
+
export declare const manualImports: {
|
|
5
|
+
key: string;
|
|
6
|
+
version: number;
|
|
7
|
+
resourceType: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
lastModifiedAt: string;
|
|
10
|
+
tags: string[];
|
|
11
|
+
}[];
|
|
12
|
+
export declare const automatedImports: {
|
|
13
|
+
key: string;
|
|
14
|
+
version: number;
|
|
15
|
+
resourceType: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
lastModifiedAt: string;
|
|
18
|
+
tags: never[];
|
|
19
|
+
}[];
|
|
20
|
+
export declare const importContainers: {
|
|
21
|
+
count: number;
|
|
22
|
+
total: number;
|
|
23
|
+
results: {
|
|
24
|
+
key: string;
|
|
25
|
+
version: number;
|
|
26
|
+
resourceType: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
lastModifiedAt: string;
|
|
29
|
+
tags: string[];
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
export declare const importsSummaries: {
|
|
33
|
+
eyJ0aW1lc3RhbXAiOjE2MjE0MTM0NzU4MzcsImZpbGVOYW1lIjoiX3ZhbGlkLXByb2R1Y3QuY3N2IiwiaW1wb3J0VHlwZSI6Im1hbnVhbCJ9: {
|
|
34
|
+
states: {
|
|
35
|
+
validationFailed: number;
|
|
36
|
+
unresolved: number;
|
|
37
|
+
waitForMasterVariant: number;
|
|
38
|
+
imported: number;
|
|
39
|
+
rejected: number;
|
|
40
|
+
};
|
|
41
|
+
total: number;
|
|
42
|
+
};
|
|
43
|
+
eyJ0aW1lc3RhbXAiOjE2MjE0MTM3Mjc0ODksImZpbGVOYW1lIjoiX3ZhbGlkLWNhdGVnb3J5LmNzdiIsImltcG9ydFR5cGUiOiJtYW51YWwifQ: {
|
|
44
|
+
states: {
|
|
45
|
+
validationFailed: number;
|
|
46
|
+
unresolved: number;
|
|
47
|
+
waitForMasterVariant: number;
|
|
48
|
+
imported: number;
|
|
49
|
+
rejected: number;
|
|
50
|
+
};
|
|
51
|
+
total: number;
|
|
52
|
+
};
|
|
53
|
+
'product-import-container': {
|
|
54
|
+
states: {
|
|
55
|
+
validationFailed: number;
|
|
56
|
+
unresolved: number;
|
|
57
|
+
waitForMasterVariant: number;
|
|
58
|
+
imported: number;
|
|
59
|
+
rejected: number;
|
|
60
|
+
};
|
|
61
|
+
total: number;
|
|
62
|
+
};
|
|
63
|
+
'product-import-container-1': {
|
|
64
|
+
states: {
|
|
65
|
+
validationFailed: number;
|
|
66
|
+
unresolved: number;
|
|
67
|
+
waitForMasterVariant: number;
|
|
68
|
+
imported: number;
|
|
69
|
+
rejected: number;
|
|
70
|
+
};
|
|
71
|
+
total: number;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export declare const importStatesMap: Record<ImportStates, Array<ImportSummary>>;
|
|
75
|
+
export declare const validFileUploadResponse: FileUploadResponse;
|
|
76
|
+
export declare const invalidFileUploadResponse: FileUploadResponse;
|
|
77
|
+
export declare const allAutomatedImportOperations: ({
|
|
78
|
+
version: number;
|
|
79
|
+
importContainerKey: string;
|
|
80
|
+
resourceKey: string;
|
|
81
|
+
id: string;
|
|
82
|
+
state: string;
|
|
83
|
+
errors: {
|
|
84
|
+
code: string;
|
|
85
|
+
message: string;
|
|
86
|
+
}[];
|
|
87
|
+
createdAt: string;
|
|
88
|
+
lastModifiedAt: string;
|
|
89
|
+
expiresAt: string;
|
|
90
|
+
resourceVersion?: undefined;
|
|
91
|
+
} | {
|
|
92
|
+
version: number;
|
|
93
|
+
importContainerKey: string;
|
|
94
|
+
resourceKey: string;
|
|
95
|
+
id: string;
|
|
96
|
+
state: string;
|
|
97
|
+
resourceVersion: number;
|
|
98
|
+
errors: never[];
|
|
99
|
+
createdAt: string;
|
|
100
|
+
lastModifiedAt: string;
|
|
101
|
+
expiresAt: string;
|
|
102
|
+
})[];
|
|
103
|
+
export declare const successfulFileUploadImportOperations: {
|
|
104
|
+
version: number;
|
|
105
|
+
importContainerKey: string;
|
|
106
|
+
resourceKey: string;
|
|
107
|
+
id: string;
|
|
108
|
+
state: string;
|
|
109
|
+
resourceVersion: number;
|
|
110
|
+
errors: never[];
|
|
111
|
+
createdAt: string;
|
|
112
|
+
lastModifiedAt: string;
|
|
113
|
+
expiresAt: string;
|
|
114
|
+
tags: string[];
|
|
115
|
+
}[];
|
|
116
|
+
export declare const allFileUploadImportOperations: ({
|
|
117
|
+
version: number;
|
|
118
|
+
importContainerKey: string;
|
|
119
|
+
resourceKey: string;
|
|
120
|
+
id: string;
|
|
121
|
+
state: string;
|
|
122
|
+
errors: {
|
|
123
|
+
code: string;
|
|
124
|
+
message: string;
|
|
125
|
+
}[];
|
|
126
|
+
createdAt: string;
|
|
127
|
+
lastModifiedAt: string;
|
|
128
|
+
expiresAt: string;
|
|
129
|
+
tags: string[];
|
|
130
|
+
resourceVersion?: undefined;
|
|
131
|
+
} | {
|
|
132
|
+
version: number;
|
|
133
|
+
importContainerKey: string;
|
|
134
|
+
resourceKey: string;
|
|
135
|
+
id: string;
|
|
136
|
+
state: string;
|
|
137
|
+
resourceVersion: number;
|
|
138
|
+
errors: never[];
|
|
139
|
+
createdAt: string;
|
|
140
|
+
lastModifiedAt: string;
|
|
141
|
+
expiresAt: string;
|
|
142
|
+
tags: string[];
|
|
143
|
+
})[];
|
|
144
|
+
export declare const allFileUploadImportOperationsResponse: {
|
|
145
|
+
limit: number;
|
|
146
|
+
offset: number;
|
|
147
|
+
count: number;
|
|
148
|
+
total: number;
|
|
149
|
+
results: ({
|
|
150
|
+
version: number;
|
|
151
|
+
importContainerKey: string;
|
|
152
|
+
resourceKey: string;
|
|
153
|
+
id: string;
|
|
154
|
+
state: string;
|
|
155
|
+
errors: {
|
|
156
|
+
code: string;
|
|
157
|
+
message: string;
|
|
158
|
+
}[];
|
|
159
|
+
createdAt: string;
|
|
160
|
+
lastModifiedAt: string;
|
|
161
|
+
expiresAt: string;
|
|
162
|
+
tags: string[];
|
|
163
|
+
resourceVersion?: undefined;
|
|
164
|
+
} | {
|
|
165
|
+
version: number;
|
|
166
|
+
importContainerKey: string;
|
|
167
|
+
resourceKey: string;
|
|
168
|
+
id: string;
|
|
169
|
+
state: string;
|
|
170
|
+
resourceVersion: number;
|
|
171
|
+
errors: never[];
|
|
172
|
+
createdAt: string;
|
|
173
|
+
lastModifiedAt: string;
|
|
174
|
+
expiresAt: string;
|
|
175
|
+
tags: string[];
|
|
176
|
+
})[];
|
|
177
|
+
};
|
|
178
|
+
export declare const allAutomatedImportOperationsResponse: {
|
|
179
|
+
limit: number;
|
|
180
|
+
offset: number;
|
|
181
|
+
count: number;
|
|
182
|
+
total: number;
|
|
183
|
+
results: ({
|
|
184
|
+
version: number;
|
|
185
|
+
importContainerKey: string;
|
|
186
|
+
resourceKey: string;
|
|
187
|
+
id: string;
|
|
188
|
+
state: string;
|
|
189
|
+
errors: {
|
|
190
|
+
code: string;
|
|
191
|
+
message: string;
|
|
192
|
+
}[];
|
|
193
|
+
createdAt: string;
|
|
194
|
+
lastModifiedAt: string;
|
|
195
|
+
expiresAt: string;
|
|
196
|
+
resourceVersion?: undefined;
|
|
197
|
+
} | {
|
|
198
|
+
version: number;
|
|
199
|
+
importContainerKey: string;
|
|
200
|
+
resourceKey: string;
|
|
201
|
+
id: string;
|
|
202
|
+
state: string;
|
|
203
|
+
resourceVersion: number;
|
|
204
|
+
errors: never[];
|
|
205
|
+
createdAt: string;
|
|
206
|
+
lastModifiedAt: string;
|
|
207
|
+
expiresAt: string;
|
|
208
|
+
})[];
|
|
209
|
+
};
|
|
210
|
+
export declare const successfulAutomatedImportOperations: {
|
|
211
|
+
version: number;
|
|
212
|
+
importContainerKey: string;
|
|
213
|
+
resourceKey: string;
|
|
214
|
+
id: string;
|
|
215
|
+
state: string;
|
|
216
|
+
resourceVersion: number;
|
|
217
|
+
errors: never[];
|
|
218
|
+
createdAt: string;
|
|
219
|
+
lastModifiedAt: string;
|
|
220
|
+
expiresAt: string;
|
|
221
|
+
}[];
|
|
222
|
+
export declare const successfulAutomatedImportOperationsResponse: {
|
|
223
|
+
limit: number;
|
|
224
|
+
offset: number;
|
|
225
|
+
count: number;
|
|
226
|
+
total: number;
|
|
227
|
+
results: {
|
|
228
|
+
version: number;
|
|
229
|
+
importContainerKey: string;
|
|
230
|
+
resourceKey: string;
|
|
231
|
+
id: string;
|
|
232
|
+
state: string;
|
|
233
|
+
resourceVersion: number;
|
|
234
|
+
errors: never[];
|
|
235
|
+
createdAt: string;
|
|
236
|
+
lastModifiedAt: string;
|
|
237
|
+
expiresAt: string;
|
|
238
|
+
}[];
|
|
239
|
+
};
|
|
240
|
+
export declare const successfulFileUploadImportOperationsResponse: {
|
|
241
|
+
limit: number;
|
|
242
|
+
offset: number;
|
|
243
|
+
count: number;
|
|
244
|
+
total: number;
|
|
245
|
+
results: {
|
|
246
|
+
version: number;
|
|
247
|
+
importContainerKey: string;
|
|
248
|
+
resourceKey: string;
|
|
249
|
+
id: string;
|
|
250
|
+
state: string;
|
|
251
|
+
resourceVersion: number;
|
|
252
|
+
errors: never[];
|
|
253
|
+
createdAt: string;
|
|
254
|
+
lastModifiedAt: string;
|
|
255
|
+
expiresAt: string;
|
|
256
|
+
tags: string[];
|
|
257
|
+
}[];
|
|
258
|
+
};
|
|
259
|
+
export declare const fileUploadMissingKeysResponse: {
|
|
260
|
+
code: string;
|
|
261
|
+
message: string;
|
|
262
|
+
rowValue: {
|
|
263
|
+
uri: string;
|
|
264
|
+
key: undefined;
|
|
265
|
+
};
|
|
266
|
+
metadata: {
|
|
267
|
+
row: number;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
export declare const validProcessFileResponse: ProcessFileResponse;
|
|
271
|
+
export declare const exportOperationsCompleted: ExportOperation[];
|
|
272
|
+
export declare const exportOperationsProcessing: ExportOperation[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ResourceTypeId } from '@commercetools/importapi-sdk';
|
|
2
|
+
import type { ImportContainerQueryParams, ExportOperationQueryParams } from "../@types/index.js";
|
|
3
|
+
export declare function getImportContainersURL({ projectKey, queryParams, }: {
|
|
4
|
+
projectKey: string;
|
|
5
|
+
queryParams: ImportContainerQueryParams;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function getImportOperationsURL({ projectKey, importContainerKey, queryParams, }: {
|
|
8
|
+
projectKey: string;
|
|
9
|
+
importContainerKey: string;
|
|
10
|
+
queryParams?: ImportContainerQueryParams;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function getImportContainerByKeyURL({ projectKey, importContainerKey, }: {
|
|
13
|
+
projectKey: string;
|
|
14
|
+
importContainerKey: string;
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function getCreateImportContainerURL({ projectKey, }: {
|
|
17
|
+
projectKey: string;
|
|
18
|
+
}): string;
|
|
19
|
+
export declare function getImportContainerTasksURL({ projectKey, importContainerKey, }: {
|
|
20
|
+
projectKey: string;
|
|
21
|
+
importContainerKey: string;
|
|
22
|
+
}): string;
|
|
23
|
+
export declare function getDeleteImportContainerURL({ projectKey, importContainerKey, }: {
|
|
24
|
+
projectKey: string;
|
|
25
|
+
importContainerKey: string;
|
|
26
|
+
}): string;
|
|
27
|
+
export declare function getImportSummaryURL({ projectKey, importContainerKey, }: {
|
|
28
|
+
projectKey: string;
|
|
29
|
+
importContainerKey: string;
|
|
30
|
+
}): string;
|
|
31
|
+
export declare function getFileUploadURL({ projectKey, resourceType, importContainerKey, }: {
|
|
32
|
+
projectKey: string;
|
|
33
|
+
resourceType: ResourceTypeId;
|
|
34
|
+
importContainerKey: string;
|
|
35
|
+
}): string;
|
|
36
|
+
export declare function getProccessFileURL({ projectKey, resourceType, importContainerKey, }: {
|
|
37
|
+
projectKey: string;
|
|
38
|
+
resourceType: ResourceTypeId;
|
|
39
|
+
importContainerKey: string;
|
|
40
|
+
}): string;
|
|
41
|
+
export declare function getExportOperationsURL({ projectKey, queryParams, }: {
|
|
42
|
+
projectKey: string;
|
|
43
|
+
queryParams: ExportOperationQueryParams;
|
|
44
|
+
}): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ActiveDragDropAreaProps {
|
|
2
|
+
isFileDropped: boolean;
|
|
3
|
+
fileName?: string;
|
|
4
|
+
chooseFileLabel: string;
|
|
5
|
+
dragAndDropText: string;
|
|
6
|
+
orText: string;
|
|
7
|
+
browseFileText: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ActiveDragDropArea: ({ isFileDropped, fileName, chooseFileLabel, dragAndDropText, orText, browseFileText, }: ActiveDragDropAreaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DropzoneRootProps } from 'react-dropzone';
|
|
3
|
+
import type { DropAreaState } from "../../@types/index.js";
|
|
4
|
+
interface DropWrapperProps extends DropzoneRootProps {
|
|
5
|
+
dropAreaState: DropAreaState;
|
|
6
|
+
}
|
|
7
|
+
export declare const DropAreaWrapper: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
9
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
10
|
+
} & DropWrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type EnabledDropAreaProps = {
|
|
2
|
+
dragAndDropText: string;
|
|
3
|
+
orText: string;
|
|
4
|
+
browseFileText: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const EnabledDropArea: ({ dragAndDropText, orText, browseFileText, }: EnabledDropAreaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Accept, DropEvent, FileRejection } from 'react-dropzone';
|
|
3
|
+
import type { DropAreaState } from "../../@types/index.js";
|
|
4
|
+
type OnDrop = <T extends File>(acceptedFiles: T[], fileRejections: FileRejection[], event: DropEvent) => void;
|
|
5
|
+
type FileDropAreaProps = {
|
|
6
|
+
onDrop: OnDrop;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
accept: Accept;
|
|
9
|
+
getDropAreaState: (isDragActive: boolean) => DropAreaState;
|
|
10
|
+
children: (dropAreaState: DropAreaState) => React.ReactNode;
|
|
11
|
+
onDropRejected?: (errorType: 'too-many-files' | 'invalid-type' | 'generic') => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const FileDropArea: ({ onDrop, disabled, accept, getDropAreaState, children, onDropRejected: handleDropRejected, }: FileDropAreaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./active-drag-drop-area.js";
|
|
2
|
+
export * from "./disabled-drop-area.js";
|
|
3
|
+
export * from "./drop-area-wrapper.js";
|
|
4
|
+
export * from "./enabled-drop-area.js";
|
|
5
|
+
export * from "./file-drop-area.js";
|
|
6
|
+
export * from "./file-dropped-area.js";
|
|
7
|
+
export * from "./styles.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const dropAreaStyles: {
|
|
2
|
+
base: import("@emotion/react").SerializedStyles;
|
|
3
|
+
readyForDrop: import("@emotion/react").SerializedStyles;
|
|
4
|
+
fileDropped: import("@emotion/react").SerializedStyles;
|
|
5
|
+
disabled: import("@emotion/react").SerializedStyles;
|
|
6
|
+
activeDrag: import("@emotion/react").SerializedStyles;
|
|
7
|
+
invalid: import("@emotion/react").SerializedStyles;
|
|
8
|
+
parsing: import("@emotion/react").SerializedStyles;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./info-box.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./upload-separator.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DecimalSeparator } from "../../@types/index.js";
|
|
2
|
+
type UploadSeparatorProps = {
|
|
3
|
+
value?: DecimalSeparator;
|
|
4
|
+
onChange: (decimalSeparator: DecimalSeparator) => void;
|
|
5
|
+
separatorTitle: string;
|
|
6
|
+
decimalsSeparatorDescription: string;
|
|
7
|
+
decimalSeparatorPointLabel: string;
|
|
8
|
+
decimalSeparatorCommaLabel: string;
|
|
9
|
+
decimalsLabel: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const UploadSeparator: ({ value, onChange, separatorTitle, decimalsSeparatorDescription, decimalSeparatorPointLabel, decimalSeparatorCommaLabel, decimalsLabel, }: UploadSeparatorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./upload-settings.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResourceTypeId } from '@commercetools/importapi-sdk';
|
|
2
|
+
type UploadSettingsProps = {
|
|
3
|
+
resourceType?: ResourceTypeId;
|
|
4
|
+
isPublishChecked?: boolean;
|
|
5
|
+
onPublishChange: (checked: boolean) => void;
|
|
6
|
+
publishProductsLabel: string;
|
|
7
|
+
dataTrackingTarget: string;
|
|
8
|
+
canPublishProducts?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const UploadSettings: ({ resourceType, isPublishChecked, onPublishChange, publishProductsLabel, dataTrackingTarget, canPublishProducts, }: UploadSettingsProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./uploading-modal.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type UploadingModalProps = {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
fileName: string;
|
|
5
|
+
fileSize: number;
|
|
6
|
+
progress: number;
|
|
7
|
+
cancelLabel: string;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const UploadingModal: ({ isOpen, title, fileName, fileSize, progress, cancelLabel, onCancel, onClose, }: UploadingModalProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResourceTypeId } from '@commercetools/importapi-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* CommerceTools API documentation base URL
|
|
4
|
+
*/
|
|
5
|
+
export declare const CT_API_DOCS_URL = "https://docs.commercetools.com/api/";
|
|
6
|
+
/**
|
|
7
|
+
* Template download links for each resource type
|
|
8
|
+
*/
|
|
9
|
+
export declare const RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS: Record<ResourceTypeId, string>;
|
|
10
|
+
export declare const RESOURCE_TYPE_DOCUMENTATION_LINKS: Record<ResourceTypeId, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maximum file size for imports.
|
|
3
|
+
* Recommended by backend, enforced in frontend validation.
|
|
4
|
+
*/
|
|
5
|
+
export declare const MAX_FILE_SIZE_MB = 35;
|
|
6
|
+
/**
|
|
7
|
+
* Maximum row count for imports.
|
|
8
|
+
* Recommended by backend, enforced in frontend validation.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MAX_ROW_COUNT = 80000;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./unexpected-column-error.js";
|
|
2
|
+
export * from "./unexpected-operation-state-error.js";
|
|
3
|
+
export * from "./unexpected-resource-type-error.js";
|
|
4
|
+
export * from "./http-error.js";
|
|
5
|
+
export * from "./invalid-response-error.js";
|
|
6
|
+
export * from "./query-predicate-error.js";
|
|
7
|
+
export * from "./no-resources-to-export-error.js";
|
|
8
|
+
export * from "./project-key-not-available-error.js";
|