@or-sdk/deployer 0.24.5-410.0 → 0.24.5-421.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/dist/cjs/Deployer.js +6 -134
- package/dist/cjs/Deployer.js.map +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/Deployer.js +1 -98
- package/dist/esm/Deployer.js.map +1 -1
- package/dist/types/Deployer.d.ts +1 -16
- package/dist/types/types.d.ts +0 -14
- package/package.json +3 -3
- package/src/Deployer.ts +5 -178
- package/src/types.ts +0 -8
package/dist/cjs/Deployer.js
CHANGED
|
@@ -14,17 +14,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
17
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
18
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
19
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -68,17 +57,14 @@ var constants_1 = require("./constants");
|
|
|
68
57
|
var Deployer = (function (_super) {
|
|
69
58
|
__extends(Deployer, _super);
|
|
70
59
|
function Deployer(params) {
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
_this = _super.call(this, {
|
|
60
|
+
var token = params.token, discoveryUrl = params.discoveryUrl, accountId = params.accountId, deployerUrl = params.deployerUrl;
|
|
61
|
+
return _super.call(this, {
|
|
74
62
|
token: token,
|
|
75
63
|
discoveryUrl: discoveryUrl,
|
|
76
64
|
serviceKey: constants_1.SERVICE_KEY,
|
|
77
65
|
accountId: accountId,
|
|
78
66
|
serviceUrl: deployerUrl,
|
|
79
67
|
}) || this;
|
|
80
|
-
_this.dataHub2Url = dataHub2Url;
|
|
81
|
-
return _this;
|
|
82
68
|
}
|
|
83
69
|
Deployer.prototype.removeRole = function () {
|
|
84
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -106,14 +92,14 @@ var Deployer = (function (_super) {
|
|
|
106
92
|
if (!id) {
|
|
107
93
|
throw new Error('Id is required');
|
|
108
94
|
}
|
|
109
|
-
flowAlias = "v-"
|
|
95
|
+
flowAlias = "v-".concat(Date.now());
|
|
110
96
|
data = {
|
|
111
97
|
flowId: id,
|
|
112
98
|
flowAlias: flowAlias,
|
|
113
99
|
interactiveDebug: interactiveDebug,
|
|
114
100
|
role: role,
|
|
115
101
|
};
|
|
116
|
-
route = (this.isCrossAccount ? "/accounts/"
|
|
102
|
+
route = "".concat(this.isCrossAccount ? "/accounts/".concat(this.currentAccountId) : '', "/flows/deploy");
|
|
117
103
|
return [4, this.callApi({
|
|
118
104
|
method: 'POST',
|
|
119
105
|
route: route,
|
|
@@ -145,7 +131,7 @@ var Deployer = (function (_super) {
|
|
|
145
131
|
role: role,
|
|
146
132
|
deleteLambda: deleteLambda,
|
|
147
133
|
};
|
|
148
|
-
route = (this.isCrossAccount ? "/accounts/"
|
|
134
|
+
route = "".concat(this.isCrossAccount ? "/accounts/".concat(this.currentAccountId) : '', "/flows/deploy");
|
|
149
135
|
return [4, this.callApi({
|
|
150
136
|
method: 'DELETE',
|
|
151
137
|
route: route,
|
|
@@ -165,7 +151,7 @@ var Deployer = (function (_super) {
|
|
|
165
151
|
switch (_a.label) {
|
|
166
152
|
case 0:
|
|
167
153
|
counter = 0;
|
|
168
|
-
route = (this.isCrossAccount ? "/accounts/"
|
|
154
|
+
route = "".concat(this.isCrossAccount ? "/accounts/".concat(this.currentAccountId) : '', "/flows/check/").concat(flowId, "/").concat(requestId);
|
|
169
155
|
_a.label = 1;
|
|
170
156
|
case 1:
|
|
171
157
|
counter++;
|
|
@@ -193,120 +179,6 @@ var Deployer = (function (_super) {
|
|
|
193
179
|
});
|
|
194
180
|
});
|
|
195
181
|
};
|
|
196
|
-
Deployer.prototype.deleteDeployment = function (deployment) {
|
|
197
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
198
|
-
return __generator(this, function (_a) {
|
|
199
|
-
return [2, this.callApiV2({
|
|
200
|
-
url: this.dataHub2Url,
|
|
201
|
-
route: "/deployments/" + deployment.id,
|
|
202
|
-
method: 'delete',
|
|
203
|
-
})];
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
Deployer.prototype.getDeploymentById = function (id, projection) {
|
|
208
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
209
|
-
return __generator(this, function (_a) {
|
|
210
|
-
return [2, this.callApiV2({
|
|
211
|
-
url: this.dataHub2Url,
|
|
212
|
-
route: "/deployments/" + id,
|
|
213
|
-
params: {
|
|
214
|
-
projection: projection,
|
|
215
|
-
},
|
|
216
|
-
method: 'get',
|
|
217
|
-
})];
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
Deployer.prototype.getDeployments = function (_a) {
|
|
222
|
-
var _b = _a.query, query = _b === void 0 ? {} : _b, projection = _a.projection;
|
|
223
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
224
|
-
return __generator(this, function (_c) {
|
|
225
|
-
query.dateDeactivated = 0;
|
|
226
|
-
return [2, this.getAllDeployments({
|
|
227
|
-
query: query,
|
|
228
|
-
projection: projection,
|
|
229
|
-
})];
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
};
|
|
233
|
-
Deployer.prototype.getAllDeployments = function (_a) {
|
|
234
|
-
var _b = _a.query, query = _b === void 0 ? {} : _b, projection = _a.projection;
|
|
235
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
236
|
-
return __generator(this, function (_c) {
|
|
237
|
-
return [2, this.callApiV2({
|
|
238
|
-
url: this.dataHub2Url,
|
|
239
|
-
route: '/deployments',
|
|
240
|
-
params: {
|
|
241
|
-
projection: projection,
|
|
242
|
-
query: query,
|
|
243
|
-
},
|
|
244
|
-
method: 'get',
|
|
245
|
-
})];
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
};
|
|
249
|
-
Deployer.prototype.getActiveDeployments = function (projection) {
|
|
250
|
-
return this.getDeployments({ projection: projection });
|
|
251
|
-
};
|
|
252
|
-
Deployer.prototype.getDeploymentsByBotId = function (botId, projection) {
|
|
253
|
-
return this.getDeployments({
|
|
254
|
-
query: { botId: botId },
|
|
255
|
-
projection: projection,
|
|
256
|
-
});
|
|
257
|
-
};
|
|
258
|
-
Deployer.prototype.getAllDeploymentsByBotId = function (botId, projection) {
|
|
259
|
-
return this.getAllDeployments({
|
|
260
|
-
query: { botId: botId },
|
|
261
|
-
projection: projection,
|
|
262
|
-
});
|
|
263
|
-
};
|
|
264
|
-
Deployer.prototype.getActiveDeploymentsByBotId = function (botId, projection) {
|
|
265
|
-
return this.getDeployments({
|
|
266
|
-
query: { botId: botId },
|
|
267
|
-
projection: projection,
|
|
268
|
-
});
|
|
269
|
-
};
|
|
270
|
-
Deployer.prototype.getDeploymentsByFlowId = function (flowId, projection) {
|
|
271
|
-
return this.getDeployments({
|
|
272
|
-
query: { flowId: flowId },
|
|
273
|
-
projection: projection,
|
|
274
|
-
});
|
|
275
|
-
};
|
|
276
|
-
Deployer.prototype.getAllDeploymentsByFlowId = function (flowId, projection) {
|
|
277
|
-
return this.getAllDeployments({
|
|
278
|
-
query: { flowId: flowId },
|
|
279
|
-
projection: projection,
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
Deployer.prototype.getActiveDeploymentsByFlowId = function (flowId, projection) {
|
|
283
|
-
return this.getDeployments({
|
|
284
|
-
query: { flowId: flowId },
|
|
285
|
-
projection: projection,
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
|
-
Deployer.prototype.saveDeployment = function (deployment) {
|
|
289
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
290
|
-
var id;
|
|
291
|
-
return __generator(this, function (_a) {
|
|
292
|
-
switch (_a.label) {
|
|
293
|
-
case 0:
|
|
294
|
-
deployment.id = deployment.id || 'new';
|
|
295
|
-
return [4, this.callApiV2({
|
|
296
|
-
url: this.dataHub2Url,
|
|
297
|
-
route: "/deployments/" + deployment.id,
|
|
298
|
-
data: {
|
|
299
|
-
deployment: deployment,
|
|
300
|
-
},
|
|
301
|
-
method: 'post',
|
|
302
|
-
})];
|
|
303
|
-
case 1:
|
|
304
|
-
id = (_a.sent()).id;
|
|
305
|
-
return [2, __assign(__assign({}, deployment), { id: id })];
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
182
|
return Deployer;
|
|
311
183
|
}(base_1.Base));
|
|
312
184
|
exports.Deployer = Deployer;
|
package/dist/cjs/Deployer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployer.js","sourceRoot":"","sources":["../../src/Deployer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Deployer.js","sourceRoot":"","sources":["../../src/Deployer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAA6C;AAO7C,yCAA0C;AAS1C;IAA8B,4BAAI;IAOhC,kBAAY,MAAsB;QACxB,IAAA,KAAK,GAA2C,MAAM,MAAjD,EAAE,YAAY,GAA6B,MAAM,aAAnC,EAAE,SAAS,GAAkB,MAAM,UAAxB,EAAE,WAAW,GAAK,MAAM,YAAX,CAAY;eAE/D,kBAAM;YACJ,KAAK,OAAA;YACL,YAAY,cAAA;YACZ,UAAU,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4BAEtB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;;;;KACxC;IAEH,eAAC;AAAD,CAAC,AA/HD,CAA8B,WAAI,GA+HjC;AA/HY,4BAAQ"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,0CAAwB"}
|
package/dist/esm/Deployer.js
CHANGED
|
@@ -11,7 +11,7 @@ import { Base, timeout } from '@or-sdk/base';
|
|
|
11
11
|
import { SERVICE_KEY } from './constants';
|
|
12
12
|
export class Deployer extends Base {
|
|
13
13
|
constructor(params) {
|
|
14
|
-
const { token, discoveryUrl, accountId, deployerUrl
|
|
14
|
+
const { token, discoveryUrl, accountId, deployerUrl } = params;
|
|
15
15
|
super({
|
|
16
16
|
token,
|
|
17
17
|
discoveryUrl,
|
|
@@ -19,7 +19,6 @@ export class Deployer extends Base {
|
|
|
19
19
|
accountId,
|
|
20
20
|
serviceUrl: deployerUrl,
|
|
21
21
|
});
|
|
22
|
-
this.dataHub2Url = dataHub2Url;
|
|
23
22
|
}
|
|
24
23
|
removeRole() {
|
|
25
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -97,101 +96,5 @@ export class Deployer extends Base {
|
|
|
97
96
|
throw new Error('Polling is too long');
|
|
98
97
|
});
|
|
99
98
|
}
|
|
100
|
-
deleteDeployment(deployment) {
|
|
101
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
return this.callApiV2({
|
|
103
|
-
url: this.dataHub2Url,
|
|
104
|
-
route: `/deployments/${deployment.id}`,
|
|
105
|
-
method: 'delete',
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
getDeploymentById(id, projection) {
|
|
110
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
-
return this.callApiV2({
|
|
112
|
-
url: this.dataHub2Url,
|
|
113
|
-
route: `/deployments/${id}`,
|
|
114
|
-
params: {
|
|
115
|
-
projection,
|
|
116
|
-
},
|
|
117
|
-
method: 'get',
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
getDeployments({ query = {}, projection }) {
|
|
122
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
-
query.dateDeactivated = 0;
|
|
124
|
-
return this.getAllDeployments({
|
|
125
|
-
query,
|
|
126
|
-
projection,
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
getAllDeployments({ query = {}, projection }) {
|
|
131
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
return this.callApiV2({
|
|
133
|
-
url: this.dataHub2Url,
|
|
134
|
-
route: '/deployments',
|
|
135
|
-
params: {
|
|
136
|
-
projection,
|
|
137
|
-
query,
|
|
138
|
-
},
|
|
139
|
-
method: 'get',
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
getActiveDeployments(projection) {
|
|
144
|
-
return this.getDeployments({ projection });
|
|
145
|
-
}
|
|
146
|
-
getDeploymentsByBotId(botId, projection) {
|
|
147
|
-
return this.getDeployments({
|
|
148
|
-
query: { botId },
|
|
149
|
-
projection,
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
getAllDeploymentsByBotId(botId, projection) {
|
|
153
|
-
return this.getAllDeployments({
|
|
154
|
-
query: { botId },
|
|
155
|
-
projection,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
getActiveDeploymentsByBotId(botId, projection) {
|
|
159
|
-
return this.getDeployments({
|
|
160
|
-
query: { botId },
|
|
161
|
-
projection,
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
getDeploymentsByFlowId(flowId, projection) {
|
|
165
|
-
return this.getDeployments({
|
|
166
|
-
query: { flowId },
|
|
167
|
-
projection,
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
getAllDeploymentsByFlowId(flowId, projection) {
|
|
171
|
-
return this.getAllDeployments({
|
|
172
|
-
query: { flowId },
|
|
173
|
-
projection,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
getActiveDeploymentsByFlowId(flowId, projection) {
|
|
177
|
-
return this.getDeployments({
|
|
178
|
-
query: { flowId },
|
|
179
|
-
projection,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
saveDeployment(deployment) {
|
|
183
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
-
deployment.id = deployment.id || 'new';
|
|
185
|
-
const { id } = yield this.callApiV2({
|
|
186
|
-
url: this.dataHub2Url,
|
|
187
|
-
route: `/deployments/${deployment.id}`,
|
|
188
|
-
data: {
|
|
189
|
-
deployment,
|
|
190
|
-
},
|
|
191
|
-
method: 'post',
|
|
192
|
-
});
|
|
193
|
-
return Object.assign(Object.assign({}, deployment), { id });
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
99
|
}
|
|
197
100
|
//# sourceMappingURL=Deployer.js.map
|
package/dist/esm/Deployer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deployer.js","sourceRoot":"","sources":["../../src/Deployer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Deployer.js","sourceRoot":"","sources":["../../src/Deployer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAO7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS1C,MAAM,OAAO,QAAS,SAAQ,IAAI;IAOhC,YAAY,MAAsB;QAChC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAE/D,KAAK,CAAC;YACJ,KAAK;YACL,YAAY;YACZ,UAAU,EAAE,WAAW;YACvB,SAAS;YACT,UAAU,EAAE,WAAW;SACxB,CAAC,CAAC;IACL,CAAC;IAQY,UAAU;;YACrB,MAAM,KAAK,GAAG,OAAO,CAAC;YAEtB,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,QAAQ;gBAChB,KAAK;gBACL,MAAM,EAAE;oBACN,SAAS,EAAE,IAAI,CAAC,gBAAgB;iBACjC;aACF,CAAC,CAAC;QACL,CAAC;KAAA;IASY,YAAY,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAQ,EAAE,gBAAgB,GAAG,KAAK;;YAC1F,IAAI,CAAC,EAAE,EAAE;gBACP,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;aACnC;YAED,MAAM,SAAS,GAAG,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YAEpC,MAAM,IAAI,GAAG;gBACX,MAAM,EAAE,EAAE;gBACV,SAAS;gBACT,gBAAgB,EAAE,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gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAG,gBAAgB,MAAM,IAAI,SAAS,EAAE,CAAC;YAExH,GAAG;gBACD,OAAO,EAAE,CAAC;gBACV,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;gBAEpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAgB;oBAC/C,MAAM,EAAE,KAAK;oBACb,KAAK;iBACN,CAAC,CAAC;gBAEH,IAAK,MAA+B,CAAC,MAAM,KAAK,SAAS,EAAE;oBACzD,IAAK,MAA6B,CAAC,SAAS,EAAE;wBAC5C,MAAM,MAAM,CAAC;qBACd;oBAED,OAAO,MAAW,CAAC;iBACpB;aACF,QAAQ,OAAO,GAAG,GAAG,EAAE;YAExB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;KAAA;CAEF"}
|
package/dist/types/Deployer.d.ts
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
import { Base } from '@or-sdk/base';
|
|
2
|
-
import { DeployerConfig,
|
|
2
|
+
import { DeployerConfig, Flow, PollingResultActivateSuccess, PollingResultDeactivateSuccess } from './types';
|
|
3
3
|
export declare class Deployer extends Base {
|
|
4
|
-
dataHub2Url?: string;
|
|
5
4
|
constructor(params: DeployerConfig);
|
|
6
5
|
removeRole(): Promise<void>;
|
|
7
6
|
activateFlow({ id, data: { deploy: { role } } }: Flow, interactiveDebug?: boolean): Promise<PollingResultActivateSuccess>;
|
|
8
7
|
deactivateFlow({ id, data: { deploy: { role } } }: Flow, flowAlias: string, deleteLambda?: boolean): Promise<PollingResultDeactivateSuccess>;
|
|
9
8
|
private pollResult;
|
|
10
|
-
deleteDeployment(deployment: {
|
|
11
|
-
id: string;
|
|
12
|
-
}): Promise<any>;
|
|
13
|
-
getDeploymentById(id: string, projection: string[]): Promise<Deployment[]>;
|
|
14
|
-
getDeployments({ query, projection }: GetDeploymentsParams): Promise<Deployment[]>;
|
|
15
|
-
getAllDeployments({ query, projection }: GetDeploymentsParams): Promise<Deployment[]>;
|
|
16
|
-
getActiveDeployments(projection: string[]): Promise<Deployment[]>;
|
|
17
|
-
getDeploymentsByBotId(botId: string, projection: string[]): Promise<Deployment[]>;
|
|
18
|
-
getAllDeploymentsByBotId(botId: string, projection: string[]): Promise<Deployment[]>;
|
|
19
|
-
getActiveDeploymentsByBotId(botId: string, projection: string[]): Promise<Deployment[]>;
|
|
20
|
-
getDeploymentsByFlowId(flowId: string, projection: string[]): Promise<Deployment[]>;
|
|
21
|
-
getAllDeploymentsByFlowId(flowId: string, projection: string[]): Promise<Deployment[]>;
|
|
22
|
-
getActiveDeploymentsByFlowId(flowId: string, projection: string[]): Promise<Deployment[]>;
|
|
23
|
-
saveDeployment(deployment: Deployment): Promise<Deployment>;
|
|
24
9
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare type DeployerConfig = {
|
|
|
6
6
|
discoveryUrl?: string;
|
|
7
7
|
accountId?: string;
|
|
8
8
|
deployerUrl?: string;
|
|
9
|
-
dataHub2Url?: string;
|
|
10
9
|
};
|
|
11
10
|
export declare type Step = {
|
|
12
11
|
id: string;
|
|
@@ -125,16 +124,3 @@ export declare type PollingResultError = {
|
|
|
125
124
|
name?: string;
|
|
126
125
|
};
|
|
127
126
|
export declare type PollingResult = PollingResultPending | PollingResultActivateSuccess | PollingResultDeactivateSuccess | PollingResultError;
|
|
128
|
-
export declare type GetDeploymentsParams = {
|
|
129
|
-
query?: {
|
|
130
|
-
[key: string]: any;
|
|
131
|
-
};
|
|
132
|
-
projection: string[];
|
|
133
|
-
};
|
|
134
|
-
export declare type Deployment = {
|
|
135
|
-
id: string;
|
|
136
|
-
data: {
|
|
137
|
-
[key: string]: any;
|
|
138
|
-
};
|
|
139
|
-
flowId: string;
|
|
140
|
-
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.24.5-
|
|
2
|
+
"version": "0.24.5-421.0",
|
|
3
3
|
"name": "@or-sdk/deployer",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@or-sdk/base": "^0.24.2-
|
|
28
|
-
"@or-sdk/step-templates": "^1.1.3-
|
|
27
|
+
"@or-sdk/base": "^0.24.2-421.0",
|
|
28
|
+
"@or-sdk/step-templates": "^1.1.3-421.0",
|
|
29
29
|
"lodash": "^4.17.21"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Deployer.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Base, timeout } from '@or-sdk/base';
|
|
2
|
-
import { SERVICE_KEY } from './constants';
|
|
3
2
|
import {
|
|
4
|
-
DeployerConfig,
|
|
3
|
+
DeployerConfig,
|
|
4
|
+
Flow,
|
|
5
|
+
PollingResult,
|
|
5
6
|
PollingResultActivateSuccess, PollingResultDeactivateSuccess, PollingResultError, PollingResultPending,
|
|
6
7
|
} from './types';
|
|
8
|
+
import { SERVICE_KEY } from './constants';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* OneReach Deployer service client
|
|
@@ -19,9 +21,8 @@ export class Deployer extends Base {
|
|
|
19
21
|
* const deployer = new Deployer({token: 'my-account-token-string', discoveryUrl: 'http://example.tables/endpoint'});
|
|
20
22
|
* ```
|
|
21
23
|
*/
|
|
22
|
-
dataHub2Url?: string;
|
|
23
24
|
constructor(params: DeployerConfig) {
|
|
24
|
-
const { token, discoveryUrl, accountId, deployerUrl
|
|
25
|
+
const { token, discoveryUrl, accountId, deployerUrl } = params;
|
|
25
26
|
|
|
26
27
|
super({
|
|
27
28
|
token,
|
|
@@ -30,7 +31,6 @@ export class Deployer extends Base {
|
|
|
30
31
|
accountId,
|
|
31
32
|
serviceUrl: deployerUrl,
|
|
32
33
|
});
|
|
33
|
-
this.dataHub2Url = dataHub2Url;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -141,177 +141,4 @@ export class Deployer extends Base {
|
|
|
141
141
|
throw new Error('Polling is too long');
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
/**
|
|
145
|
-
* Delete deployment
|
|
146
|
-
* ```typescript
|
|
147
|
-
* const data = await deployer.deleteDeployment({id});
|
|
148
|
-
* ```
|
|
149
|
-
*/
|
|
150
|
-
async deleteDeployment(deployment: {id: string;}): Promise<any> {
|
|
151
|
-
return this.callApiV2({
|
|
152
|
-
url: this.dataHub2Url,
|
|
153
|
-
route: `/deployments/${deployment.id}`,
|
|
154
|
-
method: 'delete',
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Get deployments by bot id
|
|
160
|
-
* ```typescript
|
|
161
|
-
* const data = await deployer.getDeploymentById({id, projection});
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
async getDeploymentById(id: string, projection: string[]): Promise<Deployment[]> {
|
|
165
|
-
return this.callApiV2({
|
|
166
|
-
url: this.dataHub2Url,
|
|
167
|
-
route: `/deployments/${id}`,
|
|
168
|
-
params: {
|
|
169
|
-
projection,
|
|
170
|
-
},
|
|
171
|
-
method: 'get',
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Get deployments
|
|
177
|
-
* ```typescript
|
|
178
|
-
* const data = await deployer.getDeployments({query, projection});
|
|
179
|
-
* ```
|
|
180
|
-
*/
|
|
181
|
-
async getDeployments({ query = {}, projection }: GetDeploymentsParams): Promise<Deployment[]> {
|
|
182
|
-
query.dateDeactivated = 0;
|
|
183
|
-
return this.getAllDeployments ({
|
|
184
|
-
query,
|
|
185
|
-
projection,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Get all deployments
|
|
191
|
-
* ```typescript
|
|
192
|
-
* const data = await deployer.getAllDeployments({query, projection});
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
async getAllDeployments({ query = {}, projection }: GetDeploymentsParams): Promise<Deployment[]> {
|
|
196
|
-
return this.callApiV2({
|
|
197
|
-
url: this.dataHub2Url,
|
|
198
|
-
route: '/deployments',
|
|
199
|
-
params: {
|
|
200
|
-
projection,
|
|
201
|
-
query,
|
|
202
|
-
},
|
|
203
|
-
method: 'get',
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Get active deployments
|
|
209
|
-
* ```typescript
|
|
210
|
-
* const data = await deployer.getActiveDeployments({query, projection});
|
|
211
|
-
* ```
|
|
212
|
-
*/
|
|
213
|
-
getActiveDeployments(projection: string[]): Promise<Deployment[]> {
|
|
214
|
-
return this.getDeployments({ projection });
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Get deployments by bot id
|
|
219
|
-
* ```typescript
|
|
220
|
-
* const data = await deployer.getDeploymentsByBotId(botId, projection);
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
getDeploymentsByBotId(botId: string, projection: string[]): Promise<Deployment[]> {
|
|
224
|
-
return this.getDeployments({
|
|
225
|
-
query: { botId },
|
|
226
|
-
projection,
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Get all deployments by bot id
|
|
232
|
-
* ```typescript
|
|
233
|
-
* const data = await deployer.getAllDeploymentsByBotId(botId, projection);
|
|
234
|
-
* ```
|
|
235
|
-
*/
|
|
236
|
-
getAllDeploymentsByBotId(botId: string, projection: string[]): Promise<Deployment[]> {
|
|
237
|
-
return this.getAllDeployments({
|
|
238
|
-
query: { botId },
|
|
239
|
-
projection,
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Get active deployments by bot id
|
|
245
|
-
* ```typescript
|
|
246
|
-
* const data = await deployer.getActiveDeploymentsByBotId(botId, projection);
|
|
247
|
-
* ```
|
|
248
|
-
*/
|
|
249
|
-
getActiveDeploymentsByBotId(botId: string, projection: string[]): Promise<Deployment[]> {
|
|
250
|
-
return this.getDeployments({
|
|
251
|
-
query: { botId },
|
|
252
|
-
projection,
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Get deployments by flow id
|
|
258
|
-
* ```typescript
|
|
259
|
-
* const data = await deployer.getDeploymentsByFlowId(flowId, projection);
|
|
260
|
-
* ```
|
|
261
|
-
*/
|
|
262
|
-
getDeploymentsByFlowId(flowId: string, projection: string[]): Promise<Deployment[]> {
|
|
263
|
-
return this.getDeployments({
|
|
264
|
-
query: { flowId },
|
|
265
|
-
projection,
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Get all deployments by flow id
|
|
271
|
-
* ```typescript
|
|
272
|
-
* const data = await deployer.getAllDeploymentsByFlowId(flowId, projection);
|
|
273
|
-
* ```
|
|
274
|
-
*/
|
|
275
|
-
getAllDeploymentsByFlowId(flowId: string, projection: string[]): Promise<Deployment[]> {
|
|
276
|
-
return this.getAllDeployments({
|
|
277
|
-
query: { flowId },
|
|
278
|
-
projection,
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Get active deployments by flow id
|
|
284
|
-
* ```typescript
|
|
285
|
-
* const data = await deployer.getActiveDeploymentsByFlowId(flowId, projection);
|
|
286
|
-
* ```
|
|
287
|
-
*/
|
|
288
|
-
getActiveDeploymentsByFlowId(flowId: string, projection: string[]): Promise<Deployment[]> {
|
|
289
|
-
return this.getDeployments({
|
|
290
|
-
query: { flowId },
|
|
291
|
-
projection,
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Save deployment
|
|
297
|
-
* ```typescript
|
|
298
|
-
* const data = await deployer.saveDeployment(deployment);
|
|
299
|
-
* ```
|
|
300
|
-
*/
|
|
301
|
-
async saveDeployment(deployment: Deployment): Promise<Deployment> {
|
|
302
|
-
deployment.id = deployment.id || 'new';
|
|
303
|
-
const { id } = await this.callApiV2({
|
|
304
|
-
url: this.dataHub2Url,
|
|
305
|
-
route: `/deployments/${deployment.id}`,
|
|
306
|
-
data: {
|
|
307
|
-
deployment,
|
|
308
|
-
},
|
|
309
|
-
method: 'post',
|
|
310
|
-
});
|
|
311
|
-
return {
|
|
312
|
-
...deployment,
|
|
313
|
-
id,
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
|
|
317
144
|
}
|
package/src/types.ts
CHANGED
|
@@ -22,10 +22,6 @@ export type DeployerConfig = {
|
|
|
22
22
|
* Url of OneReach Deployer api
|
|
23
23
|
*/
|
|
24
24
|
deployerUrl?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Url of OneReach DataHub2 api
|
|
27
|
-
*/
|
|
28
|
-
dataHub2Url?: string;
|
|
29
25
|
};
|
|
30
26
|
|
|
31
27
|
export type Step = {
|
|
@@ -156,7 +152,3 @@ export type PollingResultError = {
|
|
|
156
152
|
};
|
|
157
153
|
|
|
158
154
|
export type PollingResult = PollingResultPending | PollingResultActivateSuccess | PollingResultDeactivateSuccess | PollingResultError;
|
|
159
|
-
|
|
160
|
-
export type GetDeploymentsParams = {query?: {[key: string]: any;}; projection: string[];};
|
|
161
|
-
|
|
162
|
-
export type Deployment = {id: string; data: {[key: string]: any;}; flowId: string;};
|