@agility/management-sdk 0.1.11 → 0.1.13
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 +522 -522
- package/dist/apiClient.d.ts +19 -19
- package/dist/apiClient.js +24 -24
- package/dist/apiMethods/apiClient.d.ts +19 -0
- package/dist/apiMethods/apiClient.js +24 -0
- package/dist/apiMethods/assetMethods.d.ts +24 -24
- package/dist/apiMethods/assetMethods.js +315 -315
- package/dist/apiMethods/batchMethods.d.ts +11 -11
- package/dist/apiMethods/batchMethods.js +117 -117
- package/dist/apiMethods/clientInstance.d.ts +18 -18
- package/dist/apiMethods/clientInstance.js +168 -168
- package/dist/apiMethods/containerMethods.d.ts +16 -16
- package/dist/apiMethods/containerMethods.js +189 -189
- package/dist/apiMethods/contentMethods.d.ts +20 -20
- package/dist/apiMethods/contentMethods.js +359 -359
- package/dist/apiMethods/instanceUserMethods.d.ts +13 -13
- package/dist/apiMethods/instanceUserMethods.js +111 -111
- package/dist/apiMethods/modelMethods.d.ts +14 -14
- package/dist/apiMethods/modelMethods.js +170 -170
- package/dist/apiMethods/pageMethods.d.ts +28 -20
- package/dist/apiMethods/pageMethods.js +446 -323
- package/dist/enums/assetGroupingType.d.ts +3 -3
- package/dist/enums/assetGroupingType.js +7 -7
- package/dist/enums/batchOperationType.d.ts +19 -19
- package/dist/enums/batchOperationType.js +23 -23
- package/dist/enums/batchState..d.ts +7 -7
- package/dist/enums/batchState..js +11 -11
- package/dist/enums/pageItemTemplateType.d.ts +4 -0
- package/dist/enums/pageItemTemplateType.js +8 -0
- package/dist/index.d.ts +23 -19
- package/dist/index.js +39 -31
- package/dist/models/assetContainer.d.ts +7 -7
- package/dist/models/assetContainer.js +9 -9
- package/dist/models/assetGalleries.d.ts +5 -5
- package/dist/models/assetGalleries.js +9 -9
- package/dist/models/assetMediaGrouping.d.ts +17 -17
- package/dist/models/assetMediaGrouping.js +9 -9
- package/dist/models/assetMediaGroupingMetaData.d.ts +4 -4
- package/dist/models/assetMediaGroupingMetaData.js +9 -9
- package/dist/models/batch.d.ts +29 -29
- package/dist/models/batch.js +9 -9
- package/dist/models/batchItem.d.ts +13 -13
- package/dist/models/batchItem.js +9 -9
- package/dist/models/container.d.ts +47 -47
- package/dist/models/container.js +9 -9
- package/dist/models/contentItem.d.ts +37 -37
- package/dist/models/contentItem.js +33 -33
- package/dist/models/contentSectionDefaultModule.d.ts +7 -0
- package/dist/models/contentSectionDefaultModule.js +9 -0
- package/dist/models/contentSectionDefinition.d.ts +35 -0
- package/dist/models/contentSectionDefinition.js +9 -0
- package/dist/models/contentViewColumn.d.ts +8 -8
- package/dist/models/contentViewColumn.js +9 -9
- package/dist/models/exception.d.ts +4 -4
- package/dist/models/exception.js +28 -26
- package/dist/models/instanceRole.d.ts +7 -7
- package/dist/models/instanceRole.js +9 -9
- package/dist/models/instanceUser.d.ts +14 -14
- package/dist/models/instanceUser.js +9 -9
- package/dist/models/media.d.ts +30 -30
- package/dist/models/media.js +15 -15
- package/dist/models/model.d.ts +30 -30
- package/dist/models/model.js +15 -15
- package/dist/models/notification.d.ts +13 -13
- package/dist/models/notification.js +9 -9
- package/dist/models/options.d.ts +7 -7
- package/dist/models/options.js +9 -9
- package/dist/models/pageItem.d.ts +56 -56
- package/dist/models/pageItem.js +39 -39
- package/dist/models/pageModel.d.ts +14 -0
- package/dist/models/pageModel.js +9 -0
- package/dist/models/sharedModule.d.ts +7 -0
- package/dist/models/sharedModule.js +9 -0
- package/dist/models/sitemap.d.ts +20 -20
- package/dist/models/sitemap.js +15 -15
- package/dist/models/websiteUser.d.ts +22 -22
- package/dist/models/websiteUser.js +15 -15
- 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 +39 -39
- package/tsconfig.json +14 -14
|
@@ -1,323 +1,446 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
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 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
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
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.PageMethods = void 0;
|
|
40
|
-
var clientInstance_1 = require("./clientInstance");
|
|
41
|
-
var batchMethods_1 = require("./batchMethods");
|
|
42
|
-
var exception_1 = require("../models/exception");
|
|
43
|
-
var PageMethods = /** @class */ (function () {
|
|
44
|
-
function PageMethods(options) {
|
|
45
|
-
this._options = options;
|
|
46
|
-
this._clientInstance = new clientInstance_1.ClientInstance(
|
|
47
|
-
this._batchMethods = new batchMethods_1.BatchMethods(this._options);
|
|
48
|
-
}
|
|
49
|
-
PageMethods.prototype.getSitemap = function (guid, locale) {
|
|
50
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
-
var apiPath, resp, err_1;
|
|
52
|
-
return __generator(this, function (_a) {
|
|
53
|
-
switch (_a.label) {
|
|
54
|
-
case 0:
|
|
55
|
-
_a.trys.push([0, 2, , 3]);
|
|
56
|
-
apiPath = locale
|
|
57
|
-
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
58
|
-
case 1:
|
|
59
|
-
resp = _a.sent();
|
|
60
|
-
return [2 /*return*/, resp.data];
|
|
61
|
-
case 2:
|
|
62
|
-
err_1 = _a.sent();
|
|
63
|
-
throw new exception_1.Exception("Unable to retreive sitemap.", err_1);
|
|
64
|
-
case 3: return [2 /*return*/];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
PageMethods.prototype.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return [
|
|
81
|
-
case
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
case
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
case
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
case 3:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
case
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
case
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
return [
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
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 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.PageMethods = void 0;
|
|
40
|
+
var clientInstance_1 = require("./clientInstance");
|
|
41
|
+
var batchMethods_1 = require("./batchMethods");
|
|
42
|
+
var exception_1 = require("../models/exception");
|
|
43
|
+
var PageMethods = /** @class */ (function () {
|
|
44
|
+
function PageMethods(options) {
|
|
45
|
+
this._options = options;
|
|
46
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
47
|
+
this._batchMethods = new batchMethods_1.BatchMethods(this._options);
|
|
48
|
+
}
|
|
49
|
+
PageMethods.prototype.getSitemap = function (guid, locale) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
var apiPath, resp, err_1;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
switch (_a.label) {
|
|
54
|
+
case 0:
|
|
55
|
+
_a.trys.push([0, 2, , 3]);
|
|
56
|
+
apiPath = "".concat(locale, "/sitemap");
|
|
57
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
58
|
+
case 1:
|
|
59
|
+
resp = _a.sent();
|
|
60
|
+
return [2 /*return*/, resp.data];
|
|
61
|
+
case 2:
|
|
62
|
+
err_1 = _a.sent();
|
|
63
|
+
throw new exception_1.Exception("Unable to retreive sitemap.", err_1);
|
|
64
|
+
case 3: return [2 /*return*/];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
PageMethods.prototype.getPageTemplates = function (guid, locale, includeModuleZones, searchFilter) {
|
|
70
|
+
if (searchFilter === void 0) { searchFilter = null; }
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var apiPath, resp, err_2;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
_a.trys.push([0, 2, , 3]);
|
|
77
|
+
if (!searchFilter)
|
|
78
|
+
searchFilter = '';
|
|
79
|
+
apiPath = "".concat(locale, "/page/templates?includeModuleZones=").concat(includeModuleZones, "&searchFilter=").concat(searchFilter);
|
|
80
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
81
|
+
case 1:
|
|
82
|
+
resp = _a.sent();
|
|
83
|
+
return [2 /*return*/, resp.data];
|
|
84
|
+
case 2:
|
|
85
|
+
err_2 = _a.sent();
|
|
86
|
+
throw new exception_1.Exception("Unable to retreive Page Templates.", err_2);
|
|
87
|
+
case 3: return [2 /*return*/];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
PageMethods.prototype.getPageTemplate = function (guid, locale, pageTemplateId) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
+
var apiPath, resp, err_3;
|
|
95
|
+
return __generator(this, function (_a) {
|
|
96
|
+
switch (_a.label) {
|
|
97
|
+
case 0:
|
|
98
|
+
_a.trys.push([0, 2, , 3]);
|
|
99
|
+
apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId);
|
|
100
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
101
|
+
case 1:
|
|
102
|
+
resp = _a.sent();
|
|
103
|
+
return [2 /*return*/, resp.data];
|
|
104
|
+
case 2:
|
|
105
|
+
err_3 = _a.sent();
|
|
106
|
+
throw new exception_1.Exception("Unable to retreive Page Template.", err_3);
|
|
107
|
+
case 3: return [2 /*return*/];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
PageMethods.prototype.getPageTemplateName = function (guid, locale, templateName) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
var apiPath, resp, err_4;
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
switch (_a.label) {
|
|
117
|
+
case 0:
|
|
118
|
+
_a.trys.push([0, 2, , 3]);
|
|
119
|
+
apiPath = "".concat(locale, "/page/template/").concat(templateName);
|
|
120
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
121
|
+
case 1:
|
|
122
|
+
resp = _a.sent();
|
|
123
|
+
return [2 /*return*/, resp.data];
|
|
124
|
+
case 2:
|
|
125
|
+
err_4 = _a.sent();
|
|
126
|
+
throw new exception_1.Exception("Unable to retreive Page Template.", err_4);
|
|
127
|
+
case 3: return [2 /*return*/];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
PageMethods.prototype.deletePageTemplate = function (guid, locale, pageTemplateId) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
var apiPath, resp, err_5;
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0:
|
|
138
|
+
_a.trys.push([0, 2, , 3]);
|
|
139
|
+
apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId);
|
|
140
|
+
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
141
|
+
case 1:
|
|
142
|
+
resp = _a.sent();
|
|
143
|
+
return [2 /*return*/, resp.data];
|
|
144
|
+
case 2:
|
|
145
|
+
err_5 = _a.sent();
|
|
146
|
+
throw new exception_1.Exception("Unable to delete Page Template.", err_5);
|
|
147
|
+
case 3: return [2 /*return*/];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
PageMethods.prototype.getPageItemTemplates = function (guid, locale, id) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
+
var apiPath, resp, err_6;
|
|
155
|
+
return __generator(this, function (_a) {
|
|
156
|
+
switch (_a.label) {
|
|
157
|
+
case 0:
|
|
158
|
+
_a.trys.push([0, 2, , 3]);
|
|
159
|
+
apiPath = "".concat(locale, "/page/template/items/").concat(id);
|
|
160
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
161
|
+
case 1:
|
|
162
|
+
resp = _a.sent();
|
|
163
|
+
return [2 /*return*/, resp.data];
|
|
164
|
+
case 2:
|
|
165
|
+
err_6 = _a.sent();
|
|
166
|
+
throw new exception_1.Exception("Unable to retreive Page Template Items.", err_6);
|
|
167
|
+
case 3: return [2 /*return*/];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
PageMethods.prototype.savePageTemplate = function (guid, locale, pageModel) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
174
|
+
var apiPath, resp, err_7;
|
|
175
|
+
return __generator(this, function (_a) {
|
|
176
|
+
switch (_a.label) {
|
|
177
|
+
case 0:
|
|
178
|
+
_a.trys.push([0, 2, , 3]);
|
|
179
|
+
apiPath = "".concat(locale, "/page/template");
|
|
180
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageModel)];
|
|
181
|
+
case 1:
|
|
182
|
+
resp = _a.sent();
|
|
183
|
+
return [2 /*return*/, resp.data];
|
|
184
|
+
case 2:
|
|
185
|
+
err_7 = _a.sent();
|
|
186
|
+
throw new exception_1.Exception("Unable to save Page Template.", err_7);
|
|
187
|
+
case 3: return [2 /*return*/];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
PageMethods.prototype.getPage = function (pageID, guid, locale) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
+
var apiPath, resp, err_8;
|
|
195
|
+
return __generator(this, function (_a) {
|
|
196
|
+
switch (_a.label) {
|
|
197
|
+
case 0:
|
|
198
|
+
_a.trys.push([0, 2, , 3]);
|
|
199
|
+
apiPath = "".concat(locale, "/page/").concat(pageID);
|
|
200
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
201
|
+
case 1:
|
|
202
|
+
resp = _a.sent();
|
|
203
|
+
return [2 /*return*/, resp.data];
|
|
204
|
+
case 2:
|
|
205
|
+
err_8 = _a.sent();
|
|
206
|
+
throw new exception_1.Exception("Unable to retreive page for id ".concat(pageID, "."), err_8);
|
|
207
|
+
case 3: return [2 /*return*/];
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
PageMethods.prototype.publishPage = function (pageID, guid, locale, comments) {
|
|
213
|
+
if (comments === void 0) { comments = null; }
|
|
214
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
215
|
+
var apiPath, resp, batchID_1, batch, pageIDs_1, err_9;
|
|
216
|
+
var _this = this;
|
|
217
|
+
return __generator(this, function (_a) {
|
|
218
|
+
switch (_a.label) {
|
|
219
|
+
case 0:
|
|
220
|
+
_a.trys.push([0, 3, , 4]);
|
|
221
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/publish?comments=").concat(comments);
|
|
222
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
223
|
+
case 1:
|
|
224
|
+
resp = _a.sent();
|
|
225
|
+
batchID_1 = resp.data;
|
|
226
|
+
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
227
|
+
switch (_a.label) {
|
|
228
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_1, guid)];
|
|
229
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
230
|
+
}
|
|
231
|
+
}); }); })];
|
|
232
|
+
case 2:
|
|
233
|
+
batch = _a.sent();
|
|
234
|
+
pageIDs_1 = [];
|
|
235
|
+
batch.items.forEach(function (element) { return pageIDs_1.push(element.itemID); });
|
|
236
|
+
return [2 /*return*/, pageIDs_1];
|
|
237
|
+
case 3:
|
|
238
|
+
err_9 = _a.sent();
|
|
239
|
+
throw new exception_1.Exception("Unable to publish the page for id: ".concat(pageID), err_9);
|
|
240
|
+
case 4: return [2 /*return*/];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
PageMethods.prototype.unPublishPage = function (pageID, guid, locale, comments) {
|
|
246
|
+
if (comments === void 0) { comments = null; }
|
|
247
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
248
|
+
var apiPath, resp, batchID_2, batch, pageIDs_2, err_10;
|
|
249
|
+
var _this = this;
|
|
250
|
+
return __generator(this, function (_a) {
|
|
251
|
+
switch (_a.label) {
|
|
252
|
+
case 0:
|
|
253
|
+
_a.trys.push([0, 3, , 4]);
|
|
254
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/unpublish?comments=").concat(comments);
|
|
255
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
256
|
+
case 1:
|
|
257
|
+
resp = _a.sent();
|
|
258
|
+
batchID_2 = resp.data;
|
|
259
|
+
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
260
|
+
switch (_a.label) {
|
|
261
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_2, guid)];
|
|
262
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
263
|
+
}
|
|
264
|
+
}); }); })];
|
|
265
|
+
case 2:
|
|
266
|
+
batch = _a.sent();
|
|
267
|
+
pageIDs_2 = [];
|
|
268
|
+
batch.items.forEach(function (element) { return pageIDs_2.push(element.itemID); });
|
|
269
|
+
return [2 /*return*/, pageIDs_2];
|
|
270
|
+
case 3:
|
|
271
|
+
err_10 = _a.sent();
|
|
272
|
+
throw new exception_1.Exception("Unable to un-publish the page for id: ".concat(pageID), err_10);
|
|
273
|
+
case 4: return [2 /*return*/];
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
PageMethods.prototype.pageRequestApproval = function (pageID, guid, locale, comments) {
|
|
279
|
+
if (comments === void 0) { comments = null; }
|
|
280
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
281
|
+
var apiPath, resp, batchID_3, batch, pageIDs_3, err_11;
|
|
282
|
+
var _this = this;
|
|
283
|
+
return __generator(this, function (_a) {
|
|
284
|
+
switch (_a.label) {
|
|
285
|
+
case 0:
|
|
286
|
+
_a.trys.push([0, 3, , 4]);
|
|
287
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/request-approval?comments=").concat(comments);
|
|
288
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
289
|
+
case 1:
|
|
290
|
+
resp = _a.sent();
|
|
291
|
+
batchID_3 = resp.data;
|
|
292
|
+
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
293
|
+
switch (_a.label) {
|
|
294
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_3, guid)];
|
|
295
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
296
|
+
}
|
|
297
|
+
}); }); })];
|
|
298
|
+
case 2:
|
|
299
|
+
batch = _a.sent();
|
|
300
|
+
pageIDs_3 = [];
|
|
301
|
+
batch.items.forEach(function (element) { return pageIDs_3.push(element.itemID); });
|
|
302
|
+
return [2 /*return*/, pageIDs_3];
|
|
303
|
+
case 3:
|
|
304
|
+
err_11 = _a.sent();
|
|
305
|
+
throw new exception_1.Exception("Unable to request approval the page for id: ".concat(pageID), err_11);
|
|
306
|
+
case 4: return [2 /*return*/];
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
PageMethods.prototype.approvePage = function (pageID, guid, locale, comments) {
|
|
312
|
+
if (comments === void 0) { comments = null; }
|
|
313
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
314
|
+
var apiPath, resp, batchID_4, batch, pageIDs_4, err_12;
|
|
315
|
+
var _this = this;
|
|
316
|
+
return __generator(this, function (_a) {
|
|
317
|
+
switch (_a.label) {
|
|
318
|
+
case 0:
|
|
319
|
+
_a.trys.push([0, 3, , 4]);
|
|
320
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/approve?comments=").concat(comments);
|
|
321
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
322
|
+
case 1:
|
|
323
|
+
resp = _a.sent();
|
|
324
|
+
batchID_4 = resp.data;
|
|
325
|
+
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
326
|
+
switch (_a.label) {
|
|
327
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_4, guid)];
|
|
328
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
329
|
+
}
|
|
330
|
+
}); }); })];
|
|
331
|
+
case 2:
|
|
332
|
+
batch = _a.sent();
|
|
333
|
+
pageIDs_4 = [];
|
|
334
|
+
batch.items.forEach(function (element) { return pageIDs_4.push(element.itemID); });
|
|
335
|
+
return [2 /*return*/, pageIDs_4];
|
|
336
|
+
case 3:
|
|
337
|
+
err_12 = _a.sent();
|
|
338
|
+
throw new exception_1.Exception("Unable to approve the page for id: ".concat(pageID), err_12);
|
|
339
|
+
case 4: return [2 /*return*/];
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
PageMethods.prototype.declinePage = function (pageID, guid, locale, comments) {
|
|
345
|
+
if (comments === void 0) { comments = null; }
|
|
346
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
347
|
+
var apiPath, resp, batchID_5, batch, pageIDs_5, err_13;
|
|
348
|
+
var _this = this;
|
|
349
|
+
return __generator(this, function (_a) {
|
|
350
|
+
switch (_a.label) {
|
|
351
|
+
case 0:
|
|
352
|
+
_a.trys.push([0, 3, , 4]);
|
|
353
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "/decline?comments=").concat(comments);
|
|
354
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
355
|
+
case 1:
|
|
356
|
+
resp = _a.sent();
|
|
357
|
+
batchID_5 = resp.data;
|
|
358
|
+
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
359
|
+
switch (_a.label) {
|
|
360
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_5, guid)];
|
|
361
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
362
|
+
}
|
|
363
|
+
}); }); })];
|
|
364
|
+
case 2:
|
|
365
|
+
batch = _a.sent();
|
|
366
|
+
pageIDs_5 = [];
|
|
367
|
+
batch.items.forEach(function (element) { return pageIDs_5.push(element.itemID); });
|
|
368
|
+
return [2 /*return*/, pageIDs_5];
|
|
369
|
+
case 3:
|
|
370
|
+
err_13 = _a.sent();
|
|
371
|
+
throw new exception_1.Exception("Unable to decline the page for id: ".concat(pageID), err_13);
|
|
372
|
+
case 4: return [2 /*return*/];
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
PageMethods.prototype.deletePage = function (pageID, guid, locale, comments) {
|
|
378
|
+
if (comments === void 0) { comments = null; }
|
|
379
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
380
|
+
var apiPath, resp, batchID_6, batch, pageIDs_6, err_14;
|
|
381
|
+
var _this = this;
|
|
382
|
+
return __generator(this, function (_a) {
|
|
383
|
+
switch (_a.label) {
|
|
384
|
+
case 0:
|
|
385
|
+
_a.trys.push([0, 3, , 4]);
|
|
386
|
+
apiPath = "".concat(locale, "/page/").concat(pageID, "?comments=").concat(comments);
|
|
387
|
+
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
388
|
+
case 1:
|
|
389
|
+
resp = _a.sent();
|
|
390
|
+
batchID_6 = resp.data;
|
|
391
|
+
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
392
|
+
switch (_a.label) {
|
|
393
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_6, guid)];
|
|
394
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
395
|
+
}
|
|
396
|
+
}); }); })];
|
|
397
|
+
case 2:
|
|
398
|
+
batch = _a.sent();
|
|
399
|
+
pageIDs_6 = [];
|
|
400
|
+
batch.items.forEach(function (element) { return pageIDs_6.push(element.itemID); });
|
|
401
|
+
return [2 /*return*/, pageIDs_6];
|
|
402
|
+
case 3:
|
|
403
|
+
err_14 = _a.sent();
|
|
404
|
+
throw new exception_1.Exception("Unable to delete the page for id: ".concat(pageID), err_14);
|
|
405
|
+
case 4: return [2 /*return*/];
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
};
|
|
410
|
+
PageMethods.prototype.savePage = function (pageItem, guid, locale, parentPageID, placeBeforePageItemID) {
|
|
411
|
+
if (parentPageID === void 0) { parentPageID = -1; }
|
|
412
|
+
if (placeBeforePageItemID === void 0) { placeBeforePageItemID = -1; }
|
|
413
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
414
|
+
var apiPath, resp, batchID_7, batch, pageIDs_7, err_15;
|
|
415
|
+
var _this = this;
|
|
416
|
+
return __generator(this, function (_a) {
|
|
417
|
+
switch (_a.label) {
|
|
418
|
+
case 0:
|
|
419
|
+
_a.trys.push([0, 3, , 4]);
|
|
420
|
+
apiPath = "".concat(locale, "/page?parentPageID=").concat(parentPageID, "&placeBeforePageItemID=").concat(placeBeforePageItemID);
|
|
421
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageItem)];
|
|
422
|
+
case 1:
|
|
423
|
+
resp = _a.sent();
|
|
424
|
+
batchID_7 = resp.data;
|
|
425
|
+
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
426
|
+
switch (_a.label) {
|
|
427
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_7, guid)];
|
|
428
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
429
|
+
}
|
|
430
|
+
}); }); })];
|
|
431
|
+
case 2:
|
|
432
|
+
batch = _a.sent();
|
|
433
|
+
pageIDs_7 = [];
|
|
434
|
+
batch.items.forEach(function (element) { return pageIDs_7.push(element.itemID); });
|
|
435
|
+
return [2 /*return*/, pageIDs_7];
|
|
436
|
+
case 3:
|
|
437
|
+
err_15 = _a.sent();
|
|
438
|
+
throw new exception_1.Exception("Unable to create page. ".concat(err_15), err_15);
|
|
439
|
+
case 4: return [2 /*return*/];
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
return PageMethods;
|
|
445
|
+
}());
|
|
446
|
+
exports.PageMethods = PageMethods;
|