@contrail/entity-types 1.1.47 → 1.1.51-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.
@@ -0,0 +1,97 @@
1
+ export declare abstract class EntityReference {
2
+ id: string;
3
+ entityType: string;
4
+ reference: string;
5
+ }
6
+ export interface SortOption {
7
+ orderField: string;
8
+ order?: SortOrderOptions;
9
+ }
10
+ export declare enum SortOrderOptions {
11
+ ASC = "asc",
12
+ DESC = "desc"
13
+ }
14
+ export declare enum API_VERSION {
15
+ EMPTY = "",
16
+ V1 = "1",
17
+ V2 = "2"
18
+ }
19
+ export declare const DEFAULT_API_VERSION = API_VERSION.EMPTY;
20
+ export declare abstract class EntitiesClientGetOptions {
21
+ entityName?: string;
22
+ id?: string;
23
+ reference?: string;
24
+ federatedId?: string;
25
+ federatedIds?: string[];
26
+ relation?: string;
27
+ relations?: Array<string>;
28
+ criteria?: {
29
+ [key: string]: any;
30
+ };
31
+ cacheMode?: string;
32
+ search?: string;
33
+ useSearch?: boolean;
34
+ order?: SortOption[];
35
+ skip?: number;
36
+ take?: number;
37
+ paginate?: boolean;
38
+ nextPageKey?: string;
39
+ apiVersion?: API_VERSION;
40
+ suffix?: string;
41
+ }
42
+ export declare abstract class EntitiesClientCreateOptions {
43
+ entityName: string;
44
+ object: any;
45
+ id?: string;
46
+ relation?: string;
47
+ apiVersion?: API_VERSION;
48
+ suffix?: string;
49
+ }
50
+ export declare abstract class EntitiesClientBatchCreateOptions {
51
+ entityName: string;
52
+ objects: any[];
53
+ apiVersion?: API_VERSION;
54
+ suffix?: string;
55
+ }
56
+ declare class EntitiesClientUpdateOptions {
57
+ entityName?: string;
58
+ object: any;
59
+ id?: string;
60
+ reference?: string;
61
+ relation?: string;
62
+ relationId?: string;
63
+ apiVersion?: API_VERSION;
64
+ suffix?: string;
65
+ }
66
+ export declare abstract class EntitiesClientBatchUpdateOptions {
67
+ entityName: string;
68
+ objects: any[];
69
+ apiVersion?: API_VERSION;
70
+ suffix?: string;
71
+ }
72
+ export declare abstract class EntitiesClientDeleteOptions {
73
+ entityName?: string;
74
+ id?: string;
75
+ reference?: string;
76
+ relation?: string;
77
+ relationId?: string;
78
+ apiVersion?: API_VERSION;
79
+ suffix?: string;
80
+ }
81
+ export declare abstract class EntitiesClientBatchDeleteOptions {
82
+ entityName?: string;
83
+ ids?: string[];
84
+ apiVersion?: API_VERSION;
85
+ suffix?: string;
86
+ }
87
+ export declare abstract class Entities {
88
+ abstract getAllReferences(references: Array<EntityReference>, relations: Array<string>): Promise<Map<string, any>>;
89
+ abstract get(options: EntitiesClientGetOptions): Promise<any | any[]>;
90
+ abstract create(options: EntitiesClientCreateOptions): any;
91
+ abstract batchCreate(options: EntitiesClientBatchCreateOptions): any;
92
+ abstract update(options: EntitiesClientUpdateOptions): any;
93
+ abstract batchUpdate(options: EntitiesClientBatchUpdateOptions): any;
94
+ abstract delete(options: EntitiesClientDeleteOptions): any;
95
+ abstract batchDelete(options: EntitiesClientBatchDeleteOptions): any;
96
+ }
97
+ export {};
package/lib/client.js ADDED
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Entities = exports.EntitiesClientBatchDeleteOptions = exports.EntitiesClientDeleteOptions = exports.EntitiesClientBatchUpdateOptions = exports.EntitiesClientBatchCreateOptions = exports.EntitiesClientCreateOptions = exports.EntitiesClientGetOptions = exports.DEFAULT_API_VERSION = exports.API_VERSION = exports.SortOrderOptions = exports.EntityReference = void 0;
4
+ class EntityReference {
5
+ id;
6
+ entityType;
7
+ reference;
8
+ }
9
+ exports.EntityReference = EntityReference;
10
+ var SortOrderOptions;
11
+ (function (SortOrderOptions) {
12
+ SortOrderOptions["ASC"] = "asc";
13
+ SortOrderOptions["DESC"] = "desc";
14
+ })(SortOrderOptions = exports.SortOrderOptions || (exports.SortOrderOptions = {}));
15
+ var API_VERSION;
16
+ (function (API_VERSION) {
17
+ API_VERSION["EMPTY"] = "";
18
+ API_VERSION["V1"] = "1";
19
+ API_VERSION["V2"] = "2";
20
+ })(API_VERSION = exports.API_VERSION || (exports.API_VERSION = {}));
21
+ exports.DEFAULT_API_VERSION = API_VERSION.EMPTY;
22
+ class EntitiesClientGetOptions {
23
+ entityName;
24
+ id;
25
+ reference;
26
+ federatedId;
27
+ federatedIds;
28
+ relation;
29
+ relations;
30
+ criteria;
31
+ cacheMode;
32
+ search;
33
+ useSearch;
34
+ order;
35
+ skip;
36
+ take;
37
+ paginate;
38
+ nextPageKey;
39
+ apiVersion;
40
+ suffix;
41
+ }
42
+ exports.EntitiesClientGetOptions = EntitiesClientGetOptions;
43
+ class EntitiesClientCreateOptions {
44
+ entityName;
45
+ object;
46
+ id;
47
+ relation;
48
+ apiVersion;
49
+ suffix;
50
+ }
51
+ exports.EntitiesClientCreateOptions = EntitiesClientCreateOptions;
52
+ class EntitiesClientBatchCreateOptions {
53
+ entityName;
54
+ objects;
55
+ apiVersion;
56
+ suffix;
57
+ }
58
+ exports.EntitiesClientBatchCreateOptions = EntitiesClientBatchCreateOptions;
59
+ class EntitiesClientUpdateOptions {
60
+ entityName;
61
+ object;
62
+ id;
63
+ reference;
64
+ relation;
65
+ relationId;
66
+ apiVersion;
67
+ suffix;
68
+ }
69
+ class EntitiesClientBatchUpdateOptions {
70
+ entityName;
71
+ objects;
72
+ apiVersion;
73
+ suffix;
74
+ }
75
+ exports.EntitiesClientBatchUpdateOptions = EntitiesClientBatchUpdateOptions;
76
+ class EntitiesClientDeleteOptions {
77
+ entityName;
78
+ id;
79
+ reference;
80
+ relation;
81
+ relationId;
82
+ apiVersion;
83
+ suffix;
84
+ }
85
+ exports.EntitiesClientDeleteOptions = EntitiesClientDeleteOptions;
86
+ class EntitiesClientBatchDeleteOptions {
87
+ entityName;
88
+ ids;
89
+ apiVersion;
90
+ suffix;
91
+ }
92
+ exports.EntitiesClientBatchDeleteOptions = EntitiesClientBatchDeleteOptions;
93
+ class Entities {
94
+ }
95
+ exports.Entities = Entities;
package/lib/index.d.ts CHANGED
@@ -1,24 +1,26 @@
1
- export * from './app-access-grant';
2
- export * from './app-api-key';
3
- export * from './app-code-package';
4
- export * from './app-org';
5
- export * from './app-version';
6
- export * from './app-extension-definition';
7
- export * from './app-extension';
8
- export * from './app';
9
- export * from './asset';
10
- export * from './base-managed-entity';
11
- export * from './content';
12
- export * from './contentholder-content';
13
- export * from './file';
14
- export * from './item';
15
- export * from './org';
16
- export * from './project-item';
17
- export * from './project';
18
- export * from './property-type';
19
- export * from './org-managed-entity';
20
- export * from './subscription';
21
- export * from './shared-links';
22
- export * from './type-managed-entity';
23
- export * from './user';
24
- export * from './workspace-managed-entity';
1
+ export * from "./app-access-grant";
2
+ export * from "./app-api-key";
3
+ export * from "./app-code-package";
4
+ export * from "./app-org";
5
+ export * from "./app-version";
6
+ export * from "./app-extension-definition";
7
+ export * from "./app-extension";
8
+ export * from "./app";
9
+ export * from "./asset";
10
+ export * from "./base-managed-entity";
11
+ export * from "./client";
12
+ export * from "./content";
13
+ export * from "./contentholder-content";
14
+ export * from "./file";
15
+ export * from "./item";
16
+ export * from "./loader";
17
+ export * from "./org";
18
+ export * from "./project-item";
19
+ export * from "./project";
20
+ export * from "./property-type";
21
+ export * from "./org-managed-entity";
22
+ export * from "./subscription";
23
+ export * from "./shared-links";
24
+ export * from "./type-managed-entity";
25
+ export * from "./user";
26
+ export * from "./workspace-managed-entity";
package/lib/index.js CHANGED
@@ -24,10 +24,12 @@ __exportStar(require("./app-extension"), exports);
24
24
  __exportStar(require("./app"), exports);
