@contrail/cli 3.6.0-alpha-8-alpha.2ab4f80 → 3.6.0-alpha.693d785
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/README.md +45 -151
- package/dist/api/feature-flags.d.ts +3 -0
- package/dist/api/feature-flags.js +29 -0
- package/dist/api/types.d.ts +0 -35
- package/dist/api/types.js +1 -49
- package/dist/api/users.d.ts +1 -0
- package/dist/api/users.js +10 -1
- package/dist/auth/login.d.ts +4 -0
- package/dist/auth/login.js +169 -94
- package/dist/auth/login.spec.js +305 -0
- package/dist/auth/sso.d.ts +36 -0
- package/dist/auth/sso.js +168 -0
- package/dist/auth/sso.spec.js +138 -0
- package/dist/basecommand.d.ts +1 -3
- package/dist/basecommand.js +4 -4
- package/dist/commands/app/getApiKey.js +2 -2
- package/dist/commands/config/set.js +1 -1
- package/dist/commands/feature-flags/export.d.ts +19 -0
- package/dist/commands/feature-flags/export.js +66 -0
- package/dist/commands/feature-flags/export.spec.js +109 -0
- package/dist/commands/feature-flags/import.d.ts +42 -0
- package/dist/commands/feature-flags/import.js +191 -0
- package/dist/commands/feature-flags/import.spec.js +194 -0
- package/dist/commands/instance/export.d.ts +9 -0
- package/dist/commands/instance/export.js +18 -3
- package/dist/commands/instance/export.spec.js +32 -0
- package/dist/commands/instance/import.d.ts +3 -0
- package/dist/commands/instance/import.js +5 -0
- package/dist/commands/instance/import.spec.js +4 -0
- package/dist/commands/login.d.ts +12 -0
- package/dist/commands/login.js +25 -0
- package/dist/common.d.ts +1 -4
- package/dist/common.js +1 -18
- package/dist/helpers/config/config.d.ts +5 -4
- package/dist/helpers/config/config.js +10 -12
- package/dist/helpers/file-helpers.d.ts +0 -1
- package/dist/helpers/file-helpers.js +3 -20
- package/dist/logger.js +1 -4
- package/node_modules/@contrail/entity-compare/package.json +3 -6
- package/node_modules/@contrail/loader/lib/common/conditional-columns.js +1 -1
- package/node_modules/@contrail/loader/lib/constants.d.ts +8 -0
- package/node_modules/@contrail/loader/lib/constants.js +9 -1
- package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.d.ts +4 -0
- package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.js +57 -0
- package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.spec.js +492 -34
- package/node_modules/@contrail/loader/lib/pipeline/validate.js +2 -52
- package/node_modules/@contrail/loader/lib/pipeline/validate.spec.js +0 -85
- package/node_modules/@contrail/loader/package.json +2 -2
- package/node_modules/@contrail/sdk/.github/workflows/publish-to-npm.yml +4 -1
- package/node_modules/@contrail/sdk/lib/auth/login.js +1 -1
- package/node_modules/@contrail/sdk/lib/config/config.d.ts +0 -3
- package/node_modules/@contrail/sdk/lib/config/config.js +7 -13
- package/node_modules/@contrail/sdk/lib/core/request.js +2 -6
- package/node_modules/@contrail/sdk/lib/entities/entities.client.d.ts +0 -2
- package/node_modules/@contrail/sdk/lib/entities/entities.client.js +1 -3
- package/node_modules/@contrail/sdk/lib/entities/entity.resource.registry.js +0 -1
- package/node_modules/@contrail/sdk/package.json +1 -1
- package/oclif.manifest.json +75 -365
- package/package.json +15 -5
- package/dist/commands/entities/create.d.ts +0 -49
- package/dist/commands/entities/create.js +0 -643
- package/dist/commands/entities/create.spec.js +0 -545
- package/dist/commands/entities/delete.d.ts +0 -20
- package/dist/commands/entities/delete.js +0 -137
- package/dist/commands/entities/get.d.ts +0 -25
- package/dist/commands/entities/get.js +0 -276
- package/dist/commands/entities/grammar.spec.js +0 -80
- package/dist/commands/entities/output.spec.js +0 -72
- package/dist/commands/entities/update.d.ts +0 -32
- package/dist/commands/entities/update.js +0 -160
- package/dist/helpers/entities/assortment-items.d.ts +0 -12
- package/dist/helpers/entities/assortment-items.js +0 -87
- package/dist/helpers/entities/batchFetch.d.ts +0 -8
- package/dist/helpers/entities/batchFetch.js +0 -49
- package/dist/helpers/entities/index.d.ts +0 -3
- package/dist/helpers/entities/index.js +0 -6
- package/dist/helpers/entities/items.d.ts +0 -10
- package/dist/helpers/entities/items.js +0 -102
- package/dist/helpers/entities/project-items.d.ts +0 -3
- package/dist/helpers/entities/project-items.js +0 -65
- package/dist/helpers/propertySpecifications/dateRanges.d.ts +0 -38
- package/dist/helpers/propertySpecifications/dateRanges.js +0 -89
- package/dist/helpers/propertySpecifications/dateRanges.spec.js +0 -95
- package/dist/helpers/propertySpecifications/propertySpecifications.d.ts +0 -40
- package/dist/helpers/propertySpecifications/propertySpecifications.js +0 -109
- package/dist/helpers/propertySpecifications/propertySpecifications.spec.d.ts +0 -1
- package/dist/helpers/propertySpecifications/propertySpecifications.spec.js +0 -373
- package/dist/logger.spec.d.ts +0 -1
- package/dist/logger.spec.js +0 -12
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/.github/pull_request_template.md +0 -31
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/.github/workflows/check-code-formatting.yml +0 -34
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/.github/workflows/empty.yml +0 -10
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/.github/workflows/generate-sdk-docs.yml +0 -32
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/.github/workflows/publish-to-npm.yml +0 -117
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/.github/workflows/sdk-lib.yml +0 -27
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/.prettierrc.yaml +0 -2
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/README.md +0 -72
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/home-hero.svg +0 -11
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/assets/assets.d.ts +0 -9
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/assets/assets.js +0 -54
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/assets/index.d.ts +0 -1
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/assets/index.js +0 -17
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/auth/auth.d.ts +0 -10
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/auth/auth.js +0 -6
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/auth/index.d.ts +0 -2
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/auth/index.js +0 -18
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/auth/login.d.ts +0 -10
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/auth/login.js +0 -209
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/config/config.d.ts +0 -48
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/config/config.js +0 -42
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/config/index.d.ts +0 -1
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/config/index.js +0 -17
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/content/content.d.ts +0 -12
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/content/content.js +0 -70
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/content/index.d.ts +0 -1
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/content/index.js +0 -17
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/core/index.d.ts +0 -1
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/core/index.js +0 -17
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/core/request.d.ts +0 -15
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/core/request.js +0 -241
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/entities.client.d.ts +0 -101
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/entities.client.js +0 -306
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/entity-reference-expander.d.ts +0 -9
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/entity-reference-expander.js +0 -86
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/entity-reference.d.ts +0 -6
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/entity-reference.js +0 -19
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/entity.resource.registry.d.ts +0 -5
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/entity.resource.registry.js +0 -59
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/index.d.ts +0 -3
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/entities/index.js +0 -19
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/files/file-type-helper.d.ts +0 -3
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/files/file-type-helper.js +0 -24
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/files/files.d.ts +0 -19
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/files/files.js +0 -151
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/files/index.d.ts +0 -1
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/files/index.js +0 -17
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/index.d.ts +0 -10
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/index.js +0 -26
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/notifications/index.d.ts +0 -1
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/notifications/index.js +0 -17
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/notifications/notifications-dispatcher.d.ts +0 -16
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/notifications/notifications-dispatcher.js +0 -37
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/policies/index.d.ts +0 -1
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/policies/index.js +0 -17
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/policies/policies-cache.d.ts +0 -12
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/policies/policies-cache.js +0 -55
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/policies/policies.client.d.ts +0 -9
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/policies/policies.client.js +0 -74
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/types/index.d.ts +0 -2
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/types/index.js +0 -18
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/types/sub-types-helper.d.ts +0 -18
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/types/sub-types-helper.js +0 -98
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/types/types-cache.d.ts +0 -19
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/types/types-cache.js +0 -73
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/types/types.client.d.ts +0 -42
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/types/types.client.js +0 -217
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/package.json +0 -64
- package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/scripts/replicate-bug.js +0 -69
- package/node_modules/@contrail/sdk/scripts/replicate-bug.js +0 -69
- /package/dist/{commands/entities/create.spec.d.ts → auth/sso.spec.d.ts} +0 -0
- /package/dist/commands/{entities/grammar.spec.d.ts → feature-flags/export.spec.d.ts} +0 -0
- /package/dist/commands/{entities/output.spec.d.ts → feature-flags/import.spec.d.ts} +0 -0
- /package/dist/{helpers/propertySpecifications/dateRanges.spec.d.ts → commands/instance/export.spec.d.ts} +0 -0
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
interface AuthTokenResolver {
|
|
2
|
-
resolveAuthToken: () => Promise<string>;
|
|
3
|
-
}
|
|
4
|
-
export interface RequestDetails {
|
|
5
|
-
url: string;
|
|
6
|
-
method?: string;
|
|
7
|
-
headers?: Record<string, string>;
|
|
8
|
-
body?: string;
|
|
9
|
-
}
|
|
10
|
-
interface ErrorHandler {
|
|
11
|
-
handle: (responeObject: any, errorJson: Record<string, unknown> | string, retryCallback: any, requestObject?: RequestDetails) => Promise<any>;
|
|
12
|
-
}
|
|
13
|
-
interface NetworkErrorHandler {
|
|
14
|
-
handle: (error: Error) => Promise<any>;
|
|
15
|
-
}
|
|
16
|
-
export interface ContrailConfig {
|
|
17
|
-
apiGateway?: string;
|
|
18
|
-
orgId?: string;
|
|
19
|
-
orgSlug?: string;
|
|
20
|
-
apiUserToken?: string;
|
|
21
|
-
apiSystemUserId?: string;
|
|
22
|
-
apiSystemOrgSlug?: string;
|
|
23
|
-
apiSystemUserEmail?: string;
|
|
24
|
-
apiSystemUserRole?: string;
|
|
25
|
-
authTokenResolver?: AuthTokenResolver;
|
|
26
|
-
errorHandler?: ErrorHandler;
|
|
27
|
-
networkErrorHandler?: NetworkErrorHandler;
|
|
28
|
-
}
|
|
29
|
-
declare global {
|
|
30
|
-
var __CONTRAIL_SDK_CONFIG__: ContrailConfig | undefined;
|
|
31
|
-
}
|
|
32
|
-
export declare const CONTRAIL_CONFIG: ContrailConfig;
|
|
33
|
-
export declare function setConfig(config: ContrailConfig): void;
|
|
34
|
-
export declare function getConfig(): ContrailConfig;
|
|
35
|
-
export interface InvocationContext {
|
|
36
|
-
user?: any;
|
|
37
|
-
orgId: string;
|
|
38
|
-
orgSlug: string;
|
|
39
|
-
orgRole: any;
|
|
40
|
-
app?: any;
|
|
41
|
-
requestOptions?: {
|
|
42
|
-
useNativeFetch?: boolean;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export declare function setFromContext(ctx: InvocationContext): void;
|
|
46
|
-
export declare function setGlobalContext(context: InvocationContext): void;
|
|
47
|
-
export declare function getGlobalContext(): InvocationContext;
|
|
48
|
-
export {};
|
package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/config/config.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGlobalContext = exports.setGlobalContext = exports.setFromContext = exports.getConfig = exports.setConfig = exports.CONTRAIL_CONFIG = void 0;
|
|
4
|
-
function getOrInitGlobalConfig() {
|
|
5
|
-
var _a, _b;
|
|
6
|
-
if (!globalThis.__CONTRAIL_SDK_CONFIG__) {
|
|
7
|
-
globalThis.__CONTRAIL_SDK_CONFIG__ = {
|
|
8
|
-
apiGateway: ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.API_GATEWAY) || 'http://localhost:3000/api',
|
|
9
|
-
orgId: (_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.ORG_ID,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
return globalThis.__CONTRAIL_SDK_CONFIG__;
|
|
13
|
-
}
|
|
14
|
-
exports.CONTRAIL_CONFIG = getOrInitGlobalConfig();
|
|
15
|
-
function setConfig(config) {
|
|
16
|
-
Object.assign(getOrInitGlobalConfig(), config);
|
|
17
|
-
}
|
|
18
|
-
exports.setConfig = setConfig;
|
|
19
|
-
function getConfig() {
|
|
20
|
-
return getOrInitGlobalConfig();
|
|
21
|
-
}
|
|
22
|
-
exports.getConfig = getConfig;
|
|
23
|
-
function setFromContext(ctx) {
|
|
24
|
-
const params = {
|
|
25
|
-
apiSystemUserRole: ctx.orgRole,
|
|
26
|
-
apiSystemUserId: ctx.user.id,
|
|
27
|
-
apiSystemOrgSlug: ctx.orgSlug,
|
|
28
|
-
orgId: ctx.orgId,
|
|
29
|
-
apiSystemUserEmail: ctx.user.email,
|
|
30
|
-
};
|
|
31
|
-
setConfig(params);
|
|
32
|
-
}
|
|
33
|
-
exports.setFromContext = setFromContext;
|
|
34
|
-
let CONTEXT;
|
|
35
|
-
function setGlobalContext(context) {
|
|
36
|
-
CONTEXT = context;
|
|
37
|
-
}
|
|
38
|
-
exports.setGlobalContext = setGlobalContext;
|
|
39
|
-
function getGlobalContext() {
|
|
40
|
-
return CONTEXT;
|
|
41
|
-
}
|
|
42
|
-
exports.getGlobalContext = getGlobalContext;
|
package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/config/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './config';
|
package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/config/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./config"), exports);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface CreateContentOptions {
|
|
2
|
-
file?: File;
|
|
3
|
-
fileBuffer?: any;
|
|
4
|
-
contentHolderReference: string;
|
|
5
|
-
fileId?: string;
|
|
6
|
-
fileName?: string;
|
|
7
|
-
contentType?: string;
|
|
8
|
-
entityPolicyIds?: string[];
|
|
9
|
-
}
|
|
10
|
-
export declare class Content {
|
|
11
|
-
create(options: CreateContentOptions): Promise<any>;
|
|
12
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Content = void 0;
|
|
13
|
-
const entities_1 = require("../entities");
|
|
14
|
-
const file_type_helper_1 = require("../files/file-type-helper");
|
|
15
|
-
const files_1 = require("../files/files");
|
|
16
|
-
class Content {
|
|
17
|
-
create(options) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
let content = null;
|
|
20
|
-
if (options.file) {
|
|
21
|
-
const file = options.file;
|
|
22
|
-
if (!file) {
|
|
23
|
-
throw Error(`Must specify file in create.`);
|
|
24
|
-
}
|
|
25
|
-
const contentType = file.type || file_type_helper_1.FileTypeHelper.getContentType(file);
|
|
26
|
-
content = yield new entities_1.Entities().create({
|
|
27
|
-
entityName: 'content',
|
|
28
|
-
object: {
|
|
29
|
-
contentHolderReference: options.contentHolderReference,
|
|
30
|
-
fileName: file.name,
|
|
31
|
-
contentType,
|
|
32
|
-
entityPolicyIds: options.entityPolicyIds,
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
yield new files_1.Files().uploadFile(content.primaryFile.uploadPost, file);
|
|
36
|
-
}
|
|
37
|
-
else if (options.fileBuffer && options.fileName && options.contentType) {
|
|
38
|
-
const fileBuffer = options.fileBuffer;
|
|
39
|
-
const contentType = options.contentType;
|
|
40
|
-
content = yield new entities_1.Entities().create({
|
|
41
|
-
entityName: 'content',
|
|
42
|
-
object: {
|
|
43
|
-
contentHolderReference: options.contentHolderReference,
|
|
44
|
-
fileName: options.fileName,
|
|
45
|
-
contentType,
|
|
46
|
-
entityPolicyIds: options.entityPolicyIds,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
yield new files_1.Files().uploadFileAsStream(content.primaryFile.uploadPost, fileBuffer, {
|
|
50
|
-
contentType: options.contentType,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
else if (options.fileId) {
|
|
54
|
-
content = yield new entities_1.Entities().create({
|
|
55
|
-
entityName: 'content',
|
|
56
|
-
object: {
|
|
57
|
-
contentHolderReference: options.contentHolderReference,
|
|
58
|
-
copyFileId: options.fileId,
|
|
59
|
-
entityPolicyIds: options.entityPolicyIds,
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
throw new Error('Must specify file or fileId');
|
|
65
|
-
}
|
|
66
|
-
return content;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.Content = Content;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './content';
|
package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/content/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./content"), exports);
|
package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/core/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './request';
|
package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/core/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./request"), exports);
|
package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/core/request.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { InvocationContext } from '../config/config';
|
|
2
|
-
export declare const AUTH_TOKEN_REQUIRED = "Authentication token must be set to make a contrail call.";
|
|
3
|
-
export declare function _resetTokenRefreshPromise(): void;
|
|
4
|
-
export declare class Request {
|
|
5
|
-
private static MAX_RETRIES;
|
|
6
|
-
private static RETRY_DELAY;
|
|
7
|
-
static request(resource: any, params?: any, ctx?: InvocationContext): Promise<any>;
|
|
8
|
-
private static requestWithRetries;
|
|
9
|
-
private static isTokenExpiredError;
|
|
10
|
-
private static delay;
|
|
11
|
-
static logError(error: {}, resource: any, params?: {}): void;
|
|
12
|
-
static sanitizeParametersString(params: any): string;
|
|
13
|
-
private static getHeaders;
|
|
14
|
-
private static tryParseStringIntoObject;
|
|
15
|
-
}
|
package/node_modules/@contrail/org-config-migration/node_modules/@contrail/sdk/lib/core/request.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
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
|
-
exports.Request = exports._resetTokenRefreshPromise = exports.AUTH_TOKEN_REQUIRED = void 0;
|
|
16
|
-
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
17
|
-
const config_1 = require("../config/config");
|
|
18
|
-
const auth_1 = require("../auth/auth");
|
|
19
|
-
exports.AUTH_TOKEN_REQUIRED = 'Authentication token must be set to make a contrail call.';
|
|
20
|
-
class ApiError extends Error {
|
|
21
|
-
constructor(message, details, errorCode) {
|
|
22
|
-
super(message);
|
|
23
|
-
this.details = details;
|
|
24
|
-
this.errorCode = errorCode;
|
|
25
|
-
this.details = details;
|
|
26
|
-
this.errorCode = errorCode;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
let tokenRefreshPromise = null;
|
|
30
|
-
function performTokenRefresh() {
|
|
31
|
-
var _a, _b, _c;
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const apiRefreshToken = (_a = auth_1.Auth.config) === null || _a === void 0 ? void 0 : _a.apiRefreshToken;
|
|
34
|
-
const apiGateway = (_b = auth_1.Auth.config) === null || _b === void 0 ? void 0 : _b.apiGateway;
|
|
35
|
-
if (!apiRefreshToken) {
|
|
36
|
-
throw new Error('No API refresh token available. Please login again.');
|
|
37
|
-
}
|
|
38
|
-
if (!apiGateway) {
|
|
39
|
-
throw new Error('API Gateway not configured. Ensure the application environment is properly configured.');
|
|
40
|
-
}
|
|
41
|
-
const url = apiGateway + '/auth/jwt_refresh/';
|
|
42
|
-
try {
|
|
43
|
-
const response = yield (0, node_fetch_1.default)(url, {
|
|
44
|
-
method: 'POST',
|
|
45
|
-
headers: {
|
|
46
|
-
Accept: 'application/json',
|
|
47
|
-
'Content-Type': 'application/json',
|
|
48
|
-
},
|
|
49
|
-
body: JSON.stringify({
|
|
50
|
-
refreshToken: apiRefreshToken,
|
|
51
|
-
}),
|
|
52
|
-
});
|
|
53
|
-
if (!response.ok) {
|
|
54
|
-
const errorText = yield response.text();
|
|
55
|
-
throw new Error(`Token refresh failed with status ${response.status}: ${errorText}`);
|
|
56
|
-
}
|
|
57
|
-
const data = yield response.json();
|
|
58
|
-
if (!data.accessToken) {
|
|
59
|
-
throw new Error(`Token refresh response did not contain a new access token.`);
|
|
60
|
-
}
|
|
61
|
-
auth_1.Auth.config.apiUserToken = data.accessToken;
|
|
62
|
-
(0, config_1.setConfig)(auth_1.Auth.config);
|
|
63
|
-
console.log('Access token refreshed successfully');
|
|
64
|
-
return data.accessToken;
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
throw new Error(`Token refresh failed: ${(_c = error === null || error === void 0 ? void 0 : error.message) !== null && _c !== void 0 ? _c : String(error)}. Please login again with your credentials.`);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function refreshAccessToken() {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
if (tokenRefreshPromise) {
|
|
74
|
-
console.log('Token refresh already in progress, waiting for completion...');
|
|
75
|
-
return tokenRefreshPromise;
|
|
76
|
-
}
|
|
77
|
-
tokenRefreshPromise = performTokenRefresh();
|
|
78
|
-
try {
|
|
79
|
-
const newToken = yield tokenRefreshPromise;
|
|
80
|
-
return newToken;
|
|
81
|
-
}
|
|
82
|
-
finally {
|
|
83
|
-
tokenRefreshPromise = null;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function _resetTokenRefreshPromise() {
|
|
88
|
-
tokenRefreshPromise = null;
|
|
89
|
-
}
|
|
90
|
-
exports._resetTokenRefreshPromise = _resetTokenRefreshPromise;
|
|
91
|
-
class Request {
|
|
92
|
-
static request(resource, params = { method: 'get' }, ctx) {
|
|
93
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
params.headers = Object.assign(Object.assign({}, (params.headers || {})), (yield Request.getHeaders()));
|
|
95
|
-
try {
|
|
96
|
-
return yield this.requestWithRetries(resource, params, ctx);
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
if (this.isTokenExpiredError(error)) {
|
|
100
|
-
console.log(`[SDK Request: Token Expired] Attempting to refresh access token...`);
|
|
101
|
-
try {
|
|
102
|
-
yield refreshAccessToken();
|
|
103
|
-
params.headers = Object.assign(Object.assign({}, (params.headers || {})), (yield Request.getHeaders()));
|
|
104
|
-
console.log(`[SDK Request: Token Refreshed] Retrying request...`);
|
|
105
|
-
return yield this.requestWithRetries(resource, params, ctx);
|
|
106
|
-
}
|
|
107
|
-
catch (refreshError) {
|
|
108
|
-
console.error(`[SDK Request: Token Refresh Failed] ${refreshError === null || refreshError === void 0 ? void 0 : refreshError.message}`, refreshError);
|
|
109
|
-
throw new ApiError('Access token refresh failed after TOKEN_EXPIRED error. Unable to proceed with request', refreshError);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
throw error;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
static requestWithRetries(resource, params, ctx) {
|
|
117
|
-
var _a;
|
|
118
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
const userCtx = ctx || (0, config_1.getGlobalContext)();
|
|
120
|
-
const start = new Date();
|
|
121
|
-
const { apiGateway: API_GATEWAY, networkErrorHandler, errorHandler } = (0, config_1.getConfig)();
|
|
122
|
-
const url = API_GATEWAY + resource;
|
|
123
|
-
const method = (params === null || params === void 0 ? void 0 : params.method) ? params.method.toUpperCase() : 'GET';
|
|
124
|
-
const fullResource = `${method} ${url.split('/')[3]}${resource}`;
|
|
125
|
-
let res;
|
|
126
|
-
let attempt = 0;
|
|
127
|
-
while (attempt <= this.MAX_RETRIES) {
|
|
128
|
-
attempt++;
|
|
129
|
-
try {
|
|
130
|
-
if ((_a = userCtx === null || userCtx === void 0 ? void 0 : userCtx.requestOptions) === null || _a === void 0 ? void 0 : _a.useNativeFetch) {
|
|
131
|
-
res = yield globalThis.fetch(url, params);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
res = yield (0, node_fetch_1.default)(url, params);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
catch (error) {
|
|
138
|
-
if (networkErrorHandler) {
|
|
139
|
-
Request.logError(error, resource, params);
|
|
140
|
-
return yield networkErrorHandler.handle(error);
|
|
141
|
-
}
|
|
142
|
-
console.error(`[Attempt ${attempt}][SDK Request: Network Error] resource: ${fullResource}`);
|
|
143
|
-
console.error(`[Attempt ${attempt}][SDK Request: Network Error] params: ${this.sanitizeParametersString(params)}`);
|
|
144
|
-
console.error(`[Attempt ${attempt}][SDK Request: Network Error] error: ${error}`);
|
|
145
|
-
console.error(`[Attempt ${attempt}][SDK Request: Network Error] retrying...`);
|
|
146
|
-
if (attempt > Request.MAX_RETRIES) {
|
|
147
|
-
console.error(`[Max Number of retries reached][SDK Request: Network Error] resource: ${fullResource} error: ${error}`);
|
|
148
|
-
throw error;
|
|
149
|
-
}
|
|
150
|
-
yield Request.delay(this.RETRY_DELAY);
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
if (res.ok) {
|
|
154
|
-
const text = yield res.text();
|
|
155
|
-
const json = text.length ? JSON.parse(text) : null;
|
|
156
|
-
const end = new Date();
|
|
157
|
-
console.log(`[###### SDK Request]: (DURATION:${end.getTime() - start.getTime()}) : ${fullResource}:`);
|
|
158
|
-
return Promise.resolve(json);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
const error = yield res.text();
|
|
162
|
-
const errorJson = this.tryParseStringIntoObject(error);
|
|
163
|
-
const isTokenExpired = errorJson && typeof errorJson === 'object' && errorJson.errorCode === 'TOKEN_EXPIRED';
|
|
164
|
-
if (isTokenExpired) {
|
|
165
|
-
throw new ApiError('Token expired', errorJson, 'TOKEN_EXPIRED');
|
|
166
|
-
}
|
|
167
|
-
if (errorHandler) {
|
|
168
|
-
const retryCallback = () => __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
params.headers = Object.assign(Object.assign({}, (params.headers || {})), (yield Request.getHeaders()));
|
|
170
|
-
return yield (0, node_fetch_1.default)(url, params);
|
|
171
|
-
});
|
|
172
|
-
console.log(`[###### SDK Request: ERROR] code ${res.status} resource: ${fullResource}`);
|
|
173
|
-
console.log(`[###### SDK Request: ERROR] params ${Request.sanitizeParametersString(params)}`);
|
|
174
|
-
const request = Object.assign(Object.assign({}, params), { url, method });
|
|
175
|
-
return yield errorHandler.handle(res, errorJson, retryCallback, request);
|
|
176
|
-
}
|
|
177
|
-
if (attempt <= this.MAX_RETRIES) {
|
|
178
|
-
console.error(`[Attempt ${attempt}][SDK Request: ERROR] resource: ${fullResource}`);
|
|
179
|
-
console.error(`[Attempt ${attempt}][SDK Request: ERROR] params ${Request.sanitizeParametersString(params)}`);
|
|
180
|
-
console.error(`[Attempt ${attempt}][SDK Request: ERROR] error: ${error}`);
|
|
181
|
-
console.error(`[Attempt ${attempt}][SDK Request: ERROR] retrying...`);
|
|
182
|
-
yield Request.delay(this.RETRY_DELAY);
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
console.error(`[Max Number of retries reached][SDK Request: ERROR] resource: ${fullResource}`);
|
|
186
|
-
console.error(`[Max Number of retries reached][SDK Request: ERROR] params ${Request.sanitizeParametersString(params)}`);
|
|
187
|
-
console.error(`[Max Number of retries reached][SDK Request: ERROR] error: ${error}`);
|
|
188
|
-
throw new ApiError(error.message, error);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
static isTokenExpiredError(error) {
|
|
194
|
-
return error instanceof ApiError && error.errorCode === 'TOKEN_EXPIRED';
|
|
195
|
-
}
|
|
196
|
-
static delay(ms) {
|
|
197
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
198
|
-
}
|
|
199
|
-
static logError(error = {}, resource, params = {}) {
|
|
200
|
-
const sanitizedParams = Request.sanitizeParametersString(params);
|
|
201
|
-
console.error(`[###### SDK Request: ERROR] error: ${JSON.stringify(error)}
|
|
202
|
-
resource: ${resource}
|
|
203
|
-
params: ${JSON.stringify(sanitizedParams)}`);
|
|
204
|
-
}
|
|
205
|
-
static sanitizeParametersString(params) {
|
|
206
|
-
if (!params) {
|
|
207
|
-
return '';
|
|
208
|
-
}
|
|
209
|
-
const sanitizedParams = JSON.parse(JSON.stringify(params));
|
|
210
|
-
if ((sanitizedParams === null || sanitizedParams === void 0 ? void 0 : sanitizedParams.headers) && sanitizedParams.headers['X-Api-Key']) {
|
|
211
|
-
sanitizedParams.headers['X-Api-Key'] = sanitizedParams.headers['X-Api-Key'].substring(0, 5) + '...';
|
|
212
|
-
}
|
|
213
|
-
return JSON.stringify(sanitizedParams);
|
|
214
|
-
}
|
|
215
|
-
static getHeaders() {
|
|
216
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
-
const config = (0, config_1.getConfig)();
|
|
218
|
-
const headers = {};
|
|
219
|
-
if (config.authTokenResolver) {
|
|
220
|
-
headers['X-Api-Key'] = yield config.authTokenResolver.resolveAuthToken();
|
|
221
|
-
headers['X-Api-Org'] = config.orgSlug;
|
|
222
|
-
}
|
|
223
|
-
else if (config.apiUserToken) {
|
|
224
|
-
headers['X-Api-Key'] = config.apiUserToken;
|
|
225
|
-
headers['X-Api-Org'] = config.orgSlug;
|
|
226
|
-
}
|
|
227
|
-
return headers;
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
static tryParseStringIntoObject(jsonString) {
|
|
231
|
-
try {
|
|
232
|
-
return JSON.parse(jsonString);
|
|
233
|
-
}
|
|
234
|
-
catch (e) {
|
|
235
|
-
return jsonString;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
exports.Request = Request;
|
|
240
|
-
Request.MAX_RETRIES = 2;
|
|
241
|
-
Request.RETRY_DELAY = 1000;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { EntityReference } from './entity-reference';
|
|
2
|
-
import { EntitiesClient as AbstractEntitiesClient } from '@contrail/entity-types';
|
|
3
|
-
export interface SortOption {
|
|
4
|
-
orderField: string;
|
|
5
|
-
order?: SortOrderOptions;
|
|
6
|
-
}
|
|
7
|
-
export declare enum SortOrderOptions {
|
|
8
|
-
ASC = "asc",
|
|
9
|
-
DESC = "desc"
|
|
10
|
-
}
|
|
11
|
-
export declare enum API_VERSION {
|
|
12
|
-
EMPTY = "",
|
|
13
|
-
V1 = "1",
|
|
14
|
-
V2 = "2"
|
|
15
|
-
}
|
|
16
|
-
export declare const DEFAULT_API_VERSION = API_VERSION.EMPTY;
|
|
17
|
-
export declare abstract class EntitiesClientGetOptions {
|
|
18
|
-
entityName?: string;
|
|
19
|
-
id?: string;
|
|
20
|
-
reference?: string;
|
|
21
|
-
federatedId?: string;
|
|
22
|
-
federatedIds?: string[];
|
|
23
|
-
relation?: string;
|
|
24
|
-
relations?: Array<string>;
|
|
25
|
-
criteria?: {
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
};
|
|
28
|
-
cacheMode?: string;
|
|
29
|
-
search?: string;
|
|
30
|
-
useSearch?: boolean;
|
|
31
|
-
order?: SortOption[];
|
|
32
|
-
skip?: number;
|
|
33
|
-
take?: number;
|
|
34
|
-
paginate?: boolean;
|
|
35
|
-
nextPageKey?: string;
|
|
36
|
-
apiVersion?: API_VERSION;
|
|
37
|
-
suffix?: string;
|
|
38
|
-
skipHydrateRelationships?: boolean;
|
|
39
|
-
customParams?: Record<string, string | number | boolean>;
|
|
40
|
-
}
|
|
41
|
-
export declare abstract class EntitiesClientCreateOptions {
|
|
42
|
-
entityName: string;
|
|
43
|
-
object: any;
|
|
44
|
-
id?: string;
|
|
45
|
-
relation?: string;
|
|
46
|
-
apiVersion?: API_VERSION;
|
|
47
|
-
suffix?: string;
|
|
48
|
-
skipHydrateRelationships?: boolean;
|
|
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
|
-
skipHydrateRelationships?: boolean;
|
|
66
|
-
}
|
|
67
|
-
export declare abstract class EntitiesClientBatchUpdateOptions {
|
|
68
|
-
entityName: string;
|
|
69
|
-
objects: any[];
|
|
70
|
-
apiVersion?: API_VERSION;
|
|
71
|
-
suffix?: string;
|
|
72
|
-
}
|
|
73
|
-
export declare abstract class EntitiesClientDeleteOptions {
|
|
74
|
-
entityName?: string;
|
|
75
|
-
id?: string;
|
|
76
|
-
reference?: string;
|
|
77
|
-
relation?: string;
|
|
78
|
-
relationId?: string;
|
|
79
|
-
apiVersion?: API_VERSION;
|
|
80
|
-
suffix?: string;
|
|
81
|
-
}
|
|
82
|
-
export declare abstract class EntitiesClientBatchDeleteOptions {
|
|
83
|
-
entityName?: string;
|
|
84
|
-
ids?: string[];
|
|
85
|
-
apiVersion?: API_VERSION;
|
|
86
|
-
suffix?: string;
|
|
87
|
-
}
|
|
88
|
-
export declare class Entities implements AbstractEntitiesClient {
|
|
89
|
-
private ctx?;
|
|
90
|
-
private apiVersion;
|
|
91
|
-
constructor(ctx?: any, apiVersion?: API_VERSION);
|
|
92
|
-
getAllReferences(references: Array<EntityReference>, relations: Array<string>): Promise<Map<string, any>>;
|
|
93
|
-
get(options: EntitiesClientGetOptions): Promise<any | any[]>;
|
|
94
|
-
create(options: EntitiesClientCreateOptions): Promise<any>;
|
|
95
|
-
batchCreate(options: EntitiesClientBatchCreateOptions): Promise<any>;
|
|
96
|
-
update(options: EntitiesClientUpdateOptions): Promise<any>;
|
|
97
|
-
batchUpdate(options: EntitiesClientBatchUpdateOptions): Promise<any>;
|
|
98
|
-
delete(options: EntitiesClientDeleteOptions): Promise<any>;
|
|
99
|
-
batchDelete(options: EntitiesClientBatchDeleteOptions): Promise<any>;
|
|
100
|
-
}
|
|
101
|
-
export {};
|