@agility/management-sdk 0.1.32 → 0.1.33
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/.cursor/api-documentation-manifest.md +275 -0
- package/.cursor/api-functions-analysis.md +111 -0
- package/.cursor/breakout-manifest.md +278 -0
- package/.cursor/docs-final-check.md +269 -0
- package/.cursor/manifest.md +243 -0
- package/.env +92 -0
- package/dist/apiMethods/assetMethods.js +38 -38
- package/dist/apiMethods/batchMethods.js +33 -33
- package/dist/apiMethods/clientInstance.js +18 -15
- package/dist/apiMethods/containerMethods.js +20 -20
- package/dist/apiMethods/contentMethods.js +68 -68
- package/dist/apiMethods/instanceMethods.js +3 -3
- package/dist/apiMethods/instanceUserMethods.js +10 -10
- package/dist/apiMethods/modelMethods.js +13 -13
- package/dist/apiMethods/pageMethods.js +73 -73
- package/dist/apiMethods/serverUserMethods.js +4 -4
- package/dist/apiMethods/webhookMethods.js +11 -11
- package/dist/enums/assetGroupingType.js +1 -1
- package/dist/enums/batchItemType.js +1 -1
- package/dist/enums/batchOperationType.js +1 -1
- package/dist/enums/batchState..js +1 -1
- package/dist/enums/pageItemTemplateType.js +1 -1
- package/dist/enums/workflowOperationType.js +1 -1
- package/dist/index.js +5 -1
- package/dist/models/contentDefinitionTypeID.js +1 -1
- package/dist/models/exception.js +2 -0
- package/dist/models/locales.js +2 -0
- package/package.json +1 -1
|
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -51,7 +51,7 @@ var AssetMethods = /** @class */ (function () {
|
|
|
51
51
|
switch (_a.label) {
|
|
52
52
|
case 0:
|
|
53
53
|
_a.trys.push([0, 2, , 3]);
|
|
54
|
-
apiPath = "asset/delete/"
|
|
54
|
+
apiPath = "asset/delete/".concat(mediaID);
|
|
55
55
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
56
56
|
case 1:
|
|
57
57
|
resp = _a.sent();
|
|
@@ -59,7 +59,7 @@ var AssetMethods = /** @class */ (function () {
|
|
|
59
59
|
return [2 /*return*/, resp.data];
|
|
60
60
|
case 2:
|
|
61
61
|
err_1 = _a.sent();
|
|
62
|
-
throw new exception_1.Exception("Unable to delete the media for mediaID: "
|
|
62
|
+
throw new exception_1.Exception("Unable to delete the media for mediaID: ".concat(mediaID), err_1);
|
|
63
63
|
case 3: return [2 /*return*/];
|
|
64
64
|
}
|
|
65
65
|
});
|
|
@@ -73,14 +73,14 @@ var AssetMethods = /** @class */ (function () {
|
|
|
73
73
|
case 0:
|
|
74
74
|
_a.trys.push([0, 2, , 3]);
|
|
75
75
|
folder = encodeURIComponent(newFolder);
|
|
76
|
-
apiPath = "asset/move/"
|
|
76
|
+
apiPath = "asset/move/".concat(mediaID, "?newFolder=").concat(folder);
|
|
77
77
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
78
78
|
case 1:
|
|
79
79
|
resp = _a.sent();
|
|
80
80
|
return [2 /*return*/, resp.data];
|
|
81
81
|
case 2:
|
|
82
82
|
err_2 = _a.sent();
|
|
83
|
-
throw new exception_1.Exception("Unable to move the media for mediaID: "
|
|
83
|
+
throw new exception_1.Exception("Unable to move the media for mediaID: ".concat(mediaID), err_2);
|
|
84
84
|
case 3: return [2 /*return*/];
|
|
85
85
|
}
|
|
86
86
|
});
|
|
@@ -93,7 +93,7 @@ var AssetMethods = /** @class */ (function () {
|
|
|
93
93
|
switch (_a.label) {
|
|
94
94
|
case 0:
|
|
95
95
|
_a.trys.push([0, 2, , 3]);
|
|
96
|
-
apiPath = "asset/list?pageSize="
|
|
96
|
+
apiPath = "asset/list?pageSize=".concat(pageSize, "&recordOffset=").concat(recordOffset);
|
|
97
97
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
98
98
|
case 1:
|
|
99
99
|
resp = _a.sent();
|
|
@@ -106,17 +106,17 @@ var AssetMethods = /** @class */ (function () {
|
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
|
-
AssetMethods.prototype.getGalleries = function (
|
|
110
|
-
|
|
111
|
-
if (pageSize === void 0) { pageSize = null; }
|
|
112
|
-
if (rowIndex === void 0) { rowIndex = null; }
|
|
113
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
+
AssetMethods.prototype.getGalleries = function (guid_1) {
|
|
110
|
+
return __awaiter(this, arguments, void 0, function (guid, search, pageSize, rowIndex) {
|
|
114
111
|
var apiPath, resp, err_4;
|
|
112
|
+
if (search === void 0) { search = null; }
|
|
113
|
+
if (pageSize === void 0) { pageSize = null; }
|
|
114
|
+
if (rowIndex === void 0) { rowIndex = null; }
|
|
115
115
|
return __generator(this, function (_a) {
|
|
116
116
|
switch (_a.label) {
|
|
117
117
|
case 0:
|
|
118
118
|
_a.trys.push([0, 2, , 3]);
|
|
119
|
-
apiPath = "asset/galleries?search="
|
|
119
|
+
apiPath = "asset/galleries?search=".concat(search, "&pageSize=").concat(pageSize, "&rowIndex=").concat(rowIndex);
|
|
120
120
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
121
121
|
case 1:
|
|
122
122
|
resp = _a.sent();
|
|
@@ -136,14 +136,14 @@ var AssetMethods = /** @class */ (function () {
|
|
|
136
136
|
switch (_a.label) {
|
|
137
137
|
case 0:
|
|
138
138
|
_a.trys.push([0, 2, , 3]);
|
|
139
|
-
apiPath = "/asset/gallery/"
|
|
139
|
+
apiPath = "/asset/gallery/".concat(id);
|
|
140
140
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
141
141
|
case 1:
|
|
142
142
|
resp = _a.sent();
|
|
143
143
|
return [2 /*return*/, resp.data];
|
|
144
144
|
case 2:
|
|
145
145
|
err_5 = _a.sent();
|
|
146
|
-
throw new exception_1.Exception("Unable to retrieve gallery for id "
|
|
146
|
+
throw new exception_1.Exception("Unable to retrieve gallery for id ".concat(id), err_5);
|
|
147
147
|
case 3: return [2 /*return*/];
|
|
148
148
|
}
|
|
149
149
|
});
|
|
@@ -156,14 +156,14 @@ var AssetMethods = /** @class */ (function () {
|
|
|
156
156
|
switch (_a.label) {
|
|
157
157
|
case 0:
|
|
158
158
|
_a.trys.push([0, 2, , 3]);
|
|
159
|
-
apiPath = "/asset/gallery?galleryName="
|
|
159
|
+
apiPath = "/asset/gallery?galleryName=".concat(galleryName);
|
|
160
160
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
161
161
|
case 1:
|
|
162
162
|
resp = _a.sent();
|
|
163
163
|
return [2 /*return*/, resp.data];
|
|
164
164
|
case 2:
|
|
165
165
|
err_6 = _a.sent();
|
|
166
|
-
throw new exception_1.Exception("Unable to retrieve gallery for name "
|
|
166
|
+
throw new exception_1.Exception("Unable to retrieve gallery for name ".concat(galleryName), err_6);
|
|
167
167
|
case 3: return [2 /*return*/];
|
|
168
168
|
}
|
|
169
169
|
});
|
|
@@ -183,7 +183,7 @@ var AssetMethods = /** @class */ (function () {
|
|
|
183
183
|
return [2 /*return*/, resp.data];
|
|
184
184
|
case 2:
|
|
185
185
|
err_7 = _a.sent();
|
|
186
|
-
throw new exception_1.Exception("Unable to retrieve container for guid "
|
|
186
|
+
throw new exception_1.Exception("Unable to retrieve container for guid ".concat(guid), err_7);
|
|
187
187
|
case 3: return [2 /*return*/];
|
|
188
188
|
}
|
|
189
189
|
});
|
|
@@ -216,14 +216,14 @@ var AssetMethods = /** @class */ (function () {
|
|
|
216
216
|
switch (_a.label) {
|
|
217
217
|
case 0:
|
|
218
218
|
_a.trys.push([0, 2, , 3]);
|
|
219
|
-
apiPath = "/asset/gallery/"
|
|
219
|
+
apiPath = "/asset/gallery/".concat(id);
|
|
220
220
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
221
221
|
case 1:
|
|
222
222
|
resp = _a.sent();
|
|
223
223
|
return [2 /*return*/, resp.data];
|
|
224
224
|
case 2:
|
|
225
225
|
err_9 = _a.sent();
|
|
226
|
-
throw new exception_1.Exception("Unable to delete gallery for id "
|
|
226
|
+
throw new exception_1.Exception("Unable to delete gallery for id ".concat(id), err_9);
|
|
227
227
|
case 3: return [2 /*return*/];
|
|
228
228
|
}
|
|
229
229
|
});
|
|
@@ -236,14 +236,14 @@ var AssetMethods = /** @class */ (function () {
|
|
|
236
236
|
switch (_a.label) {
|
|
237
237
|
case 0:
|
|
238
238
|
_a.trys.push([0, 2, , 3]);
|
|
239
|
-
apiPath = "asset/"
|
|
239
|
+
apiPath = "asset/".concat(mediaID);
|
|
240
240
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
241
241
|
case 1:
|
|
242
242
|
resp = _a.sent();
|
|
243
243
|
return [2 /*return*/, resp.data];
|
|
244
244
|
case 2:
|
|
245
245
|
err_10 = _a.sent();
|
|
246
|
-
throw new exception_1.Exception("Unable to retrieve asset for mediaID "
|
|
246
|
+
throw new exception_1.Exception("Unable to retrieve asset for mediaID ".concat(mediaID), err_10);
|
|
247
247
|
case 3: return [2 /*return*/];
|
|
248
248
|
}
|
|
249
249
|
});
|
|
@@ -256,14 +256,14 @@ var AssetMethods = /** @class */ (function () {
|
|
|
256
256
|
switch (_a.label) {
|
|
257
257
|
case 0:
|
|
258
258
|
_a.trys.push([0, 2, , 3]);
|
|
259
|
-
apiPath = "asset?url="
|
|
259
|
+
apiPath = "asset?url=".concat(url);
|
|
260
260
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
261
261
|
case 1:
|
|
262
262
|
resp = _a.sent();
|
|
263
263
|
return [2 /*return*/, resp.data];
|
|
264
264
|
case 2:
|
|
265
265
|
err_11 = _a.sent();
|
|
266
|
-
throw new exception_1.Exception("Unable to retrieve asset for url "
|
|
266
|
+
throw new exception_1.Exception("Unable to retrieve asset for url ".concat(url), err_11);
|
|
267
267
|
case 3: return [2 /*return*/];
|
|
268
268
|
}
|
|
269
269
|
});
|
|
@@ -279,15 +279,15 @@ var AssetMethods = /** @class */ (function () {
|
|
|
279
279
|
* @returns
|
|
280
280
|
* @memberof AssetMethods
|
|
281
281
|
*/
|
|
282
|
-
AssetMethods.prototype.upload = function (
|
|
283
|
-
|
|
284
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
282
|
+
AssetMethods.prototype.upload = function (formData_1, agilityFolderPath_1, guid_1) {
|
|
283
|
+
return __awaiter(this, arguments, void 0, function (formData, agilityFolderPath, guid, groupingID) {
|
|
285
284
|
var apiPath, resp, err_12;
|
|
285
|
+
if (groupingID === void 0) { groupingID = -1; }
|
|
286
286
|
return __generator(this, function (_a) {
|
|
287
287
|
switch (_a.label) {
|
|
288
288
|
case 0:
|
|
289
289
|
_a.trys.push([0, 2, , 3]);
|
|
290
|
-
apiPath = "asset/upload?folderPath="
|
|
290
|
+
apiPath = "asset/upload?folderPath=".concat(agilityFolderPath, "&groupingID=").concat(groupingID);
|
|
291
291
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, formData)];
|
|
292
292
|
case 1:
|
|
293
293
|
resp = _a.sent();
|
|
@@ -307,7 +307,7 @@ var AssetMethods = /** @class */ (function () {
|
|
|
307
307
|
switch (_a.label) {
|
|
308
308
|
case 0:
|
|
309
309
|
_a.trys.push([0, 2, , 3]);
|
|
310
|
-
apiPath = "asset/folder?originKey="
|
|
310
|
+
apiPath = "asset/folder?originKey=".concat(originKey);
|
|
311
311
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
312
312
|
case 1:
|
|
313
313
|
resp = _a.sent();
|
|
@@ -320,15 +320,15 @@ var AssetMethods = /** @class */ (function () {
|
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
};
|
|
323
|
-
AssetMethods.prototype.deleteFolder = function (
|
|
324
|
-
|
|
325
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
323
|
+
AssetMethods.prototype.deleteFolder = function (originKey_1, guid_1) {
|
|
324
|
+
return __awaiter(this, arguments, void 0, function (originKey, guid, mediaID) {
|
|
326
325
|
var apiPath, err_14;
|
|
326
|
+
if (mediaID === void 0) { mediaID = 0; }
|
|
327
327
|
return __generator(this, function (_a) {
|
|
328
328
|
switch (_a.label) {
|
|
329
329
|
case 0:
|
|
330
330
|
_a.trys.push([0, 2, , 3]);
|
|
331
|
-
apiPath = "asset/folder/delete?originKey="
|
|
331
|
+
apiPath = "asset/folder/delete?originKey=".concat(originKey, "&mediaID=").concat(mediaID);
|
|
332
332
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
333
333
|
case 1:
|
|
334
334
|
_a.sent();
|
|
@@ -341,15 +341,15 @@ var AssetMethods = /** @class */ (function () {
|
|
|
341
341
|
});
|
|
342
342
|
});
|
|
343
343
|
};
|
|
344
|
-
AssetMethods.prototype.renameFolder = function (
|
|
345
|
-
|
|
346
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
344
|
+
AssetMethods.prototype.renameFolder = function (folderName_1, newFolderName_1, guid_1) {
|
|
345
|
+
return __awaiter(this, arguments, void 0, function (folderName, newFolderName, guid, mediaID) {
|
|
347
346
|
var apiPath, err_15;
|
|
347
|
+
if (mediaID === void 0) { mediaID = 0; }
|
|
348
348
|
return __generator(this, function (_a) {
|
|
349
349
|
switch (_a.label) {
|
|
350
350
|
case 0:
|
|
351
351
|
_a.trys.push([0, 2, , 3]);
|
|
352
|
-
apiPath = "asset/folder/rename?folderName="
|
|
352
|
+
apiPath = "asset/folder/rename?folderName=".concat(folderName, "&newFolderName=").concat(newFolderName, "&mediaID=").concat(mediaID);
|
|
353
353
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
354
354
|
case 1:
|
|
355
355
|
_a.sent();
|
|
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -45,37 +45,37 @@ var BatchMethods = /** @class */ (function () {
|
|
|
45
45
|
this._options = options;
|
|
46
46
|
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
47
47
|
}
|
|
48
|
-
BatchMethods.prototype.getBatch = function (
|
|
49
|
-
|
|
50
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
+
BatchMethods.prototype.getBatch = function (batchID_1, guid_1) {
|
|
49
|
+
return __awaiter(this, arguments, void 0, function (batchID, guid, expandItems) {
|
|
51
50
|
var apiPath, resp, err_1;
|
|
51
|
+
if (expandItems === void 0) { expandItems = true; }
|
|
52
52
|
return __generator(this, function (_a) {
|
|
53
53
|
switch (_a.label) {
|
|
54
54
|
case 0:
|
|
55
55
|
_a.trys.push([0, 2, , 3]);
|
|
56
|
-
apiPath = "batch/"
|
|
56
|
+
apiPath = "batch/".concat(batchID, "?expandItems=").concat(expandItems);
|
|
57
57
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
58
58
|
case 1:
|
|
59
59
|
resp = _a.sent();
|
|
60
60
|
return [2 /*return*/, resp.data];
|
|
61
61
|
case 2:
|
|
62
62
|
err_1 = _a.sent();
|
|
63
|
-
throw new exception_1.Exception("Unable to retrieve the batch for id: "
|
|
63
|
+
throw new exception_1.Exception("Unable to retrieve the batch for id: ".concat(batchID), err_1);
|
|
64
64
|
case 3: return [2 /*return*/];
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
BatchMethods.prototype.publishBatch = function (
|
|
70
|
-
|
|
71
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
BatchMethods.prototype.publishBatch = function (batchID_1, guid_1) {
|
|
70
|
+
return __awaiter(this, arguments, void 0, function (batchID, guid, returnBatchId) {
|
|
72
71
|
var apiPath, resp, resultBatchID_1, err_2;
|
|
73
72
|
var _this = this;
|
|
73
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
74
74
|
return __generator(this, function (_a) {
|
|
75
75
|
switch (_a.label) {
|
|
76
76
|
case 0:
|
|
77
77
|
_a.trys.push([0, 3, , 4]);
|
|
78
|
-
apiPath = "batch/"
|
|
78
|
+
apiPath = "batch/".concat(batchID, "/publish");
|
|
79
79
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
80
80
|
case 1:
|
|
81
81
|
resp = _a.sent();
|
|
@@ -97,22 +97,22 @@ var BatchMethods = /** @class */ (function () {
|
|
|
97
97
|
return [2 /*return*/, resultBatchID_1];
|
|
98
98
|
case 3:
|
|
99
99
|
err_2 = _a.sent();
|
|
100
|
-
throw new exception_1.Exception("Unable to publish the batch with id: "
|
|
100
|
+
throw new exception_1.Exception("Unable to publish the batch with id: ".concat(batchID), err_2);
|
|
101
101
|
case 4: return [2 /*return*/];
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
-
BatchMethods.prototype.unpublishBatch = function (
|
|
107
|
-
|
|
108
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
BatchMethods.prototype.unpublishBatch = function (batchID_1, guid_1) {
|
|
107
|
+
return __awaiter(this, arguments, void 0, function (batchID, guid, returnBatchId) {
|
|
109
108
|
var apiPath, resp, resultBatchID_2, err_3;
|
|
110
109
|
var _this = this;
|
|
110
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
111
111
|
return __generator(this, function (_a) {
|
|
112
112
|
switch (_a.label) {
|
|
113
113
|
case 0:
|
|
114
114
|
_a.trys.push([0, 3, , 4]);
|
|
115
|
-
apiPath = "batch/"
|
|
115
|
+
apiPath = "batch/".concat(batchID, "/unpublish");
|
|
116
116
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
117
117
|
case 1:
|
|
118
118
|
resp = _a.sent();
|
|
@@ -134,22 +134,22 @@ var BatchMethods = /** @class */ (function () {
|
|
|
134
134
|
return [2 /*return*/, resultBatchID_2];
|
|
135
135
|
case 3:
|
|
136
136
|
err_3 = _a.sent();
|
|
137
|
-
throw new exception_1.Exception("Unable to unpublish the batch with id: "
|
|
137
|
+
throw new exception_1.Exception("Unable to unpublish the batch with id: ".concat(batchID), err_3);
|
|
138
138
|
case 4: return [2 /*return*/];
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
-
BatchMethods.prototype.approveBatch = function (
|
|
144
|
-
|
|
145
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
143
|
+
BatchMethods.prototype.approveBatch = function (batchID_1, guid_1) {
|
|
144
|
+
return __awaiter(this, arguments, void 0, function (batchID, guid, returnBatchId) {
|
|
146
145
|
var apiPath, resp, resultBatchID_3, err_4;
|
|
147
146
|
var _this = this;
|
|
147
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
148
148
|
return __generator(this, function (_a) {
|
|
149
149
|
switch (_a.label) {
|
|
150
150
|
case 0:
|
|
151
151
|
_a.trys.push([0, 3, , 4]);
|
|
152
|
-
apiPath = "batch/"
|
|
152
|
+
apiPath = "batch/".concat(batchID, "/approve");
|
|
153
153
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
154
154
|
case 1:
|
|
155
155
|
resp = _a.sent();
|
|
@@ -171,22 +171,22 @@ var BatchMethods = /** @class */ (function () {
|
|
|
171
171
|
return [2 /*return*/, resultBatchID_3];
|
|
172
172
|
case 3:
|
|
173
173
|
err_4 = _a.sent();
|
|
174
|
-
throw new exception_1.Exception("Unable to approve the batch with id: "
|
|
174
|
+
throw new exception_1.Exception("Unable to approve the batch with id: ".concat(batchID), err_4);
|
|
175
175
|
case 4: return [2 /*return*/];
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
179
|
};
|
|
180
|
-
BatchMethods.prototype.declineBatch = function (
|
|
181
|
-
|
|
182
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
180
|
+
BatchMethods.prototype.declineBatch = function (batchID_1, guid_1) {
|
|
181
|
+
return __awaiter(this, arguments, void 0, function (batchID, guid, returnBatchId) {
|
|
183
182
|
var apiPath, resp, resultBatchID_4, err_5;
|
|
184
183
|
var _this = this;
|
|
184
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
185
185
|
return __generator(this, function (_a) {
|
|
186
186
|
switch (_a.label) {
|
|
187
187
|
case 0:
|
|
188
188
|
_a.trys.push([0, 3, , 4]);
|
|
189
|
-
apiPath = "batch/"
|
|
189
|
+
apiPath = "batch/".concat(batchID, "/decline");
|
|
190
190
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
191
191
|
case 1:
|
|
192
192
|
resp = _a.sent();
|
|
@@ -208,22 +208,22 @@ var BatchMethods = /** @class */ (function () {
|
|
|
208
208
|
return [2 /*return*/, resultBatchID_4];
|
|
209
209
|
case 3:
|
|
210
210
|
err_5 = _a.sent();
|
|
211
|
-
throw new exception_1.Exception("Unable to decline the batch with id: "
|
|
211
|
+
throw new exception_1.Exception("Unable to decline the batch with id: ".concat(batchID), err_5);
|
|
212
212
|
case 4: return [2 /*return*/];
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
215
|
});
|
|
216
216
|
};
|
|
217
|
-
BatchMethods.prototype.requestApprovalBatch = function (
|
|
218
|
-
|
|
219
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
217
|
+
BatchMethods.prototype.requestApprovalBatch = function (batchID_1, guid_1) {
|
|
218
|
+
return __awaiter(this, arguments, void 0, function (batchID, guid, returnBatchId) {
|
|
220
219
|
var apiPath, resp, resultBatchID_5, err_6;
|
|
221
220
|
var _this = this;
|
|
221
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
222
222
|
return __generator(this, function (_a) {
|
|
223
223
|
switch (_a.label) {
|
|
224
224
|
case 0:
|
|
225
225
|
_a.trys.push([0, 3, , 4]);
|
|
226
|
-
apiPath = "batch/"
|
|
226
|
+
apiPath = "batch/".concat(batchID, "/request-approval");
|
|
227
227
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
228
228
|
case 1:
|
|
229
229
|
resp = _a.sent();
|
|
@@ -245,7 +245,7 @@ var BatchMethods = /** @class */ (function () {
|
|
|
245
245
|
return [2 /*return*/, resultBatchID_5];
|
|
246
246
|
case 3:
|
|
247
247
|
err_6 = _a.sent();
|
|
248
|
-
throw new exception_1.Exception("Unable to request approval for the batch with id: "
|
|
248
|
+
throw new exception_1.Exception("Unable to request approval for the batch with id: ".concat(batchID), err_6);
|
|
249
249
|
case 4: return [2 /*return*/];
|
|
250
250
|
}
|
|
251
251
|
});
|
|
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -56,21 +56,24 @@ var ClientInstance = /** @class */ (function () {
|
|
|
56
56
|
//if we have a baseUrl overridden, use it
|
|
57
57
|
if (this._options.baseUrl)
|
|
58
58
|
return this._options.baseUrl;
|
|
59
|
-
var
|
|
59
|
+
var separator = guid.split('-');
|
|
60
60
|
//determine the base url based on the GUID
|
|
61
|
-
if (
|
|
61
|
+
if (separator[1] === 'd') {
|
|
62
62
|
return "https://mgmt-dev.aglty.io";
|
|
63
63
|
}
|
|
64
|
-
else if (
|
|
64
|
+
else if (separator[1] === 'u') {
|
|
65
65
|
return "https://mgmt.aglty.io";
|
|
66
66
|
}
|
|
67
|
-
else if (
|
|
67
|
+
else if (separator[1] === 'us2') {
|
|
68
|
+
return "https://mgmt-usa2.aglty.io";
|
|
69
|
+
}
|
|
70
|
+
else if (separator[1] === 'c') {
|
|
68
71
|
return "https://mgmt-ca.aglty.io";
|
|
69
72
|
}
|
|
70
|
-
else if (
|
|
73
|
+
else if (separator[1] === 'e') {
|
|
71
74
|
return "https://mgmt-eu.aglty.io";
|
|
72
75
|
}
|
|
73
|
-
else if (
|
|
76
|
+
else if (separator[1] === 'a') {
|
|
74
77
|
return "https://mgmt-aus.aglty.io";
|
|
75
78
|
}
|
|
76
79
|
return "https://mgmt.aglty.io";
|
|
@@ -78,7 +81,7 @@ var ClientInstance = /** @class */ (function () {
|
|
|
78
81
|
ClientInstance.prototype.getInstance = function (guid) {
|
|
79
82
|
var baseUrl = this.determineBaseUrl(guid);
|
|
80
83
|
var instance = axios_1.default.create({
|
|
81
|
-
baseURL: baseUrl
|
|
84
|
+
baseURL: "".concat(baseUrl, "/api/v1/instance/").concat(guid),
|
|
82
85
|
maxContentLength: Infinity,
|
|
83
86
|
maxBodyLength: Infinity
|
|
84
87
|
});
|
|
@@ -87,7 +90,7 @@ var ClientInstance = /** @class */ (function () {
|
|
|
87
90
|
ClientInstance.prototype.getAxiosInstance = function (guid) {
|
|
88
91
|
var baseUrl = this.determineBaseUrl(guid);
|
|
89
92
|
var instance = axios_1.default.create({
|
|
90
|
-
baseURL: baseUrl
|
|
93
|
+
baseURL: "".concat(baseUrl, "/api/v1"),
|
|
91
94
|
maxContentLength: Infinity,
|
|
92
95
|
maxBodyLength: Infinity
|
|
93
96
|
});
|
|
@@ -105,7 +108,7 @@ var ClientInstance = /** @class */ (function () {
|
|
|
105
108
|
_a.trys.push([1, 3, , 4]);
|
|
106
109
|
return [4 /*yield*/, instance.get(apiPath, {
|
|
107
110
|
headers: {
|
|
108
|
-
'Authorization': "Bearer "
|
|
111
|
+
'Authorization': "Bearer ".concat(token),
|
|
109
112
|
'Cache-Control': 'no-cache'
|
|
110
113
|
}
|
|
111
114
|
})];
|
|
@@ -132,7 +135,7 @@ var ClientInstance = /** @class */ (function () {
|
|
|
132
135
|
_a.trys.push([1, 3, , 4]);
|
|
133
136
|
return [4 /*yield*/, instance.get(apiPath, {
|
|
134
137
|
headers: {
|
|
135
|
-
'Authorization': "Bearer "
|
|
138
|
+
'Authorization': "Bearer ".concat(token),
|
|
136
139
|
'Cache-Control': 'no-cache'
|
|
137
140
|
}
|
|
138
141
|
})];
|
|
@@ -159,7 +162,7 @@ var ClientInstance = /** @class */ (function () {
|
|
|
159
162
|
_a.trys.push([1, 3, , 4]);
|
|
160
163
|
return [4 /*yield*/, instance.delete(apiPath, {
|
|
161
164
|
headers: {
|
|
162
|
-
'Authorization': "Bearer "
|
|
165
|
+
'Authorization': "Bearer ".concat(token),
|
|
163
166
|
'Cache-Control': 'no-cache'
|
|
164
167
|
},
|
|
165
168
|
data: data
|
|
@@ -187,7 +190,7 @@ var ClientInstance = /** @class */ (function () {
|
|
|
187
190
|
_a.trys.push([1, 3, , 4]);
|
|
188
191
|
return [4 /*yield*/, instance.post(apiPath, data, {
|
|
189
192
|
headers: {
|
|
190
|
-
'Authorization': "Bearer "
|
|
193
|
+
'Authorization': "Bearer ".concat(token),
|
|
191
194
|
'Cache-Control': 'no-cache'
|
|
192
195
|
}
|
|
193
196
|
})];
|