25
25
  __exportStar(require("./asset"), exports);
26
26
  __exportStar(require("./base-managed-entity"), exports);
27
+ __exportStar(require("./client"), exports);
27
28
  __exportStar(require("./content"), exports);
28
29
  __exportStar(require("./contentholder-content"), exports);
29
30
  __exportStar(require("./file"), exports);
30
31
  __exportStar(require("./item"), exports);
32
+ __exportStar(require("./loader"), exports);
31
33
  __exportStar(require("./org"), exports);
32
34
  __exportStar(require("./project-item"), exports);
33
35
  __exportStar(require("./project"), exports);
@@ -0,0 +1,149 @@
1
+ import { LogLevel } from "./log-level";
2
+ import { OrgManagedEntity } from "./org-managed-entity";
3
+ export declare class ColumnDefinition {
4
+ fromProperty?: string;
5
+ toProperty: string;
6
+ conditions?: ConditionalValues[];
7
+ default?: any;
8
+ }
9
+ export declare class ConditionalValues {
10
+ conditional: string;
11
+ value: string;
12
+ }
13
+ export declare class AssortmentSplit {
14
+ partialAssortmentUpdate?: boolean;
15
+ dropField?: string;
16
+ fieldToSplitOn: string;
17
+ values: ValueToAssortment[];
18
+ }
19
+ export declare class ValueToAssortment {
20
+ value: string;
21
+ assortmentId?: string;
22
+ assortmentIdentifier?: string;
23
+ }
24
+ export interface LoaderConfiguration extends OrgManagedEntity {
25
+ name?: string;
26
+ federatedMappings?: any;
27
+ conditionalColumns?: ColumnDefinition[];
28
+ assortmentSplit?: AssortmentSplit;
29
+ workspaceIdentifier?: string;
30
+ propertiesToRemove?: string[];
31
+ }
32
+ export declare enum LoadStatus {
33
+ ACTIVE = "ACTIVE",
34
+ PENDING = "PENDING",
35
+ FAILED = "FAILED",
36
+ COMPLETE = "COMPLETE"
37
+ }
38
+ export declare enum LoadType {
39
+ ITEM = "ITEM",
40
+ PROJECT_ITEM = "PROJECT_ITEM",
41
+ ASSORTMENT = "ASSORTMENT",
42
+ COLOR = "COLOR",
43
+ CUSTOM_ENTITY = "CUSTOM_ENTITY",
44
+ SIZE_RANGE_TEMPLATE = "SIZE_RANGE_TEMPLATE"
45
+ }
46
+ export interface LoadResult {
47
+ colorsLoadResult?: ColorLoadResult;
48
+ itemsLoadResult?: ItemsLoadResult;
49
+ projectItemsLoadResult?: ProjectItemsLoadResult;
50
+ assortmentItemsLoadResult?: AssortmentItemsLoadResult;
51
+ transformErrors: any[];
52
+ }
53
+ export interface rowLoadError {
54
+ data: any;
55
+ error: any;
56
+ }
57
+ export interface LoaderNumbersSummary {
58
+ numberFamiliesLoaded: number;
59
+ numberOptionsLoaded: number;
60
+ numberProjectItemsLoaded: number;
61
+ numberAssortmentItemsLoaded: number;
62
+ numberColorsLoaded: number;
63
+ numberImagesLoaded: number;
64
+ numberFamiliesFailed: number;
65
+ numberOptionsFailed: number;
66
+ numberProjectItemsFailed: number;
67
+ numberAssortmentItemsFailed: number;
68
+ numberColorsFailed: number;
69
+ numberImagesFailed: number;
70
+ }
71
+ export interface ColorLoadResult {
72
+ colorsCreated: any[];
73
+ colorsUpdated: any[];
74
+ colorsUnchanged: any[];
75
+ colorsFailedCreate: rowLoadError[];
76
+ colorsFailedUpdate: rowLoadError[];
77
+ failed: boolean;
78
+ }
79
+ export interface ItemsLoadResult {
80
+ itemsCreated: any[];
81
+ itemsUpdated: any[];
82
+ itemsUnchanged: any[];
83
+ itemsFailedCreate: rowLoadError[];
84
+ itemsFailedUpdate: rowLoadError[];
85
+ failed: boolean;
86
+ }
87
+ export interface ProjectItemsLoadResult {
88
+ projectItemsCreated: any[];
89
+ projectItemsUpdated: any[];
90
+ projectItemsUnchanged: any[];
91
+ projectItemsFailedCreate: rowLoadError[];
92
+ projectItemsFailedUpdate: rowLoadError[];
93
+ failed: boolean;
94
+ }
95
+ export interface AssortmentItemsLoadResult {
96
+ assortmentItemsCreated: any[];
97
+ assortmentItemsUpdated: any[];
98
+ assortmentItemsUnchanged: any[];
99
+ assortmentItemsDeleted: any[];
100
+ assortmentItemsFailedCreate: rowLoadError[];
101
+ assortmentItemsFailedUpdate: rowLoadError[];
102
+ assortmentItemsFailedDelete: rowLoadError[];
103
+ failed: boolean;
104
+ }
105
+ export interface PreprocessingStepStoredResultSummary {
106
+ preprocessingStepName: string;
107
+ fileId: string;
108
+ numberOfWarnings: number;
109
+ numberOfErrors: number;
110
+ }
111
+ export declare class LoaderProcess implements OrgManagedEntity {
112
+ id: string;
113
+ createdOn?: Date;
114
+ updatedOn?: Date;
115
+ createdById?: string;
116
+ updatedById?: string;
117
+ createdBy?: any;
118
+ updatedBy?: any;
119
+ orgId?: string;
120
+ loaderConfigurationId?: string;
121
+ name?: string;
122
+ endedOn?: Date;
123
+ status: LoadStatus;
124
+ logLevel?: LogLevel;
125
+ processLogs?: string;
126
+ processLogS3File?: string;
127
+ processLogS3FileDownloadLink?: string;
128
+ logsFileId?: string;
129
+ logFileDownloadLink?: string;
130
+ loadProcessResult?: LoadResult;
131
+ loadProcessResultFileId?: string;
132
+ loadProcessResultDownloadLink?: string;
133
+ preprocessingStepResults?: PreprocessingStepStoredResultSummary[];
134
+ processDurationSeconds?: number;
135
+ loadFileId: string;
136
+ loadType: LoadType[];
137
+ federatedMappings?: any;
138
+ conditionalColumns?: ColumnDefinition[];
139
+ assortmentSplit?: AssortmentSplit;
140
+ partialAssortmentUpdate?: boolean;
141
+ assortmentItemDropField?: string;
142
+ workspaceIdentifier?: string;
143
+ propertiesToRemove?: string[];
144
+ badRowsCount?: number;
145
+ uploadErrorCount?: number;
146
+ hasErrors?: boolean;
147
+ parallelWorkerCount?: number;
148
+ messageGroupId?: string;
149
+ }
package/lib/loader.js ADDED
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoaderProcess = exports.LoadType = exports.LoadStatus = exports.ValueToAssortment = exports.AssortmentSplit = exports.ConditionalValues = exports.ColumnDefinition = void 0;
4
+ class ColumnDefinition {
5
+ fromProperty;
6
+ toProperty;
7
+ conditions;
8
+ default;
9
+ }
10
+ exports.ColumnDefinition = ColumnDefinition;
11
+ class ConditionalValues {
12
+ conditional;
13
+ value;
14
+ }
15
+ exports.ConditionalValues = ConditionalValues;
16
+ class AssortmentSplit {
17
+ partialAssortmentUpdate;
18
+ dropField;
19
+ fieldToSplitOn;
20
+ values;
21
+ }
22
+ exports.AssortmentSplit = AssortmentSplit;
23
+ class ValueToAssortment {
24
+ value;
25
+ assortmentId;
26
+ assortmentIdentifier;
27
+ }
28
+ exports.ValueToAssortment = ValueToAssortment;
29
+ var LoadStatus;
30
+ (function (LoadStatus) {
31
+ LoadStatus["ACTIVE"] = "ACTIVE";
32
+ LoadStatus["PENDING"] = "PENDING";
33
+ LoadStatus["FAILED"] = "FAILED";
34
+ LoadStatus["COMPLETE"] = "COMPLETE";
35
+ })(LoadStatus = exports.LoadStatus || (exports.LoadStatus = {}));
36
+ var LoadType;
37
+ (function (LoadType) {
38
+ LoadType["ITEM"] = "ITEM";
39
+ LoadType["PROJECT_ITEM"] = "PROJECT_ITEM";
40
+ LoadType["ASSORTMENT"] = "ASSORTMENT";
41
+ LoadType["COLOR"] = "COLOR";
42
+ LoadType["CUSTOM_ENTITY"] = "CUSTOM_ENTITY";
43
+ LoadType["SIZE_RANGE_TEMPLATE"] = "SIZE_RANGE_TEMPLATE";
44
+ })(LoadType = exports.LoadType || (exports.LoadType = {}));
45
+ class LoaderProcess {
46
+ id;
47
+ createdOn;
48
+ updatedOn;
49
+ createdById;
50
+ updatedById;
51
+ createdBy;
52
+ updatedBy;
53
+ orgId;
54
+ loaderConfigurationId;
55
+ name;
56
+ endedOn;
57
+ status;
58
+ logLevel;
59
+ processLogs;
60
+ processLogS3File;
61
+ processLogS3FileDownloadLink;
62
+ logsFileId;
63
+ logFileDownloadLink;
64
+ loadProcessResult;
65
+ loadProcessResultFileId;
66
+ loadProcessResultDownloadLink;
67
+ preprocessingStepResults;
68
+ processDurationSeconds;
69
+ loadFileId;
70
+ loadType;
71
+ federatedMappings;
72
+ conditionalColumns;
73
+ assortmentSplit;
74
+ partialAssortmentUpdate;
75
+ assortmentItemDropField;
76
+ workspaceIdentifier;
77
+ propertiesToRemove;
78
+ badRowsCount;
79
+ uploadErrorCount;
80
+ hasErrors;
81
+ parallelWorkerCount;
82
+ messageGroupId;
83
+ }
84
+ exports.LoaderProcess = LoaderProcess;
@@ -0,0 +1,8 @@
1
+ export declare enum LogLevel {
2
+ FATAL = 0,
3
+ ERROR = 1,
4
+ WARN = 2,
5
+ INFO = 3,
6
+ LOG = 4,
7
+ DEBUG = 5
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogLevel = void 0;
4
+ var LogLevel;
5
+ (function (LogLevel) {
6
+ LogLevel[LogLevel["FATAL"] = 0] = "FATAL";
7
+ LogLevel[LogLevel["ERROR"] = 1] = "ERROR";
8
+ LogLevel[LogLevel["WARN"] = 2] = "WARN";
9
+ LogLevel[LogLevel["INFO"] = 3] = "INFO";
10
+ LogLevel[LogLevel["LOG"] = 4] = "LOG";
11
+ LogLevel[LogLevel["DEBUG"] = 5] = "DEBUG";
12
+ })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
@@ -17,7 +17,7 @@ export declare enum SubscriptionChannel {
17
17
  export declare const SHOWCASE_APP_SUBSCRIBED_TO_CONST = "showcase-app";
18
18
  export declare const PLAN_APP_SUBSCRIBED_TO_CONST = "plan-app";
19
19
  export declare const BOARD_APP_SUBSCRIBED_TO_CONST = "board-app";
20
- export declare type SubscriptionMatrix = {
20
+ export type SubscriptionMatrix = {
21
21
  [key in SubscriptionType]?: SubscriptionChannel[];
22
22
  };
23
23
  export interface Subscription extends OrgManagedEntity {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/entity-types",
3
- "version": "1.1.47",
3
+ "version": "1.1.51-0",
4
4
  "description": "A types library for Vibeiq entities.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -21,6 +21,6 @@
21
21
  "js-yaml": "^4.1.0",
22
22
  "typedoc": "^0.25.7",
23
23
  "typedoc-plugin-extras": "^3.0.0",
24
- "typescript": "^4.0.0"
24
+ "typescript": "^4.2"
25
25
  }
26
26
  }