@or-sdk/deployments 1.2.1 → 1.2.2-beta.557.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/README.md +1 -1
- package/dist/cjs/Deployments.js +57 -126
- package/dist/cjs/Deployments.js.map +1 -1
- package/dist/cjs/constants.js +3 -15
- package/dist/cjs/constants.js.map +1 -1
- package/dist/esm/Deployments.js +39 -99
- package/dist/esm/Deployments.js.map +1 -1
- package/dist/esm/constants.js +1 -57
- package/dist/esm/constants.js.map +1 -1
- package/dist/types/Deployments.d.ts +6 -6
- package/dist/types/Deployments.d.ts.map +1 -1
- package/dist/types/constants.d.ts +1 -7
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/types.d.ts +17 -3
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/Deployments.ts +50 -144
- package/src/constants.ts +1 -63
- package/src/types.ts +21 -4
- package/dist/cjs/utils/getDeleteQuery.js +0 -12
- package/dist/cjs/utils/getDeleteQuery.js.map +0 -1
- package/dist/cjs/utils/getGetQuery.js +0 -12
- package/dist/cjs/utils/getGetQuery.js.map +0 -1
- package/dist/cjs/utils/getListQuery.js +0 -12
- package/dist/cjs/utils/getListQuery.js.map +0 -1
- package/dist/cjs/utils/index.js +0 -13
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/esm/utils/getDeleteQuery.js +0 -17
- package/dist/esm/utils/getDeleteQuery.js.map +0 -1
- package/dist/esm/utils/getGetQuery.js +0 -20
- package/dist/esm/utils/getGetQuery.js.map +0 -1
- package/dist/esm/utils/getListQuery.js +0 -25
- package/dist/esm/utils/getListQuery.js.map +0 -1
- package/dist/esm/utils/index.js +0 -4
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/types/utils/getDeleteQuery.d.ts +0 -6
- package/dist/types/utils/getDeleteQuery.d.ts.map +0 -1
- package/dist/types/utils/getGetQuery.d.ts +0 -6
- package/dist/types/utils/getGetQuery.d.ts.map +0 -1
- package/dist/types/utils/getListQuery.d.ts +0 -6
- package/dist/types/utils/getListQuery.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/index.d.ts.map +0 -1
- package/src/utils/getDeleteQuery.ts +0 -18
- package/src/utils/getGetQuery.ts +0 -21
- package/src/utils/getListQuery.ts +0 -26
- package/src/utils/index.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployments.d.ts","sourceRoot":"","sources":["../../src/Deployments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"Deployments.d.ts","sourceRoot":"","sources":["../../src/Deployments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEvH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;gBAE5B,MAAM,EAAE,iBAAiB;IAiBxB,eAAe,CAAC,MAAM,GAAE,qBAA0B,EAAE,iBAAiB,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAoBzH,qBAAqB,CAAC,UAAU,GAAE,MAAM,EAAO,EAAE,iBAAiB,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAetH,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAe3F,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAgBjG,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAe7F,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAgBnG,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE,mBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC;IAiBhF,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAkBjD,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAUvD,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAwBzD,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAcvE"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export declare const DEFAULT_PROJECTION_LIST: string[];
|
|
3
|
-
export declare const QUERY_CREATE = "mutation create($entity: EntityType!, $data: CreateInput!) {\n create(entity: $entity, data: $data) {\n ... on Deployment {\n id\n data\n botId\n flowId\n dateDeactivated\n }\n }\n}\n";
|
|
4
|
-
export declare const QUERY_CREATE_CROSSACCOUNT = "mutation createCrossAccount($entity: EntityType!, $data: CreateInput!, $accountId: String!) {\n createCrossAccount(entity: $entity, data: $data, accountId: $accountId) {\n ... on Deployment {\n id\n data\n botId\n flowId\n dateDeactivated\n }\n }\n}\n";
|
|
5
|
-
export declare const QUERY_UPDATE = "mutation update($entity: EntityType!, $data: UpdateInput!) {\n update(entity: $entity, data: $data) {\n ... on Deployment {\n id\n data\n botId\n flowId\n dateDeactivated\n }\n }\n}\n";
|
|
6
|
-
export declare const QUERY_UPDATE_CROSSACCOUNT = "mutation updateCrossAccount($entity: EntityType!, $data: UpdateInput!, $accountId: String!) {\n updateCrossAccount(entity: $entity, data: $data, accountId: $accountId) {\n ... on Deployment {\n id\n data\n botId\n flowId\n dateDeactivated\n }\n }\n}\n";
|
|
7
|
-
export declare const ENTITY_NAME = "DEPLOYMENT";
|
|
1
|
+
export { DATA_HUB_SVC_SERVICE_KEY } from '@or-sdk/data-hub-svc';
|
|
8
2
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare type DeploymentsConfig = {
|
|
|
3
3
|
token: Token;
|
|
4
4
|
discoveryUrl?: string;
|
|
5
5
|
accountId?: string;
|
|
6
|
-
|
|
6
|
+
dataHubSvcUrl?: string;
|
|
7
7
|
};
|
|
8
8
|
export declare type Trigger = {
|
|
9
9
|
processed?: boolean;
|
|
@@ -50,14 +50,28 @@ export declare type Deployment = {
|
|
|
50
50
|
flowId: string;
|
|
51
51
|
dateDeactivated: number;
|
|
52
52
|
};
|
|
53
|
+
export declare type Projection = string[];
|
|
53
54
|
export declare type ListDeploymentsParams = {
|
|
54
|
-
query
|
|
55
|
+
query?: {
|
|
55
56
|
id?: string | string[];
|
|
56
57
|
dateDeactivated?: number;
|
|
57
58
|
botId?: string;
|
|
58
59
|
flowId?: string;
|
|
59
60
|
[key: string]: unknown;
|
|
60
61
|
};
|
|
61
|
-
projection
|
|
62
|
+
projection?: Projection;
|
|
63
|
+
group?: string[];
|
|
64
|
+
sandbox?: boolean;
|
|
62
65
|
};
|
|
66
|
+
export declare type PaginationOptions = {
|
|
67
|
+
limit?: number;
|
|
68
|
+
offset?: number;
|
|
69
|
+
};
|
|
70
|
+
export declare type GetDeploymentParams = {
|
|
71
|
+
query?: {
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
};
|
|
74
|
+
projection?: Projection;
|
|
75
|
+
sandbox?: boolean;
|
|
76
|
+
} | Projection;
|
|
63
77
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,oBAAY,iBAAiB,GAAG;IAI9B,KAAK,EAAE,KAAK,CAAC;IAKb,YAAY,CAAC,EAAE,MAAM,CAAC;IAKtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,oBAAY,iBAAiB,GAAG;IAI9B,KAAK,EAAE,KAAK,CAAC;IAKb,YAAY,CAAC,EAAE,MAAM,CAAC;IAKtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,oBAAY,OAAO,GAAG;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE;YACN,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,WAAW,CAAC,EAAE,OAAO,CAAC;YACtB,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;QACF,OAAO,CAAC,EAAE;YACR,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;QACF,KAAK,CAAC,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;QACF,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,SAAS,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,oBAAoB,EAAE,MAAM,CAAC;QAC7B,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,oBAAY,UAAU,GAAG,MAAM,EAAE,CAAC;AAElC,oBAAY,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE;QACN,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/deployments",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2-beta.557.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@or-sdk/base": "^0.26.3",
|
|
21
|
-
"@or-sdk/data-hub": "^
|
|
21
|
+
"@or-sdk/data-hub-svc": "^1.1.6-beta.557.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"concurrently": "^6.4.0",
|
|
@@ -26,6 +26,5 @@
|
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
|
-
}
|
|
30
|
-
"gitHead": "602563a1b681a196a8eb625896a44faa3359b6f5"
|
|
29
|
+
}
|
|
31
30
|
}
|
package/src/Deployments.ts
CHANGED
|
@@ -1,32 +1,18 @@
|
|
|
1
|
-
import { List } from '@or-sdk/base';
|
|
2
|
-
import {
|
|
3
|
-
import { DeploymentsConfig, Deployment, ListDeploymentsParams } from './types';
|
|
4
|
-
import {
|
|
5
|
-
ENTITY_NAME,
|
|
6
|
-
QUERY_CREATE,
|
|
7
|
-
QUERY_CREATE_CROSSACCOUNT,
|
|
8
|
-
QUERY_UPDATE,
|
|
9
|
-
QUERY_UPDATE_CROSSACCOUNT,
|
|
10
|
-
} from './constants';
|
|
11
|
-
import { getGetQuery, getListQuery, getDeleteQuery } from './utils';
|
|
1
|
+
import { List, makeList } from '@or-sdk/base';
|
|
2
|
+
import { DataHubSvc, setDiff } from '@or-sdk/data-hub-svc';
|
|
3
|
+
import { DeploymentsConfig, Deployment, ListDeploymentsParams, PaginationOptions, GetDeploymentParams } from './types';
|
|
12
4
|
|
|
13
5
|
export class Deployments {
|
|
14
|
-
private readonly
|
|
6
|
+
private readonly dataHubSvc: DataHubSvc;
|
|
15
7
|
|
|
16
|
-
/**
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { Deployments } from '@or-sdk/deployments'
|
|
19
|
-
* const deployments = new Deployments({token: 'my-account-token-string', discoveryUrl: 'http://example.deployments/endpoint'});
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
8
|
constructor(params: DeploymentsConfig) {
|
|
23
|
-
const { token, discoveryUrl, accountId,
|
|
9
|
+
const { token, discoveryUrl, accountId, dataHubSvcUrl } = params;
|
|
24
10
|
|
|
25
|
-
this.
|
|
11
|
+
this.dataHubSvc = new DataHubSvc({
|
|
26
12
|
token,
|
|
27
13
|
discoveryUrl,
|
|
28
14
|
accountId,
|
|
29
|
-
|
|
15
|
+
dataHubSvcUrl,
|
|
30
16
|
});
|
|
31
17
|
}
|
|
32
18
|
|
|
@@ -36,38 +22,18 @@ export class Deployments {
|
|
|
36
22
|
* const result = await deployments.listDeployments();
|
|
37
23
|
* ```
|
|
38
24
|
*/
|
|
39
|
-
public async listDeployments(
|
|
40
|
-
const
|
|
41
|
-
|
|
25
|
+
public async listDeployments(params: ListDeploymentsParams = {}, paginationOptions: PaginationOptions = {}): Promise<List<Deployment>> {
|
|
26
|
+
const result = await this.dataHubSvc.makeRequest<Deployment[]>({
|
|
27
|
+
method: 'GET',
|
|
28
|
+
route: 'deployments',
|
|
42
29
|
params: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
query.id.split(',') :
|
|
47
|
-
undefined,
|
|
48
|
-
queryParams: Array.isArray(query.id) ?
|
|
49
|
-
{
|
|
50
|
-
...query,
|
|
51
|
-
id: query.id.join(','),
|
|
52
|
-
} :
|
|
53
|
-
query,
|
|
54
|
-
limit: 30,
|
|
30
|
+
...params,
|
|
31
|
+
...paginationOptions,
|
|
32
|
+
... this.dataHubSvc.isCrossAccount ? { accountId: this.dataHubSvc.currentAccountId } : {},
|
|
55
33
|
},
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const operationName = this.dataHub.getOperationName(OperationNames.LIST);
|
|
60
|
-
|
|
61
|
-
const data = {
|
|
62
|
-
operationName,
|
|
63
|
-
query: getListQuery({
|
|
64
|
-
crossAccount: this.dataHub.isCrossAccount,
|
|
65
|
-
projection,
|
|
66
|
-
}),
|
|
67
|
-
variables,
|
|
68
|
-
};
|
|
34
|
+
});
|
|
69
35
|
|
|
70
|
-
return
|
|
36
|
+
return makeList<Deployment>(result);
|
|
71
37
|
}
|
|
72
38
|
|
|
73
39
|
/**
|
|
@@ -76,13 +42,13 @@ export class Deployments {
|
|
|
76
42
|
* const result = await deployments.listActiveDeployments();
|
|
77
43
|
* ```
|
|
78
44
|
*/
|
|
79
|
-
public async listActiveDeployments(projection: string[] = []): Promise<List<Deployment>> {
|
|
45
|
+
public async listActiveDeployments(projection: string[] = [], paginationOptions: PaginationOptions = {}): Promise<List<Deployment>> {
|
|
80
46
|
return this.listDeployments({
|
|
81
47
|
query: {
|
|
82
48
|
dateDeactivated: 0,
|
|
83
49
|
},
|
|
84
50
|
projection,
|
|
85
|
-
});
|
|
51
|
+
}, paginationOptions);
|
|
86
52
|
}
|
|
87
53
|
|
|
88
54
|
/**
|
|
@@ -153,33 +119,15 @@ export class Deployments {
|
|
|
153
119
|
* const result = await deployments.getDeployment('deployment-id');
|
|
154
120
|
* ```
|
|
155
121
|
*/
|
|
156
|
-
public async getDeployment(
|
|
157
|
-
|
|
158
|
-
|
|
122
|
+
public async getDeployment(id: string, params: GetDeploymentParams = {}): Promise<Deployment> {
|
|
123
|
+
return this.dataHubSvc.makeRequest<Deployment>({
|
|
124
|
+
method: 'GET',
|
|
125
|
+
route: `deployments/${id}`,
|
|
159
126
|
params: {
|
|
160
|
-
|
|
127
|
+
... Array.isArray(params) ? { projection: params } : params,
|
|
128
|
+
... this.dataHubSvc.isCrossAccount ? { accountId: this.dataHubSvc.currentAccountId } : {},
|
|
161
129
|
},
|
|
162
|
-
... this.dataHub.isCrossAccount ? { accountId: this.dataHub.currentAccountId } : {},
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const operationName = this.dataHub.getOperationName(OperationNames.GET);
|
|
166
|
-
|
|
167
|
-
const data = {
|
|
168
|
-
operationName,
|
|
169
|
-
query: getGetQuery({
|
|
170
|
-
crossAccount: this.dataHub.isCrossAccount,
|
|
171
|
-
projection,
|
|
172
|
-
}),
|
|
173
|
-
variables,
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const result = await this.dataHub.makeRequest<GraphqlResponse<Deployment>>({
|
|
177
|
-
method: 'POST',
|
|
178
|
-
route: '/graphql',
|
|
179
|
-
data,
|
|
180
130
|
});
|
|
181
|
-
|
|
182
|
-
return result.data[operationName] as Deployment;
|
|
183
131
|
}
|
|
184
132
|
|
|
185
133
|
/**
|
|
@@ -188,36 +136,14 @@ export class Deployments {
|
|
|
188
136
|
* const result = await deployments.deleteDeployment('deployment-id');
|
|
189
137
|
* ```
|
|
190
138
|
*/
|
|
191
|
-
public async deleteDeployment(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
entity: ENTITY_NAME,
|
|
198
|
-
data: {
|
|
199
|
-
id: deploymentId,
|
|
139
|
+
public async deleteDeployment(id: string): Promise<Deployment> {
|
|
140
|
+
return this.dataHubSvc.makeRequest<Deployment>({
|
|
141
|
+
method: 'DELETE',
|
|
142
|
+
route: `deployments/${id}`,
|
|
143
|
+
params: {
|
|
144
|
+
... this.dataHubSvc.isCrossAccount ? { accountId: this.dataHubSvc.currentAccountId } : {},
|
|
200
145
|
},
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
const operationName = this.dataHub.getOperationName(OperationNames.DELETE);
|
|
204
|
-
|
|
205
|
-
const data = {
|
|
206
|
-
operationName,
|
|
207
|
-
query: getDeleteQuery({
|
|
208
|
-
crossAccount: this.dataHub.isCrossAccount,
|
|
209
|
-
projection,
|
|
210
|
-
}),
|
|
211
|
-
variables,
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
const result = await this.dataHub.makeRequest<GraphqlResponse<Deployment>>({
|
|
215
|
-
method: 'POST',
|
|
216
|
-
route: '/graphql',
|
|
217
|
-
data,
|
|
218
146
|
});
|
|
219
|
-
|
|
220
|
-
return result.data[operationName] as Deployment;
|
|
221
147
|
}
|
|
222
148
|
|
|
223
149
|
/**
|
|
@@ -229,7 +155,7 @@ export class Deployments {
|
|
|
229
155
|
* ```
|
|
230
156
|
*/
|
|
231
157
|
public async saveDeployment(source: Deployment): Promise<Deployment> {
|
|
232
|
-
return source.id ? this.updateDeployment(source) : this.createDeployment(source);
|
|
158
|
+
return (source.id && source.id !== 'new') ? this.updateDeployment(source) : this.createDeployment(source);
|
|
233
159
|
}
|
|
234
160
|
|
|
235
161
|
/**
|
|
@@ -239,29 +165,21 @@ export class Deployments {
|
|
|
239
165
|
* ```
|
|
240
166
|
*/
|
|
241
167
|
public async createDeployment(source: Deployment): Promise<Deployment> {
|
|
242
|
-
const
|
|
243
|
-
|
|
168
|
+
const result = await this.dataHubSvc.makeRequest<{ id: string; }>({
|
|
169
|
+
method: 'POST',
|
|
170
|
+
route: 'deployments/new',
|
|
244
171
|
data: {
|
|
245
|
-
|
|
172
|
+
deployment: {
|
|
173
|
+
...source,
|
|
174
|
+
id: 'new', //TODO: remove later
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
params: {
|
|
178
|
+
... this.dataHubSvc.isCrossAccount ? { accountId: this.dataHubSvc.currentAccountId } : {},
|
|
246
179
|
},
|
|
247
|
-
... this.dataHub.isCrossAccount ? { accountId: this.dataHub.currentAccountId } : {},
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
const operationName = this.dataHub.getOperationName(OperationNames.CREATE);
|
|
251
|
-
|
|
252
|
-
const data = {
|
|
253
|
-
operationName,
|
|
254
|
-
query: this.dataHub.isCrossAccount ? QUERY_CREATE_CROSSACCOUNT : QUERY_CREATE,
|
|
255
|
-
variables,
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
const result = await this.dataHub.makeRequest<GraphqlResponse<Deployment>>({
|
|
259
|
-
method: 'POST',
|
|
260
|
-
route: '/graphql',
|
|
261
|
-
data,
|
|
262
180
|
});
|
|
263
181
|
|
|
264
|
-
return result
|
|
182
|
+
return setDiff<Deployment>(source, result);
|
|
265
183
|
}
|
|
266
184
|
|
|
267
185
|
/**
|
|
@@ -271,29 +189,17 @@ export class Deployments {
|
|
|
271
189
|
* ```
|
|
272
190
|
*/
|
|
273
191
|
public async updateDeployment(source: Deployment): Promise<Deployment> {
|
|
274
|
-
const
|
|
275
|
-
|
|
192
|
+
const result = await this.dataHubSvc.makeRequest<{ id: string; }>({
|
|
193
|
+
method: 'POST',
|
|
194
|
+
route: `deployments/${source.id}`,
|
|
276
195
|
data: {
|
|
277
|
-
|
|
278
|
-
|
|
196
|
+
deployment: source,
|
|
197
|
+
},
|
|
198
|
+
params: {
|
|
199
|
+
... this.dataHubSvc.isCrossAccount ? { accountId: this.dataHubSvc.currentAccountId } : {},
|
|
279
200
|
},
|
|
280
|
-
... this.dataHub.isCrossAccount ? { accountId: this.dataHub.currentAccountId } : {},
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
const operationName = this.dataHub.getOperationName(OperationNames.UPDATE);
|
|
284
|
-
|
|
285
|
-
const data = {
|
|
286
|
-
operationName,
|
|
287
|
-
query: this.dataHub.isCrossAccount ? QUERY_UPDATE_CROSSACCOUNT : QUERY_UPDATE,
|
|
288
|
-
variables,
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
const result = await this.dataHub.makeRequest<GraphqlResponse<Deployment>>({
|
|
292
|
-
method: 'POST',
|
|
293
|
-
route: '/graphql',
|
|
294
|
-
data,
|
|
295
201
|
});
|
|
296
202
|
|
|
297
|
-
return result
|
|
203
|
+
return setDiff<Deployment>(source, result);
|
|
298
204
|
}
|
|
299
205
|
}
|
package/src/constants.ts
CHANGED
|
@@ -1,63 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
export const DEFAULT_PROJECTION_LIST = [
|
|
4
|
-
'id',
|
|
5
|
-
'data',
|
|
6
|
-
'botId',
|
|
7
|
-
'flowId',
|
|
8
|
-
'dateDeactivated',
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
export const QUERY_CREATE = `mutation create($entity: EntityType!, $data: CreateInput!) {
|
|
12
|
-
create(entity: $entity, data: $data) {
|
|
13
|
-
... on Deployment {
|
|
14
|
-
id
|
|
15
|
-
data
|
|
16
|
-
botId
|
|
17
|
-
flowId
|
|
18
|
-
dateDeactivated
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
export const QUERY_CREATE_CROSSACCOUNT = `mutation createCrossAccount($entity: EntityType!, $data: CreateInput!, $accountId: String!) {
|
|
25
|
-
createCrossAccount(entity: $entity, data: $data, accountId: $accountId) {
|
|
26
|
-
... on Deployment {
|
|
27
|
-
id
|
|
28
|
-
data
|
|
29
|
-
botId
|
|
30
|
-
flowId
|
|
31
|
-
dateDeactivated
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
export const QUERY_UPDATE = `mutation update($entity: EntityType!, $data: UpdateInput!) {
|
|
38
|
-
update(entity: $entity, data: $data) {
|
|
39
|
-
... on Deployment {
|
|
40
|
-
id
|
|
41
|
-
data
|
|
42
|
-
botId
|
|
43
|
-
flowId
|
|
44
|
-
dateDeactivated
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
|
|
50
|
-
export const QUERY_UPDATE_CROSSACCOUNT = `mutation updateCrossAccount($entity: EntityType!, $data: UpdateInput!, $accountId: String!) {
|
|
51
|
-
updateCrossAccount(entity: $entity, data: $data, accountId: $accountId) {
|
|
52
|
-
... on Deployment {
|
|
53
|
-
id
|
|
54
|
-
data
|
|
55
|
-
botId
|
|
56
|
-
flowId
|
|
57
|
-
dateDeactivated
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
export const ENTITY_NAME = 'DEPLOYMENT';
|
|
1
|
+
export { DATA_HUB_SVC_SERVICE_KEY } from '@or-sdk/data-hub-svc';
|
package/src/types.ts
CHANGED
|
@@ -17,9 +17,9 @@ export type DeploymentsConfig = {
|
|
|
17
17
|
accountId?: string;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Url of OneReach
|
|
20
|
+
* Url of OneReach DataHubSvc api
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
dataHubSvcUrl?: string;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export type Trigger = {
|
|
@@ -69,13 +69,30 @@ export type Deployment = {
|
|
|
69
69
|
dateDeactivated: number;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
+
export type Projection = string[];
|
|
73
|
+
|
|
72
74
|
export type ListDeploymentsParams = {
|
|
73
|
-
query
|
|
75
|
+
query?: {
|
|
74
76
|
id?: string | string[];
|
|
75
77
|
dateDeactivated?: number;
|
|
76
78
|
botId?: string;
|
|
77
79
|
flowId?: string;
|
|
78
80
|
[key: string]: unknown;
|
|
79
81
|
};
|
|
80
|
-
projection
|
|
82
|
+
projection?: Projection;
|
|
83
|
+
group?: string[];
|
|
84
|
+
sandbox?: boolean;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export type PaginationOptions = {
|
|
88
|
+
limit?: number;
|
|
89
|
+
offset?: number;
|
|
81
90
|
};
|
|
91
|
+
|
|
92
|
+
export type GetDeploymentParams = {
|
|
93
|
+
query?: {
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
};
|
|
96
|
+
projection?: Projection;
|
|
97
|
+
sandbox?: boolean;
|
|
98
|
+
} | Projection;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var data_hub_1 = require("@or-sdk/data-hub");
|
|
4
|
-
var constants_1 = require("../constants");
|
|
5
|
-
function getDeleteQuery(_a) {
|
|
6
|
-
var _b = _a.projection, projection = _b === void 0 ? [] : _b, _c = _a.crossAccount, crossAccount = _c === void 0 ? false : _c;
|
|
7
|
-
return crossAccount ?
|
|
8
|
-
"query getCrossAccount($entity: EntityType!, $params: GetInput!, $accountId: String!) {\n getCrossAccount(entity: $entity, params: $params, accountId: $accountId)\n}" :
|
|
9
|
-
"mutation delete($entity: EntityType!, $data: DeleteInput!) {\n delete(entity: $entity, data: $data) {\n ... on Deployment {".concat((0, data_hub_1.getQueryProjectionPart)(projection.length ? projection : constants_1.DEFAULT_PROJECTION_LIST), "\n }\n }\n}\n");
|
|
10
|
-
}
|
|
11
|
-
exports.default = getDeleteQuery;
|
|
12
|
-
//# sourceMappingURL=getDeleteQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDeleteQuery.js","sourceRoot":"","sources":["../../../src/utils/getDeleteQuery.ts"],"names":[],"mappings":";;AAAA,6CAA0D;AAC1D,0CAAuD;AAEvD,SAAS,cAAc,CAAC,EAAyF;QAAvF,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA,EAAE,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA;IAC7D,OAAO,YAAY,CAAC,CAAC;QACnB,uKAEF,CAAC,CAAC;QACA,yIAEqB,IAAA,iCAAsB,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mCAAuB,CAAC,sBAIxG,CAAC;AACF,CAAC;AAED,kBAAe,cAAc,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var data_hub_1 = require("@or-sdk/data-hub");
|
|
4
|
-
var constants_1 = require("../constants");
|
|
5
|
-
function getGetQuery(_a) {
|
|
6
|
-
var _b = _a.projection, projection = _b === void 0 ? [] : _b, _c = _a.crossAccount, crossAccount = _c === void 0 ? false : _c;
|
|
7
|
-
return crossAccount ?
|
|
8
|
-
"query getCrossAccount($entity: EntityType!, $params: GetInput!, $accountId: String!) {\n getCrossAccount(entity: $entity, params: $params, accountId: $accountId) {\n ... on Deployment {".concat((0, data_hub_1.getQueryProjectionPart)(projection.length ? projection : constants_1.DEFAULT_PROJECTION_LIST), "\n }\n }\n}") :
|
|
9
|
-
"query get($entity: EntityType!, $params: GetInput!) {\n get(entity: $entity, params: $params) {\n ... on Deployment {".concat((0, data_hub_1.getQueryProjectionPart)(projection.length ? projection : constants_1.DEFAULT_PROJECTION_LIST), "\n }\n }\n}\n");
|
|
10
|
-
}
|
|
11
|
-
exports.default = getGetQuery;
|
|
12
|
-
//# sourceMappingURL=getGetQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getGetQuery.js","sourceRoot":"","sources":["../../../src/utils/getGetQuery.ts"],"names":[],"mappings":";;AAAA,6CAA0D;AAC1D,0CAAuD;AAEvD,SAAS,WAAW,CAAC,EAAyF;QAAvF,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA,EAAE,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA;IAC1D,OAAO,YAAY,CAAC,CAAC;QACnB,uMAEqB,IAAA,iCAAsB,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mCAAuB,CAAC,oBAGvG,CAAC,CAAC;QACA,mIAEqB,IAAA,iCAAsB,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mCAAuB,CAAC,sBAIxG,CAAC;AACF,CAAC;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var data_hub_1 = require("@or-sdk/data-hub");
|
|
4
|
-
var constants_1 = require("../constants");
|
|
5
|
-
function getListQuery(_a) {
|
|
6
|
-
var _b = _a.projection, projection = _b === void 0 ? [] : _b, _c = _a.crossAccount, crossAccount = _c === void 0 ? false : _c;
|
|
7
|
-
return crossAccount ?
|
|
8
|
-
"query listCrossAccount($entity: EntityType!, $params: ListInput!, $accountId: String!) {\n listCrossAccount(entity: $entity, params: $params, accountId: $accountId) {\n records {\n ... on Deployment {".concat((0, data_hub_1.getQueryProjectionPart)(projection.length ? projection : constants_1.DEFAULT_PROJECTION_LIST), "\n }\n }\n last\n }\n}") :
|
|
9
|
-
"query list($entity: EntityType!, $params: ListInput!, $sandbox: Boolean) {\n list(entity: $entity, params: $params, sandbox: $sandbox) {\n records {\n ... on Deployment {".concat((0, data_hub_1.getQueryProjectionPart)(projection.length ? projection : constants_1.DEFAULT_PROJECTION_LIST), "\n }\n }\n last\n }\n}");
|
|
10
|
-
}
|
|
11
|
-
exports.default = getListQuery;
|
|
12
|
-
//# sourceMappingURL=getListQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getListQuery.js","sourceRoot":"","sources":["../../../src/utils/getListQuery.ts"],"names":[],"mappings":";;AAAA,6CAA0D;AAC1D,0CAAuD;AAEvD,SAAS,YAAY,CAAC,EAAyF;QAAvF,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA,EAAE,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA;IAC3D,OAAO,YAAY,CAAC,CAAC;QACnB,2NAGuB,IAAA,iCAAsB,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mCAAuB,CAAC,uCAKzG,CAAC,CAAC;QACA,6LAGuB,IAAA,iCAAsB,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mCAAuB,CAAC,uCAKzG,CAAC;AACH,CAAC;AAED,kBAAe,YAAY,CAAC"}
|
package/dist/cjs/utils/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getDeleteQuery = exports.getGetQuery = exports.getListQuery = void 0;
|
|
7
|
-
var getListQuery_1 = require("./getListQuery");
|
|
8
|
-
Object.defineProperty(exports, "getListQuery", { enumerable: true, get: function () { return __importDefault(getListQuery_1).default; } });
|
|
9
|
-
var getGetQuery_1 = require("./getGetQuery");
|
|
10
|
-
Object.defineProperty(exports, "getGetQuery", { enumerable: true, get: function () { return __importDefault(getGetQuery_1).default; } });
|
|
11
|
-
var getDeleteQuery_1 = require("./getDeleteQuery");
|
|
12
|
-
Object.defineProperty(exports, "getDeleteQuery", { enumerable: true, get: function () { return __importDefault(getDeleteQuery_1).default; } });
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;AAIA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,mDAA6D;AAApD,iIAAA,OAAO,OAAkB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getQueryProjectionPart } from '@or-sdk/data-hub';
|
|
2
|
-
import { DEFAULT_PROJECTION_LIST } from '../constants';
|
|
3
|
-
function getDeleteQuery({ projection = [], crossAccount = false }) {
|
|
4
|
-
return crossAccount ?
|
|
5
|
-
`query getCrossAccount($entity: EntityType!, $params: GetInput!, $accountId: String!) {
|
|
6
|
-
getCrossAccount(entity: $entity, params: $params, accountId: $accountId)
|
|
7
|
-
}` :
|
|
8
|
-
`mutation delete($entity: EntityType!, $data: DeleteInput!) {
|
|
9
|
-
delete(entity: $entity, data: $data) {
|
|
10
|
-
... on Deployment {${getQueryProjectionPart(projection.length ? projection : DEFAULT_PROJECTION_LIST)}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
`;
|
|
15
|
-
}
|
|
16
|
-
export default getDeleteQuery;
|
|
17
|
-
//# sourceMappingURL=getDeleteQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDeleteQuery.js","sourceRoot":"","sources":["../../../src/utils/getDeleteQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,SAAS,cAAc,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,YAAY,GAAG,KAAK,EAAkD;IAC/G,OAAO,YAAY,CAAC,CAAC;QACnB;;EAEF,CAAC,CAAC;QACA;;yBAEqB,sBAAsB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAuB,CAAC;;;;CAIxG,CAAC;AACF,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { getQueryProjectionPart } from '@or-sdk/data-hub';
|
|
2
|
-
import { DEFAULT_PROJECTION_LIST } from '../constants';
|
|
3
|
-
function getGetQuery({ projection = [], crossAccount = false }) {
|
|
4
|
-
return crossAccount ?
|
|
5
|
-
`query getCrossAccount($entity: EntityType!, $params: GetInput!, $accountId: String!) {
|
|
6
|
-
getCrossAccount(entity: $entity, params: $params, accountId: $accountId) {
|
|
7
|
-
... on Deployment {${getQueryProjectionPart(projection.length ? projection : DEFAULT_PROJECTION_LIST)}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}` :
|
|
11
|
-
`query get($entity: EntityType!, $params: GetInput!) {
|
|
12
|
-
get(entity: $entity, params: $params) {
|
|
13
|
-
... on Deployment {${getQueryProjectionPart(projection.length ? projection : DEFAULT_PROJECTION_LIST)}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
}
|
|
19
|
-
export default getGetQuery;
|
|
20
|
-
//# sourceMappingURL=getGetQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getGetQuery.js","sourceRoot":"","sources":["../../../src/utils/getGetQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,SAAS,WAAW,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,YAAY,GAAG,KAAK,EAAkD;IAC5G,OAAO,YAAY,CAAC,CAAC;QACnB;;yBAEqB,sBAAsB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAuB,CAAC;;;EAGvG,CAAC,CAAC;QACA;;yBAEqB,sBAAsB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAuB,CAAC;;;;CAIxG,CAAC;AACF,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { getQueryProjectionPart } from '@or-sdk/data-hub';
|
|
2
|
-
import { DEFAULT_PROJECTION_LIST } from '../constants';
|
|
3
|
-
function getListQuery({ projection = [], crossAccount = false }) {
|
|
4
|
-
return crossAccount ?
|
|
5
|
-
`query listCrossAccount($entity: EntityType!, $params: ListInput!, $accountId: String!) {
|
|
6
|
-
listCrossAccount(entity: $entity, params: $params, accountId: $accountId) {
|
|
7
|
-
records {
|
|
8
|
-
... on Deployment {${getQueryProjectionPart(projection.length ? projection : DEFAULT_PROJECTION_LIST)}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
last
|
|
12
|
-
}
|
|
13
|
-
}` :
|
|
14
|
-
`query list($entity: EntityType!, $params: ListInput!, $sandbox: Boolean) {
|
|
15
|
-
list(entity: $entity, params: $params, sandbox: $sandbox) {
|
|
16
|
-
records {
|
|
17
|
-
... on Deployment {${getQueryProjectionPart(projection.length ? projection : DEFAULT_PROJECTION_LIST)}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
last
|
|
21
|
-
}
|
|
22
|
-
}`;
|
|
23
|
-
}
|
|
24
|
-
export default getListQuery;
|
|
25
|
-
//# sourceMappingURL=getListQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getListQuery.js","sourceRoot":"","sources":["../../../src/utils/getListQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,SAAS,YAAY,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,YAAY,GAAG,KAAK,EAAkD;IAC7G,OAAO,YAAY,CAAC,CAAC;QACnB;;;2BAGuB,sBAAsB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAuB,CAAC;;;;;EAKzG,CAAC,CAAC;QACA;;;2BAGuB,sBAAsB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAuB,CAAC;;;;;EAKzG,CAAC;AACH,CAAC;AAED,eAAe,YAAY,CAAC"}
|
package/dist/esm/utils/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|