@agility/management-sdk 0.1.15 → 0.1.17
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 +680 -522
- package/dist/apiClient.d.ts +4 -0
- package/dist/apiClient.js +4 -0
- package/dist/apiMethods/apiClient.d.ts +19 -0
- package/dist/apiMethods/apiClient.js +24 -0
- package/dist/apiMethods/assetMethods.js +20 -20
- package/dist/apiMethods/batchMethods.js +3 -3
- package/dist/apiMethods/clientInstance.d.ts +2 -0
- package/dist/apiMethods/clientInstance.js +49 -11
- package/dist/apiMethods/containerMethods.js +13 -13
- package/dist/apiMethods/contentMethods.d.ts +8 -1
- package/dist/apiMethods/contentMethods.js +85 -26
- package/dist/apiMethods/instanceUserMethods.js +4 -4
- package/dist/apiMethods/modelMethods.js +8 -8
- package/dist/apiMethods/pageMethods.d.ts +4 -0
- package/dist/apiMethods/pageMethods.js +68 -24
- package/dist/apiMethods/serverUserMethods.d.ts +10 -0
- package/dist/apiMethods/serverUserMethods.js +89 -0
- package/dist/apiMethods/webhookMethods.d.ts +12 -0
- package/dist/apiMethods/webhookMethods.js +131 -0
- package/dist/index.js +5 -1
- package/dist/models/contentItemHistory.d.ts +20 -0
- package/dist/models/contentItemHistory.js +15 -0
- package/dist/models/contentListFilterModel.d.ts +26 -0
- package/dist/models/contentListFilterModel.js +33 -0
- package/dist/models/exception.js +2 -0
- package/dist/models/itemComments.d.ts +14 -0
- package/dist/models/itemComments.js +15 -0
- package/dist/models/listParams.d.ts +9 -0
- package/dist/models/listParams.js +16 -0
- package/dist/models/pageHistory.d.ts +21 -0
- package/dist/models/pageHistory.js +15 -0
- package/dist/models/serverUser.d.ts +21 -0
- package/dist/models/serverUser.js +9 -0
- package/dist/models/webhook.d.ts +9 -0
- package/dist/models/webhook.js +9 -0
- package/dist/models/websiteListing.d.ts +16 -0
- package/dist/models/websiteListing.js +9 -0
- package/dist/src/apiMethods/assetMethods.d.ts +14 -0
- package/dist/src/apiMethods/assetMethods.js +172 -0
- package/dist/src/apiMethods/batchMethods.d.ts +11 -0
- package/dist/src/apiMethods/batchMethods.js +117 -0
- package/dist/src/apiMethods/clientInstance.d.ts +8 -0
- package/dist/src/apiMethods/clientInstance.js +156 -0
- package/dist/src/apiMethods/containerMethods.d.ts +16 -0
- package/dist/src/apiMethods/containerMethods.js +189 -0
- package/dist/src/apiMethods/contentMethods.d.ts +20 -0
- package/dist/src/apiMethods/contentMethods.js +359 -0
- package/dist/src/apiMethods/instanceUserMethods.d.ts +13 -0
- package/dist/src/apiMethods/instanceUserMethods.js +111 -0
- package/dist/src/apiMethods/modelMethods.d.ts +13 -0
- package/dist/src/apiMethods/modelMethods.js +150 -0
- package/dist/src/apiMethods/pageMethods.d.ts +20 -0
- package/dist/src/apiMethods/pageMethods.js +323 -0
- package/dist/src/enums/batchOperationType.d.ts +19 -0
- package/dist/src/enums/batchOperationType.js +23 -0
- package/dist/src/enums/batchState..d.ts +7 -0
- package/dist/src/enums/batchState..js +11 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.js +30 -0
- package/dist/src/models/batch.d.ts +29 -0
- package/dist/src/models/batch.js +9 -0
- package/dist/src/models/batchItem.d.ts +13 -0
- package/dist/src/models/batchItem.js +9 -0
- package/dist/src/models/container.d.ts +47 -0
- package/dist/src/models/container.js +9 -0
- package/dist/src/models/contentItem.d.ts +37 -0
- package/dist/src/models/contentItem.js +33 -0
- package/dist/src/models/contentViewColumn.d.ts +8 -0
- package/dist/src/models/contentViewColumn.js +9 -0
- package/dist/src/models/exception.d.ts +4 -0
- package/dist/src/models/exception.js +28 -0
- package/dist/src/models/instanceRole.d.ts +7 -0
- package/dist/src/models/instanceRole.js +9 -0
- package/dist/src/models/instanceUser.d.ts +14 -0
- package/dist/src/models/instanceUser.js +9 -0
- package/dist/src/models/media.d.ts +30 -0
- package/dist/src/models/media.js +15 -0
- package/dist/src/models/model.d.ts +30 -0
- package/dist/src/models/model.js +15 -0
- package/dist/src/models/notification.d.ts +13 -0
- package/dist/src/models/notification.js +9 -0
- package/dist/src/models/options.d.ts +7 -0
- package/dist/src/models/options.js +9 -0
- package/dist/src/models/pageItem.d.ts +56 -0
- package/dist/src/models/pageItem.js +39 -0
- package/dist/src/models/sitemap.d.ts +20 -0
- package/dist/src/models/sitemap.js +15 -0
- package/dist/src/models/websiteUser.d.ts +22 -0
- package/dist/src/models/websiteUser.js +15 -0
- package/license.txt +20 -20
- package/package.json +40 -39
- package/tsconfig.json +14 -14
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
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]) {
|
|
@@ -53,14 +53,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
53
53
|
switch (_a.label) {
|
|
54
54
|
case 0:
|
|
55
55
|
_a.trys.push([0, 2, , 3]);
|
|
56
|
-
apiPath = locale
|
|
56
|
+
apiPath = "".concat(locale, "/item/").concat(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 retreive the content for id: "
|
|
63
|
+
throw new exception_1.Exception("Unable to retreive the content for id: ".concat(contentID), err_1);
|
|
64
64
|
case 3: return [2 /*return*/];
|
|
65
65
|
}
|
|
66
66
|
});
|
|
@@ -75,7 +75,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
75
75
|
switch (_a.label) {
|
|
76
76
|
case 0:
|
|
77
77
|
_a.trys.push([0, 3, , 4]);
|
|
78
|
-
apiPath = locale
|
|
78
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/publish?comments=").concat(comments);
|
|
79
79
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
80
80
|
case 1:
|
|
81
81
|
resp = _a.sent();
|
|
@@ -93,7 +93,7 @@ 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: ".concat(contentID), err_2);
|
|
97
97
|
case 4: return [2 /*return*/];
|
|
98
98
|
}
|
|
99
99
|
});
|
|
@@ -108,7 +108,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
108
108
|
switch (_a.label) {
|
|
109
109
|
case 0:
|
|
110
110
|
_a.trys.push([0, 3, , 4]);
|
|
111
|
-
apiPath = locale
|
|
111
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/unpublish?comments=").concat(comments);
|
|
112
112
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
113
113
|
case 1:
|
|
114
114
|
resp = _a.sent();
|
|
@@ -126,7 +126,7 @@ 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: ".concat(contentID), err_3);
|
|
130
130
|
case 4: return [2 /*return*/];
|
|
131
131
|
}
|
|
132
132
|
});
|
|
@@ -141,7 +141,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
141
141
|
switch (_a.label) {
|
|
142
142
|
case 0:
|
|
143
143
|
_a.trys.push([0, 3, , 4]);
|
|
144
|
-
apiPath = locale
|
|
144
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/request-approval?comments=").concat(comments);
|
|
145
145
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
146
146
|
case 1:
|
|
147
147
|
resp = _a.sent();
|
|
@@ -159,7 +159,7 @@ 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: ".concat(contentID), err_4);
|
|
163
163
|
case 4: return [2 /*return*/];
|
|
164
164
|
}
|
|
165
165
|
});
|
|
@@ -174,7 +174,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
174
174
|
switch (_a.label) {
|
|
175
175
|
case 0:
|
|
176
176
|
_a.trys.push([0, 3, , 4]);
|
|
177
|
-
apiPath = locale
|
|
177
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/approve?comments=").concat(comments);
|
|
178
178
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
179
179
|
case 1:
|
|
180
180
|
resp = _a.sent();
|
|
@@ -192,7 +192,7 @@ 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: ".concat(contentID), err_5);
|
|
196
196
|
case 4: return [2 /*return*/];
|
|
197
197
|
}
|
|
198
198
|
});
|
|
@@ -207,7 +207,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
207
207
|
switch (_a.label) {
|
|
208
208
|
case 0:
|
|
209
209
|
_a.trys.push([0, 3, , 4]);
|
|
210
|
-
apiPath = locale
|
|
210
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/decline?comments=").concat(comments);
|
|
211
211
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
212
212
|
case 1:
|
|
213
213
|
resp = _a.sent();
|
|
@@ -225,7 +225,7 @@ 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: ".concat(contentID), err_6);
|
|
229
229
|
case 4: return [2 /*return*/];
|
|
230
230
|
}
|
|
231
231
|
});
|
|
@@ -240,7 +240,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
240
240
|
switch (_a.label) {
|
|
241
241
|
case 0:
|
|
242
242
|
_a.trys.push([0, 3, , 4]);
|
|
243
|
-
apiPath = locale
|
|
243
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "?comments=").concat(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: ".concat(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 = locale
|
|
275
|
+
apiPath = "".concat(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();
|
|
@@ -304,7 +304,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
304
304
|
switch (_a.label) {
|
|
305
305
|
case 0:
|
|
306
306
|
_a.trys.push([0, 3, , 4]);
|
|
307
|
-
apiPath = locale
|
|
307
|
+
apiPath = "".concat(locale, "/item/multi");
|
|
308
308
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItems)];
|
|
309
309
|
case 1:
|
|
310
310
|
resp = _a.sent();
|
|
@@ -328,27 +328,86 @@ var ContentMethods = /** @class */ (function () {
|
|
|
328
328
|
});
|
|
329
329
|
});
|
|
330
330
|
};
|
|
331
|
-
ContentMethods.prototype.getContentItems = function (referenceName, guid, locale,
|
|
332
|
-
if (filter === void 0) { filter = ''; }
|
|
333
|
-
if (fields === void 0) { fields = null; }
|
|
334
|
-
if (sortDirection === void 0) { sortDirection = null; }
|
|
335
|
-
if (sortField === void 0) { sortField = null; }
|
|
336
|
-
if (take === void 0) { take = 50; }
|
|
337
|
-
if (skip === void 0) { skip = 0; }
|
|
331
|
+
ContentMethods.prototype.getContentItems = function (referenceName, guid, locale, listParams) {
|
|
338
332
|
return __awaiter(this, void 0, void 0, function () {
|
|
339
333
|
var apiPath, resp, err_10;
|
|
340
334
|
return __generator(this, function (_a) {
|
|
341
335
|
switch (_a.label) {
|
|
342
336
|
case 0:
|
|
343
337
|
_a.trys.push([0, 2, , 3]);
|
|
344
|
-
apiPath = locale
|
|
338
|
+
apiPath = "".concat(locale, "/list/").concat(referenceName, "?filter=").concat(listParams.filter, "&fields=").concat(listParams.fields, "&sortDirection=").concat(listParams.sortDirection, "&sortField=").concat(listParams.sortField, "&take=").concat(listParams.take, "&skip=").concat(listParams.skip);
|
|
345
339
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
346
340
|
case 1:
|
|
347
341
|
resp = _a.sent();
|
|
348
342
|
return [2 /*return*/, resp.data];
|
|
349
343
|
case 2:
|
|
350
344
|
err_10 = _a.sent();
|
|
351
|
-
throw new exception_1.Exception("Unable retreive the content details for reference name: "
|
|
345
|
+
throw new exception_1.Exception("Unable retreive the content details for reference name: ".concat(referenceName), err_10);
|
|
346
|
+
case 3: return [2 /*return*/];
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
ContentMethods.prototype.getContentList = function (referenceName, guid, locale, listParams, filterObject) {
|
|
352
|
+
if (filterObject === void 0) { filterObject = null; }
|
|
353
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
354
|
+
var apiPath, resp, err_11;
|
|
355
|
+
return __generator(this, function (_a) {
|
|
356
|
+
switch (_a.label) {
|
|
357
|
+
case 0:
|
|
358
|
+
_a.trys.push([0, 2, , 3]);
|
|
359
|
+
apiPath = "".concat(locale, "/list/").concat(referenceName, "?fields=").concat(listParams.fields, "&sortDirection=").concat(listParams.sortDirection, "&sortField=").concat(listParams.sortField, "&take=").concat(listParams.take, "&skip=").concat(listParams.skip, "&showDeleted=").concat(listParams.showDeleted);
|
|
360
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, filterObject)];
|
|
361
|
+
case 1:
|
|
362
|
+
resp = _a.sent();
|
|
363
|
+
return [2 /*return*/, resp.data];
|
|
364
|
+
case 2:
|
|
365
|
+
err_11 = _a.sent();
|
|
366
|
+
throw new exception_1.Exception("Unable retreive the content details for list with reference name: ".concat(referenceName), err_11);
|
|
367
|
+
case 3: return [2 /*return*/];
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
};
|
|
372
|
+
ContentMethods.prototype.getContentHistory = function (locale, guid, contentID, take, skip) {
|
|
373
|
+
if (take === void 0) { take = 50; }
|
|
374
|
+
if (skip === void 0) { skip = 0; }
|
|
375
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
376
|
+
var apiPath, resp, err_12;
|
|
377
|
+
return __generator(this, function (_a) {
|
|
378
|
+
switch (_a.label) {
|
|
379
|
+
case 0:
|
|
380
|
+
_a.trys.push([0, 2, , 3]);
|
|
381
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/history?take=").concat(take, "&skip=").concat(skip);
|
|
382
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
383
|
+
case 1:
|
|
384
|
+
resp = _a.sent();
|
|
385
|
+
return [2 /*return*/, resp.data];
|
|
386
|
+
case 2:
|
|
387
|
+
err_12 = _a.sent();
|
|
388
|
+
throw new exception_1.Exception("Unable to retrieve history for contentID: ".concat(contentID));
|
|
389
|
+
case 3: return [2 /*return*/];
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
});
|
|
393
|
+
};
|
|
394
|
+
ContentMethods.prototype.getContentComments = function (locale, guid, contentID, take, skip) {
|
|
395
|
+
if (take === void 0) { take = 50; }
|
|
396
|
+
if (skip === void 0) { skip = 0; }
|
|
397
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
398
|
+
var apiPath, resp, err_13;
|
|
399
|
+
return __generator(this, function (_a) {
|
|
400
|
+
switch (_a.label) {
|
|
401
|
+
case 0:
|
|
402
|
+
_a.trys.push([0, 2, , 3]);
|
|
403
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/comments?take=").concat(take, "&skip=").concat(skip);
|
|
404
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
405
|
+
case 1:
|
|
406
|
+
resp = _a.sent();
|
|
407
|
+
return [2 /*return*/, resp.data];
|
|
408
|
+
case 2:
|
|
409
|
+
err_13 = _a.sent();
|
|
410
|
+
throw new exception_1.Exception("Unable to retrieve comments for contentID: ".concat(contentID));
|
|
352
411
|
case 3: return [2 /*return*/];
|
|
353
412
|
}
|
|
354
413
|
});
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
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]) {
|
|
@@ -73,7 +73,7 @@ var InstanceUserMethods = /** @class */ (function () {
|
|
|
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=".concat(emailAddress, "&firstName=").concat(firstName, "&lastName=").concat(lastName);
|
|
77
77
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, roles)];
|
|
78
78
|
case 1:
|
|
79
79
|
resp = _a.sent();
|
|
@@ -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/".concat(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: ".concat(userId), err_3);
|
|
104
104
|
case 3: return [2 /*return*/];
|
|
105
105
|
}
|
|
106
106
|
});
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
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,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/".concat(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 retreive model for id: "
|
|
61
|
+
throw new exception_1.Exception("Unable to retreive model for id: ".concat(id, "."), err_1);
|
|
62
62
|
case 3: return [2 /*return*/];
|
|
63
63
|
}
|
|
64
64
|
});
|
|
@@ -71,14 +71,14 @@ 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/".concat(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 retreive model for referenceName: "
|
|
81
|
+
throw new exception_1.Exception("Unable to retreive model for referenceName: ".concat(referenceName, "."), err_2);
|
|
82
82
|
case 3: return [2 /*return*/];
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -92,7 +92,7 @@ var ModelMethods = /** @class */ (function () {
|
|
|
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/".concat(includeDefaults, "?includeModules=").concat(includeModules);
|
|
96
96
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
97
97
|
case 1:
|
|
98
98
|
resp = _a.sent();
|
|
@@ -112,7 +112,7 @@ 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/".concat(includeDefault);
|
|
116
116
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
117
117
|
case 1:
|
|
118
118
|
resp = _a.sent();
|
|
@@ -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/".concat(id);
|
|
156
156
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
157
157
|
case 1:
|
|
158
158
|
resp = _a.sent();
|
|
@@ -5,6 +5,8 @@ import { Sitemap } from "../models/sitemap";
|
|
|
5
5
|
import { BatchMethods } from "./batchMethods";
|
|
6
6
|
import { PageModel } from "../models/pageModel";
|
|
7
7
|
import { ContentSectionDefinition } from "../models/contentSectionDefinition";
|
|
8
|
+
import { PageHistory } from "../models/pageHistory";
|
|
9
|
+
import { ItemComments } from "../models/itemComments";
|
|
8
10
|
export declare class PageMethods {
|
|
9
11
|
_options: Options;
|
|
10
12
|
_clientInstance: ClientInstance;
|
|
@@ -25,4 +27,6 @@ export declare class PageMethods {
|
|
|
25
27
|
declinePage(pageID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
26
28
|
deletePage(pageID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
27
29
|
savePage(pageItem: PageItem, guid: string, locale: string, parentPageID?: number, placeBeforePageItemID?: number): Promise<number[]>;
|
|
30
|
+
getPageHistory(locale: string, guid: string, pageID: number, take?: number, skip?: number): Promise<PageHistory>;
|
|
31
|
+
getPageComments(locale: string, guid: string, pageID: number, take?: number, skip?: number): Promise<ItemComments>;
|
|
28
32
|
}
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
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]) {
|
|
@@ -53,7 +53,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
53
53
|
switch (_a.label) {
|
|
54
54
|
case 0:
|
|
55
55
|
_a.trys.push([0, 2, , 3]);
|
|
56
|
-
apiPath = locale
|
|
56
|
+
apiPath = "".concat(locale, "/sitemap");
|
|
57
57
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
58
58
|
case 1:
|
|
59
59
|
resp = _a.sent();
|
|
@@ -76,7 +76,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
76
76
|
_a.trys.push([0, 2, , 3]);
|
|
77
77
|
if (!searchFilter)
|
|
78
78
|
searchFilter = '';
|
|
79
|
-
apiPath = locale
|
|
79
|
+
apiPath = "".concat(locale, "/page/templates?includeModuleZones=").concat(includeModuleZones, "&searchFilter=").concat(searchFilter);
|
|
80
80
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
81
81
|
case 1:
|
|
82
82
|
resp = _a.sent();
|
|
@@ -96,7 +96,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
96
96
|
switch (_a.label) {
|
|
97
97
|
case 0:
|
|
98
98
|
_a.trys.push([0, 2, , 3]);
|
|
99
|
-
apiPath = locale
|
|
99
|
+
apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId);
|
|
100
100
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
101
101
|
case 1:
|
|
102
102
|
resp = _a.sent();
|
|
@@ -116,7 +116,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
116
116
|
switch (_a.label) {
|
|
117
117
|
case 0:
|
|
118
118
|
_a.trys.push([0, 2, , 3]);
|
|
119
|
-
apiPath = locale
|
|
119
|
+
apiPath = "".concat(locale, "/page/template/").concat(templateName);
|
|
120
120
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
121
121
|
case 1:
|
|
122
122
|
resp = _a.sent();
|
|
@@ -136,7 +136,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
136
136
|
switch (_a.label) {
|
|
137
137
|
case 0:
|
|
138
138
|
_a.trys.push([0, 2, , 3]);
|
|
139
|
-
apiPath = locale
|
|
139
|
+
apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId);
|
|
140
140
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
141
141
|
case 1:
|
|
142
142
|
resp = _a.sent();
|
|
@@ -156,7 +156,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
156
156
|
switch (_a.label) {
|
|
157
157
|
case 0:
|
|
158
158
|
_a.trys.push([0, 2, , 3]);
|
|
159
|
-
apiPath = locale
|
|
159
|
+
apiPath = "".concat(locale, "/page/template/items/").concat(id);
|
|
160
160
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
161
161
|
case 1:
|
|
162
162
|
resp = _a.sent();
|
|
@@ -176,7 +176,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
176
176
|
switch (_a.label) {
|
|
177
177
|
case 0:
|
|
178
178
|
_a.trys.push([0, 2, , 3]);
|
|
179
|
-
apiPath = locale
|
|
179
|
+
apiPath = "".concat(locale, "/page/template");
|
|
180
180
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageModel)];
|
|
181
181
|
case 1:
|
|
182
182
|
resp = _a.sent();
|
|
@@ -196,14 +196,14 @@ var PageMethods = /** @class */ (function () {
|
|
|
196
196
|
switch (_a.label) {
|
|
197
197
|
case 0:
|
|
198
198
|
_a.trys.push([0, 2, , 3]);
|
|
199
|
-
apiPath = locale
|
|
199
|
+
apiPath = "".concat(locale, "/page/").concat(pageID);
|
|
200
200
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
201
201
|
case 1:
|
|
202
202
|
resp = _a.sent();
|
|
203
203
|
return [2 /*return*/, resp.data];
|
|
204
204
|
case 2:
|
|
205
205
|
err_8 = _a.sent();
|
|
206
|
-
throw new exception_1.Exception("Unable to retreive page for id "
|
|
206
|
+
throw new exception_1.Exception("Unable to retreive page for id ".concat(pageID, "."), err_8);
|
|
207
207
|
case 3: return [2 /*return*/];
|
|
208
208
|
}
|
|
209
209
|
});
|
|
@@ -218,7 +218,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
218
218
|
switch (_a.label) {
|
|
219
219
|
case 0:
|
|
220
220
|
_a.trys.push([0, 3, , 4]);
|
|
221
|
-
apiPath = locale
|
|
221
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/publish?comments=").concat(comments);
|
|
222
222
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
223
223
|
case 1:
|
|
224
224
|
resp = _a.sent();
|
|
@@ -236,7 +236,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
236
236
|
return [2 /*return*/, pageIDs_1];
|
|
237
237
|
case 3:
|
|
238
238
|
err_9 = _a.sent();
|
|
239
|
-
throw new exception_1.Exception("Unable to publish the page for id: "
|
|
239
|
+
throw new exception_1.Exception("Unable to publish the page for id: ".concat(pageID), err_9);
|
|
240
240
|
case 4: return [2 /*return*/];
|
|
241
241
|
}
|
|
242
242
|
});
|
|
@@ -251,7 +251,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
251
251
|
switch (_a.label) {
|
|
252
252
|
case 0:
|
|
253
253
|
_a.trys.push([0, 3, , 4]);
|
|
254
|
-
apiPath = locale
|
|
254
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/unpublish?comments=").concat(comments);
|
|
255
255
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
256
256
|
case 1:
|
|
257
257
|
resp = _a.sent();
|
|
@@ -269,7 +269,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
269
269
|
return [2 /*return*/, pageIDs_2];
|
|
270
270
|
case 3:
|
|
271
271
|
err_10 = _a.sent();
|
|
272
|
-
throw new exception_1.Exception("Unable to un-publish the page for id: "
|
|
272
|
+
throw new exception_1.Exception("Unable to un-publish the page for id: ".concat(pageID), err_10);
|
|
273
273
|
case 4: return [2 /*return*/];
|
|
274
274
|
}
|
|
275
275
|
});
|
|
@@ -284,7 +284,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
284
284
|
switch (_a.label) {
|
|
285
285
|
case 0:
|
|
286
286
|
_a.trys.push([0, 3, , 4]);
|
|
287
|
-
apiPath = locale
|
|
287
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/request-approval?comments=").concat(comments);
|
|
288
288
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
289
289
|
case 1:
|
|
290
290
|
resp = _a.sent();
|
|
@@ -302,7 +302,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
302
302
|
return [2 /*return*/, pageIDs_3];
|
|
303
303
|
case 3:
|
|
304
304
|
err_11 = _a.sent();
|
|
305
|
-
throw new exception_1.Exception("Unable to request approval the page for id: "
|
|
305
|
+
throw new exception_1.Exception("Unable to request approval the page for id: ".concat(pageID), err_11);
|
|
306
306
|
case 4: return [2 /*return*/];
|
|
307
307
|
}
|
|
308
308
|
});
|
|
@@ -317,7 +317,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
317
317
|
switch (_a.label) {
|
|
318
318
|
case 0:
|
|
319
319
|
_a.trys.push([0, 3, , 4]);
|
|
320
|
-
apiPath = locale
|
|
320
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/approve?comments=").concat(comments);
|
|
321
321
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
322
322
|
case 1:
|
|
323
323
|
resp = _a.sent();
|
|
@@ -335,7 +335,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
335
335
|
return [2 /*return*/, pageIDs_4];
|
|
336
336
|
case 3:
|
|
337
337
|
err_12 = _a.sent();
|
|
338
|
-
throw new exception_1.Exception("Unable to approve the page for id: "
|
|
338
|
+
throw new exception_1.Exception("Unable to approve the page for id: ".concat(pageID), err_12);
|
|
339
339
|
case 4: return [2 /*return*/];
|
|
340
340
|
}
|
|
341
341
|
});
|
|
@@ -350,7 +350,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
350
350
|
switch (_a.label) {
|
|
351
351
|
case 0:
|
|
352
352
|
_a.trys.push([0, 3, , 4]);
|
|
353
|
-
apiPath = locale
|
|
353
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/decline?comments=").concat(comments);
|
|
354
354
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
355
355
|
case 1:
|
|
356
356
|
resp = _a.sent();
|
|
@@ -368,7 +368,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
368
368
|
return [2 /*return*/, pageIDs_5];
|
|
369
369
|
case 3:
|
|
370
370
|
err_13 = _a.sent();
|
|
371
|
-
throw new exception_1.Exception("Unable to decline the page for id: "
|
|
371
|
+
throw new exception_1.Exception("Unable to decline the page for id: ".concat(pageID), err_13);
|
|
372
372
|
case 4: return [2 /*return*/];
|
|
373
373
|
}
|
|
374
374
|
});
|
|
@@ -383,7 +383,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
383
383
|
switch (_a.label) {
|
|
384
384
|
case 0:
|
|
385
385
|
_a.trys.push([0, 3, , 4]);
|
|
386
|
-
apiPath = locale
|
|
386
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "?comments=").concat(comments);
|
|
387
387
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
388
388
|
case 1:
|
|
389
389
|
resp = _a.sent();
|
|
@@ -401,7 +401,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
401
401
|
return [2 /*return*/, pageIDs_6];
|
|
402
402
|
case 3:
|
|
403
403
|
err_14 = _a.sent();
|
|
404
|
-
throw new exception_1.Exception("Unable to delete the page for id: "
|
|
404
|
+
throw new exception_1.Exception("Unable to delete the page for id: ".concat(pageID), err_14);
|
|
405
405
|
case 4: return [2 /*return*/];
|
|
406
406
|
}
|
|
407
407
|
});
|
|
@@ -417,7 +417,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
417
417
|
switch (_a.label) {
|
|
418
418
|
case 0:
|
|
419
419
|
_a.trys.push([0, 3, , 4]);
|
|
420
|
-
apiPath = locale
|
|
420
|
+
apiPath = "".concat(locale, "/page?parentPageID=").concat(parentPageID, "&placeBeforePageItemID=").concat(placeBeforePageItemID);
|
|
421
421
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageItem)];
|
|
422
422
|
case 1:
|
|
423
423
|
resp = _a.sent();
|
|
@@ -435,12 +435,56 @@ var PageMethods = /** @class */ (function () {
|
|
|
435
435
|
return [2 /*return*/, pageIDs_7];
|
|
436
436
|
case 3:
|
|
437
437
|
err_15 = _a.sent();
|
|
438
|
-
throw new exception_1.Exception("Unable to create page. "
|
|
438
|
+
throw new exception_1.Exception("Unable to create page. ".concat(err_15), err_15);
|
|
439
439
|
case 4: return [2 /*return*/];
|
|
440
440
|
}
|
|
441
441
|
});
|
|
442
442
|
});
|
|
443
443
|
};
|
|
444
|
+
PageMethods.prototype.getPageHistory = function (locale, guid, pageID, take, skip) {
|
|
445
|
+
if (take === void 0) { take = 50; }
|
|
446
|
+
if (skip === void 0) { skip = 0; }
|
|
447
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
448
|
+
var apiPath, resp, err_16;
|
|
449
|
+
return __generator(this, function (_a) {
|
|
450
|
+
switch (_a.label) {
|
|
451
|
+
case 0:
|
|
452
|
+
_a.trys.push([0, 2, , 3]);
|
|
453
|
+
apiPath = "".concat(locale, "/item/").concat(pageID, "/history?take=").concat(take, "&skip=").concat(skip);
|
|
454
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
455
|
+
case 1:
|
|
456
|
+
resp = _a.sent();
|
|
457
|
+
return [2 /*return*/, resp.data];
|
|
458
|
+
case 2:
|
|
459
|
+
err_16 = _a.sent();
|
|
460
|
+
throw new exception_1.Exception("Unable to retrieve history for pageID: ".concat(pageID));
|
|
461
|
+
case 3: return [2 /*return*/];
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
});
|
|
465
|
+
};
|
|
466
|
+
PageMethods.prototype.getPageComments = function (locale, guid, pageID, take, skip) {
|
|
467
|
+
if (take === void 0) { take = 50; }
|
|
468
|
+
if (skip === void 0) { skip = 0; }
|
|
469
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
470
|
+
var apiPath, resp, err_17;
|
|
471
|
+
return __generator(this, function (_a) {
|
|
472
|
+
switch (_a.label) {
|
|
473
|
+
case 0:
|
|
474
|
+
_a.trys.push([0, 2, , 3]);
|
|
475
|
+
apiPath = "".concat(locale, "/item/").concat(pageID, "/history?take=").concat(take, "&skip=").concat(skip);
|
|
476
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
477
|
+
case 1:
|
|
478
|
+
resp = _a.sent();
|
|
479
|
+
return [2 /*return*/, resp.data];
|
|
480
|
+
case 2:
|
|
481
|
+
err_17 = _a.sent();
|
|
482
|
+
throw new exception_1.Exception("Unable to retrieve history for pageID: ".concat(pageID));
|
|
483
|
+
case 3: return [2 /*return*/];
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
};
|
|
444
488
|
return PageMethods;
|
|
445
489
|
}());
|
|
446
490
|
exports.PageMethods = PageMethods;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Options } from "../models/options";
|
|
2
|
+
import { ServerUser } from "../models/serverUser";
|
|
3
|
+
import { ClientInstance } from "./clientInstance";
|
|
4
|
+
export declare class ServerUserMethods {
|
|
5
|
+
_options: Options;
|
|
6
|
+
_clientInstance: ClientInstance;
|
|
7
|
+
constructor(options: Options);
|
|
8
|
+
me(guid: string): Promise<ServerUser>;
|
|
9
|
+
you(guid: string, serverUserID: number): Promise<any>;
|
|
10
|
+
}
|