@agility/management-sdk 0.1.23 → 0.1.24
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/apiMethods/assetMethods.js +38 -38
- package/dist/apiMethods/batchMethods.js +5 -5
- package/dist/apiMethods/clientInstance.js +9 -9
- package/dist/apiMethods/containerMethods.js +21 -21
- package/dist/apiMethods/contentMethods.js +56 -56
- package/dist/apiMethods/instanceMethods.js +3 -3
- package/dist/apiMethods/instanceUserMethods.js +12 -12
- package/dist/apiMethods/modelMethods.js +15 -15
- package/dist/apiMethods/pageMethods.js +68 -68
- package/dist/apiMethods/serverUserMethods.js +4 -4
- package/dist/apiMethods/webhookMethods.js +11 -11
- package/dist/enums/assetGroupingType.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/index.js +1 -5
- package/dist/models/exception.js +0 -2
- package/dist/models/locales.js +0 -2
- package/package.json +2 -2
- package/.cursor/manifest.md +0 -65
- package/.cursor/rules/agility_cms_sdk_rules.mdc +0 -155
- package/.cursor/rules/asset_management.mdc +0 -97
- package/.cursor/rules/common_patterns.mdc +0 -5
- package/.cursor/rules/configuration.mdc +0 -5
- package/.cursor/rules/content_management.mdc +0 -5
- package/.cursor/rules/page_management.mdc +0 -5
- package/.cursor/rules/security.mdc +0 -5
- package/.cursor/rules/setup_and_auth.mdc +0 -5
- package/.cursor/rules/testing_and_debugging.mdc +0 -5
- package/.cursor/rules/webhook_management.mdc +0 -61
- package/.env +0 -11
- package/dist/models/tokenResponseData.d.ts +0 -11
- package/dist/models/tokenResponseData.js +0 -13
- package/dist/tests/instance.test.d.ts +0 -1
- package/dist/tests/instance.test.js +0 -99
- package/dist/tests/sdk.test.d.ts +0 -1
- package/dist/tests/sdk.test.js +0 -78
- package/environment.example +0 -12
|
@@ -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;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "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 (
|
|
17
|
+
while (_) 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]) {
|
|
@@ -53,29 +53,29 @@ var ContentMethods = /** @class */ (function () {
|
|
|
53
53
|
switch (_a.label) {
|
|
54
54
|
case 0:
|
|
55
55
|
_a.trys.push([0, 2, , 3]);
|
|
56
|
-
apiPath =
|
|
56
|
+
apiPath = locale + "/item/" + contentID;
|
|
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
|
|
63
|
+
throw new exception_1.Exception("Unable to retrieve the content for id: " + contentID, err_1);
|
|
64
64
|
case 3: return [2 /*return*/];
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
ContentMethods.prototype.publishContent = function (
|
|
70
|
-
|
|
69
|
+
ContentMethods.prototype.publishContent = function (contentID, guid, locale, comments) {
|
|
70
|
+
if (comments === void 0) { comments = null; }
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
72
|
var apiPath, resp, batchID_1, batch, contentIDs_1, err_2;
|
|
72
73
|
var _this = this;
|
|
73
|
-
if (comments === void 0) { comments = null; }
|
|
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 =
|
|
78
|
+
apiPath = locale + "/item/" + contentID + "/publish?comments=" + comments;
|
|
79
79
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
80
80
|
case 1:
|
|
81
81
|
resp = _a.sent();
|
|
@@ -93,22 +93,22 @@ var ContentMethods = /** @class */ (function () {
|
|
|
93
93
|
return [2 /*return*/, contentIDs_1];
|
|
94
94
|
case 3:
|
|
95
95
|
err_2 = _a.sent();
|
|
96
|
-
throw new exception_1.Exception("Unable to publish the content for id: "
|
|
96
|
+
throw new exception_1.Exception("Unable to publish the content for id: " + contentID, err_2);
|
|
97
97
|
case 4: return [2 /*return*/];
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
-
ContentMethods.prototype.unPublishContent = function (
|
|
103
|
-
|
|
102
|
+
ContentMethods.prototype.unPublishContent = function (contentID, guid, locale, comments) {
|
|
103
|
+
if (comments === void 0) { comments = null; }
|
|
104
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
104
105
|
var apiPath, resp, batchID_2, batch, contentIDs_2, err_3;
|
|
105
106
|
var _this = this;
|
|
106
|
-
if (comments === void 0) { comments = null; }
|
|
107
107
|
return __generator(this, function (_a) {
|
|
108
108
|
switch (_a.label) {
|
|
109
109
|
case 0:
|
|
110
110
|
_a.trys.push([0, 3, , 4]);
|
|
111
|
-
apiPath =
|
|
111
|
+
apiPath = locale + "/item/" + contentID + "/unpublish?comments=" + comments;
|
|
112
112
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
113
113
|
case 1:
|
|
114
114
|
resp = _a.sent();
|
|
@@ -126,22 +126,22 @@ var ContentMethods = /** @class */ (function () {
|
|
|
126
126
|
return [2 /*return*/, contentIDs_2];
|
|
127
127
|
case 3:
|
|
128
128
|
err_3 = _a.sent();
|
|
129
|
-
throw new exception_1.Exception("Unable to un-publish the content for id: "
|
|
129
|
+
throw new exception_1.Exception("Unable to un-publish the content for id: " + contentID, err_3);
|
|
130
130
|
case 4: return [2 /*return*/];
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
});
|
|
134
134
|
};
|
|
135
|
-
ContentMethods.prototype.contentRequestApproval = function (
|
|
136
|
-
|
|
135
|
+
ContentMethods.prototype.contentRequestApproval = function (contentID, guid, locale, comments) {
|
|
136
|
+
if (comments === void 0) { comments = null; }
|
|
137
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
137
138
|
var apiPath, resp, batchID_3, batch, contentIDs_3, err_4;
|
|
138
139
|
var _this = this;
|
|
139
|
-
if (comments === void 0) { comments = null; }
|
|
140
140
|
return __generator(this, function (_a) {
|
|
141
141
|
switch (_a.label) {
|
|
142
142
|
case 0:
|
|
143
143
|
_a.trys.push([0, 3, , 4]);
|
|
144
|
-
apiPath =
|
|
144
|
+
apiPath = locale + "/item/" + contentID + "/request-approval?comments=" + comments;
|
|
145
145
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
146
146
|
case 1:
|
|
147
147
|
resp = _a.sent();
|
|
@@ -159,22 +159,22 @@ var ContentMethods = /** @class */ (function () {
|
|
|
159
159
|
return [2 /*return*/, contentIDs_3];
|
|
160
160
|
case 3:
|
|
161
161
|
err_4 = _a.sent();
|
|
162
|
-
throw new exception_1.Exception("Unable to request approval the content for id: "
|
|
162
|
+
throw new exception_1.Exception("Unable to request approval the content for id: " + contentID, err_4);
|
|
163
163
|
case 4: return [2 /*return*/];
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
|
-
ContentMethods.prototype.approveContent = function (
|
|
169
|
-
|
|
168
|
+
ContentMethods.prototype.approveContent = function (contentID, guid, locale, comments) {
|
|
169
|
+
if (comments === void 0) { comments = null; }
|
|
170
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
170
171
|
var apiPath, resp, batchID_4, batch, contentIDs_4, err_5;
|
|
171
172
|
var _this = this;
|
|
172
|
-
if (comments === void 0) { comments = null; }
|
|
173
173
|
return __generator(this, function (_a) {
|
|
174
174
|
switch (_a.label) {
|
|
175
175
|
case 0:
|
|
176
176
|
_a.trys.push([0, 3, , 4]);
|
|
177
|
-
apiPath =
|
|
177
|
+
apiPath = locale + "/item/" + contentID + "/approve?comments=" + comments;
|
|
178
178
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
179
179
|
case 1:
|
|
180
180
|
resp = _a.sent();
|
|
@@ -192,22 +192,22 @@ var ContentMethods = /** @class */ (function () {
|
|
|
192
192
|
return [2 /*return*/, contentIDs_4];
|
|
193
193
|
case 3:
|
|
194
194
|
err_5 = _a.sent();
|
|
195
|
-
throw new exception_1.Exception("Unable to approve the content for id: "
|
|
195
|
+
throw new exception_1.Exception("Unable to approve the content for id: " + contentID, err_5);
|
|
196
196
|
case 4: return [2 /*return*/];
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
199
|
});
|
|
200
200
|
};
|
|
201
|
-
ContentMethods.prototype.declineContent = function (
|
|
202
|
-
|
|
201
|
+
ContentMethods.prototype.declineContent = function (contentID, guid, locale, comments) {
|
|
202
|
+
if (comments === void 0) { comments = null; }
|
|
203
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
203
204
|
var apiPath, resp, batchID_5, batch, contentIDs_5, err_6;
|
|
204
205
|
var _this = this;
|
|
205
|
-
if (comments === void 0) { comments = null; }
|
|
206
206
|
return __generator(this, function (_a) {
|
|
207
207
|
switch (_a.label) {
|
|
208
208
|
case 0:
|
|
209
209
|
_a.trys.push([0, 3, , 4]);
|
|
210
|
-
apiPath =
|
|
210
|
+
apiPath = locale + "/item/" + contentID + "/decline?comments=" + comments;
|
|
211
211
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
212
212
|
case 1:
|
|
213
213
|
resp = _a.sent();
|
|
@@ -225,22 +225,22 @@ var ContentMethods = /** @class */ (function () {
|
|
|
225
225
|
return [2 /*return*/, contentIDs_5];
|
|
226
226
|
case 3:
|
|
227
227
|
err_6 = _a.sent();
|
|
228
|
-
throw new exception_1.Exception("Unable to decline the content for id: "
|
|
228
|
+
throw new exception_1.Exception("Unable to decline the content for id: " + contentID, err_6);
|
|
229
229
|
case 4: return [2 /*return*/];
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
});
|
|
233
233
|
};
|
|
234
|
-
ContentMethods.prototype.deleteContent = function (
|
|
235
|
-
|
|
234
|
+
ContentMethods.prototype.deleteContent = function (contentID, guid, locale, comments) {
|
|
235
|
+
if (comments === void 0) { comments = null; }
|
|
236
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
236
237
|
var apiPath, resp, batchID_6, batch, contentIDs_6, err_7;
|
|
237
238
|
var _this = this;
|
|
238
|
-
if (comments === void 0) { comments = null; }
|
|
239
239
|
return __generator(this, function (_a) {
|
|
240
240
|
switch (_a.label) {
|
|
241
241
|
case 0:
|
|
242
242
|
_a.trys.push([0, 3, , 4]);
|
|
243
|
-
apiPath =
|
|
243
|
+
apiPath = locale + "/item/" + contentID + "?comments=" + comments;
|
|
244
244
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
245
245
|
case 1:
|
|
246
246
|
resp = _a.sent();
|
|
@@ -258,7 +258,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
258
258
|
return [2 /*return*/, contentIDs_6];
|
|
259
259
|
case 3:
|
|
260
260
|
err_7 = _a.sent();
|
|
261
|
-
throw new exception_1.Exception("Unable to delete the content for id: "
|
|
261
|
+
throw new exception_1.Exception("Unable to delete the content for id: " + contentID, err_7);
|
|
262
262
|
case 4: return [2 /*return*/];
|
|
263
263
|
}
|
|
264
264
|
});
|
|
@@ -272,7 +272,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
272
272
|
switch (_a.label) {
|
|
273
273
|
case 0:
|
|
274
274
|
_a.trys.push([0, 3, , 4]);
|
|
275
|
-
apiPath =
|
|
275
|
+
apiPath = locale + "/item";
|
|
276
276
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItem)];
|
|
277
277
|
case 1:
|
|
278
278
|
resp = _a.sent();
|
|
@@ -308,7 +308,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
308
308
|
switch (_a.label) {
|
|
309
309
|
case 0:
|
|
310
310
|
_a.trys.push([0, 3, , 4]);
|
|
311
|
-
apiPath =
|
|
311
|
+
apiPath = locale + "/item/multi";
|
|
312
312
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItems)];
|
|
313
313
|
case 1:
|
|
314
314
|
resp = _a.sent();
|
|
@@ -343,79 +343,79 @@ var ContentMethods = /** @class */ (function () {
|
|
|
343
343
|
switch (_a.label) {
|
|
344
344
|
case 0:
|
|
345
345
|
_a.trys.push([0, 2, , 3]);
|
|
346
|
-
apiPath =
|
|
346
|
+
apiPath = locale + "/list/" + referenceName + "?filter=" + listParams.filter + "&fields=" + listParams.fields + "&sortDirection=" + listParams.sortDirection + "&sortField=" + listParams.sortField + "&take=" + listParams.take + "&skip=" + listParams.skip;
|
|
347
347
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
348
348
|
case 1:
|
|
349
349
|
resp = _a.sent();
|
|
350
350
|
return [2 /*return*/, resp.data];
|
|
351
351
|
case 2:
|
|
352
352
|
err_10 = _a.sent();
|
|
353
|
-
throw new exception_1.Exception("Unable
|
|
353
|
+
throw new exception_1.Exception("Unable retrieve the content details for reference name: " + referenceName, err_10);
|
|
354
354
|
case 3: return [2 /*return*/];
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
357
|
});
|
|
358
358
|
};
|
|
359
|
-
ContentMethods.prototype.getContentList = function (
|
|
360
|
-
|
|
359
|
+
ContentMethods.prototype.getContentList = function (referenceName, guid, locale, listParams, filterObject) {
|
|
360
|
+
if (filterObject === void 0) { filterObject = null; }
|
|
361
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
361
362
|
var apiPath, resp, err_11;
|
|
362
|
-
if (filterObject === void 0) { filterObject = null; }
|
|
363
363
|
return __generator(this, function (_a) {
|
|
364
364
|
switch (_a.label) {
|
|
365
365
|
case 0:
|
|
366
366
|
_a.trys.push([0, 2, , 3]);
|
|
367
|
-
apiPath =
|
|
367
|
+
apiPath = locale + "/list/" + referenceName + "?fields=" + listParams.fields + "&sortDirection=" + listParams.sortDirection + "&sortField=" + listParams.sortField + "&take=" + listParams.take + "&skip=" + listParams.skip + "&showDeleted=" + listParams.showDeleted;
|
|
368
368
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, filterObject)];
|
|
369
369
|
case 1:
|
|
370
370
|
resp = _a.sent();
|
|
371
371
|
return [2 /*return*/, resp.data];
|
|
372
372
|
case 2:
|
|
373
373
|
err_11 = _a.sent();
|
|
374
|
-
throw new exception_1.Exception("Unable
|
|
374
|
+
throw new exception_1.Exception("Unable retrieve the content details for list with reference name: " + referenceName, err_11);
|
|
375
375
|
case 3: return [2 /*return*/];
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
378
|
});
|
|
379
379
|
};
|
|
380
|
-
ContentMethods.prototype.getContentHistory = function (
|
|
381
|
-
|
|
380
|
+
ContentMethods.prototype.getContentHistory = function (locale, guid, contentID, take, skip) {
|
|
381
|
+
if (take === void 0) { take = 50; }
|
|
382
|
+
if (skip === void 0) { skip = 0; }
|
|
383
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
382
384
|
var apiPath, resp, err_12;
|
|
383
|
-
if (take === void 0) { take = 50; }
|
|
384
|
-
if (skip === void 0) { skip = 0; }
|
|
385
385
|
return __generator(this, function (_a) {
|
|
386
386
|
switch (_a.label) {
|
|
387
387
|
case 0:
|
|
388
388
|
_a.trys.push([0, 2, , 3]);
|
|
389
|
-
apiPath =
|
|
389
|
+
apiPath = locale + "/item/" + contentID + "/history?take=" + take + "&skip=" + skip;
|
|
390
390
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
391
391
|
case 1:
|
|
392
392
|
resp = _a.sent();
|
|
393
393
|
return [2 /*return*/, resp.data];
|
|
394
394
|
case 2:
|
|
395
395
|
err_12 = _a.sent();
|
|
396
|
-
throw new exception_1.Exception("Unable to retrieve history for contentID: "
|
|
396
|
+
throw new exception_1.Exception("Unable to retrieve history for contentID: " + contentID);
|
|
397
397
|
case 3: return [2 /*return*/];
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
400
|
});
|
|
401
401
|
};
|
|
402
|
-
ContentMethods.prototype.getContentComments = function (
|
|
403
|
-
|
|
402
|
+
ContentMethods.prototype.getContentComments = function (locale, guid, contentID, take, skip) {
|
|
403
|
+
if (take === void 0) { take = 50; }
|
|
404
|
+
if (skip === void 0) { skip = 0; }
|
|
405
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
404
406
|
var apiPath, resp, err_13;
|
|
405
|
-
if (take === void 0) { take = 50; }
|
|
406
|
-
if (skip === void 0) { skip = 0; }
|
|
407
407
|
return __generator(this, function (_a) {
|
|
408
408
|
switch (_a.label) {
|
|
409
409
|
case 0:
|
|
410
410
|
_a.trys.push([0, 2, , 3]);
|
|
411
|
-
apiPath =
|
|
411
|
+
apiPath = locale + "/item/" + contentID + "/comments?take=" + take + "&skip=" + skip;
|
|
412
412
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
413
413
|
case 1:
|
|
414
414
|
resp = _a.sent();
|
|
415
415
|
return [2 /*return*/, resp.data];
|
|
416
416
|
case 2:
|
|
417
417
|
err_13 = _a.sent();
|
|
418
|
-
throw new exception_1.Exception("Unable to retrieve comments for contentID: "
|
|
418
|
+
throw new exception_1.Exception("Unable to retrieve comments for contentID: " + contentID);
|
|
419
419
|
case 3: return [2 /*return*/];
|
|
420
420
|
}
|
|
421
421
|
});
|
|
@@ -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;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "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 (
|
|
17
|
+
while (_) 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]) {
|
|
@@ -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;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "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 (
|
|
17
|
+
while (_) 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]) {
|
|
@@ -58,29 +58,29 @@ var InstanceUserMethods = /** @class */ (function () {
|
|
|
58
58
|
return [2 /*return*/, resp.data];
|
|
59
59
|
case 2:
|
|
60
60
|
err_1 = _a.sent();
|
|
61
|
-
throw new exception_1.Exception("Unable to
|
|
61
|
+
throw new exception_1.Exception("Unable to retrieve users.", err_1);
|
|
62
62
|
case 3: return [2 /*return*/];
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
-
InstanceUserMethods.prototype.saveUser = function (
|
|
68
|
-
|
|
67
|
+
InstanceUserMethods.prototype.saveUser = function (emailAddress, roles, guid, firstName, lastName) {
|
|
68
|
+
if (firstName === void 0) { firstName = null; }
|
|
69
|
+
if (lastName === void 0) { lastName = null; }
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
71
|
var apiPath, resp, err_2;
|
|
70
|
-
if (firstName === void 0) { firstName = null; }
|
|
71
|
-
if (lastName === void 0) { lastName = null; }
|
|
72
72
|
return __generator(this, function (_a) {
|
|
73
73
|
switch (_a.label) {
|
|
74
74
|
case 0:
|
|
75
75
|
_a.trys.push([0, 2, , 3]);
|
|
76
|
-
apiPath = "user/save?emailAddress="
|
|
76
|
+
apiPath = "user/save?emailAddress=" + emailAddress + "&firstName=" + firstName + "&lastName=" + lastName;
|
|
77
77
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, roles)];
|
|
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
|
|
83
|
+
throw new exception_1.Exception("Unable to retrieve users.", err_2);
|
|
84
84
|
case 3: return [2 /*return*/];
|
|
85
85
|
}
|
|
86
86
|
});
|
|
@@ -93,14 +93,14 @@ var InstanceUserMethods = /** @class */ (function () {
|
|
|
93
93
|
switch (_a.label) {
|
|
94
94
|
case 0:
|
|
95
95
|
_a.trys.push([0, 2, , 3]);
|
|
96
|
-
apiPath = "user/delete/"
|
|
96
|
+
apiPath = "user/delete/" + userId;
|
|
97
97
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
98
98
|
case 1:
|
|
99
99
|
resp = _a.sent();
|
|
100
100
|
return [2 /*return*/, resp.data];
|
|
101
101
|
case 2:
|
|
102
102
|
err_3 = _a.sent();
|
|
103
|
-
throw new exception_1.Exception("Unable to delete the user for id: "
|
|
103
|
+
throw new exception_1.Exception("Unable to delete the user for id: " + userId, err_3);
|
|
104
104
|
case 3: return [2 /*return*/];
|
|
105
105
|
}
|
|
106
106
|
});
|
|
@@ -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;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "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 (
|
|
17
|
+
while (_) 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,14 +51,14 @@ var ModelMethods = /** @class */ (function () {
|
|
|
51
51
|
switch (_a.label) {
|
|
52
52
|
case 0:
|
|
53
53
|
_a.trys.push([0, 2, , 3]);
|
|
54
|
-
apiPath = "model/"
|
|
54
|
+
apiPath = "model/" + id;
|
|
55
55
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
56
56
|
case 1:
|
|
57
57
|
resp = _a.sent();
|
|
58
58
|
return [2 /*return*/, resp.data];
|
|
59
59
|
case 2:
|
|
60
60
|
err_1 = _a.sent();
|
|
61
|
-
throw new exception_1.Exception("Unable to
|
|
61
|
+
throw new exception_1.Exception("Unable to retrieve model for id: " + id + ".", err_1);
|
|
62
62
|
case 3: return [2 /*return*/];
|
|
63
63
|
}
|
|
64
64
|
});
|
|
@@ -71,35 +71,35 @@ var ModelMethods = /** @class */ (function () {
|
|
|
71
71
|
switch (_a.label) {
|
|
72
72
|
case 0:
|
|
73
73
|
_a.trys.push([0, 2, , 3]);
|
|
74
|
-
apiPath = "model/"
|
|
74
|
+
apiPath = "model/" + referenceName;
|
|
75
75
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
76
76
|
case 1:
|
|
77
77
|
resp = _a.sent();
|
|
78
78
|
return [2 /*return*/, resp.data];
|
|
79
79
|
case 2:
|
|
80
80
|
err_2 = _a.sent();
|
|
81
|
-
throw new exception_1.Exception("Unable to
|
|
81
|
+
throw new exception_1.Exception("Unable to retrieve model for referenceName: " + referenceName + ".", err_2);
|
|
82
82
|
case 3: return [2 /*return*/];
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
|
-
ModelMethods.prototype.getContentModules = function (
|
|
88
|
-
|
|
87
|
+
ModelMethods.prototype.getContentModules = function (includeDefaults, guid, includeModules) {
|
|
88
|
+
if (includeModules === void 0) { includeModules = false; }
|
|
89
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
89
90
|
var apiPath, resp, err_3;
|
|
90
|
-
if (includeModules === void 0) { includeModules = false; }
|
|
91
91
|
return __generator(this, function (_a) {
|
|
92
92
|
switch (_a.label) {
|
|
93
93
|
case 0:
|
|
94
94
|
_a.trys.push([0, 2, , 3]);
|
|
95
|
-
apiPath = "model/list/"
|
|
95
|
+
apiPath = "model/list/" + includeDefaults + "?includeModules=" + includeModules;
|
|
96
96
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
97
97
|
case 1:
|
|
98
98
|
resp = _a.sent();
|
|
99
99
|
return [2 /*return*/, resp.data];
|
|
100
100
|
case 2:
|
|
101
101
|
err_3 = _a.sent();
|
|
102
|
-
throw new exception_1.Exception("Unable to
|
|
102
|
+
throw new exception_1.Exception("Unable to retrieve content modules.", err_3);
|
|
103
103
|
case 3: return [2 /*return*/];
|
|
104
104
|
}
|
|
105
105
|
});
|
|
@@ -112,14 +112,14 @@ var ModelMethods = /** @class */ (function () {
|
|
|
112
112
|
switch (_a.label) {
|
|
113
113
|
case 0:
|
|
114
114
|
_a.trys.push([0, 2, , 3]);
|
|
115
|
-
apiPath = "model/list-page-modules/"
|
|
115
|
+
apiPath = "model/list-page-modules/" + includeDefault;
|
|
116
116
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
117
117
|
case 1:
|
|
118
118
|
resp = _a.sent();
|
|
119
119
|
return [2 /*return*/, resp.data];
|
|
120
120
|
case 2:
|
|
121
121
|
err_4 = _a.sent();
|
|
122
|
-
throw new exception_1.Exception("Unable to
|
|
122
|
+
throw new exception_1.Exception("Unable to retrieve page modules.", err_4);
|
|
123
123
|
case 3: return [2 /*return*/];
|
|
124
124
|
}
|
|
125
125
|
});
|
|
@@ -152,7 +152,7 @@ var ModelMethods = /** @class */ (function () {
|
|
|
152
152
|
switch (_a.label) {
|
|
153
153
|
case 0:
|
|
154
154
|
_a.trys.push([0, 2, , 3]);
|
|
155
|
-
apiPath = "model/"
|
|
155
|
+
apiPath = "model/" + id;
|
|
156
156
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
157
157
|
case 1:
|
|
158
158
|
resp = _a.sent();
|