@agility/management-sdk 0.1.26 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/manifest.md +98 -0
- package/.env +92 -0
- package/dist/apiClient.js.map +1 -0
- package/dist/apiMethods/assetMethods.js +38 -38
- package/dist/apiMethods/assetMethods.js.map +1 -0
- package/dist/apiMethods/batchMethods.js +5 -5
- package/dist/apiMethods/batchMethods.js.map +1 -0
- package/dist/apiMethods/clientInstance.js +9 -9
- package/dist/apiMethods/clientInstance.js.map +1 -0
- package/dist/apiMethods/containerMethods.d.ts +8 -1
- package/dist/apiMethods/containerMethods.js +27 -20
- package/dist/apiMethods/containerMethods.js.map +1 -0
- package/dist/apiMethods/contentMethods.d.ts +8 -8
- package/dist/apiMethods/contentMethods.js +100 -68
- package/dist/apiMethods/contentMethods.js.map +1 -0
- package/dist/apiMethods/instanceMethods.js +3 -3
- package/dist/apiMethods/instanceMethods.js.map +1 -0
- package/dist/apiMethods/instanceUserMethods.js +10 -10
- package/dist/apiMethods/instanceUserMethods.js.map +1 -0
- package/dist/apiMethods/modelMethods.js +13 -13
- package/dist/apiMethods/modelMethods.js.map +1 -0
- package/dist/apiMethods/pageMethods.d.ts +7 -7
- package/dist/apiMethods/pageMethods.js +98 -67
- package/dist/apiMethods/pageMethods.js.map +1 -0
- package/dist/apiMethods/serverUserMethods.js +4 -4
- package/dist/apiMethods/serverUserMethods.js.map +1 -0
- package/dist/apiMethods/webhookMethods.js +11 -11
- package/dist/apiMethods/webhookMethods.js.map +1 -0
- package/dist/enums/assetGroupingType.js +1 -1
- package/dist/enums/assetGroupingType.js.map +1 -0
- package/dist/enums/batchOperationType.js +1 -1
- package/dist/enums/batchOperationType.js.map +1 -0
- package/dist/enums/batchState..js +1 -1
- package/dist/enums/batchState.d.ts +7 -0
- package/dist/enums/batchState.js +12 -0
- package/dist/enums/batchState.js.map +1 -0
- package/dist/enums/pageItemTemplateType.js +1 -1
- package/dist/enums/pageItemTemplateType.js.map +1 -0
- package/dist/errors/exception.d.ts +4 -0
- package/dist/errors/exception.js +11 -0
- package/dist/errors/exception.js.map +1 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -0
- package/dist/models/exception.js +2 -0
- package/dist/models/locales.js +2 -0
- package/dist/tests/authHelper.d.ts +2 -0
- package/dist/tests/authHelper.js +14 -0
- package/dist/tests/authHelper.js.map +1 -0
- package/dist/tests/config/apiClient.config.d.ts +16 -0
- package/dist/tests/config/apiClient.config.js +84 -0
- package/dist/tests/config/apiClient.config.js.map +1 -0
- package/dist/tests/config/test.config.d.ts +24 -0
- package/dist/tests/config/test.config.js +47 -0
- package/dist/tests/config/test.config.js.map +1 -0
- package/dist/types/apiResponse.d.ts +13 -0
- package/dist/types/apiResponse.js +3 -0
- package/dist/types/apiResponse.js.map +1 -0
- package/dist/types/assetContainer.d.ts +7 -0
- package/dist/types/assetContainer.js +3 -0
- package/dist/types/assetContainer.js.map +1 -0
- package/dist/types/assetGalleries.d.ts +5 -0
- package/dist/types/assetGalleries.js +3 -0
- package/dist/types/assetGalleries.js.map +1 -0
- package/dist/types/assetMediaGrouping.d.ts +17 -0
- package/dist/types/assetMediaGrouping.js +3 -0
- package/dist/types/assetMediaGrouping.js.map +1 -0
- package/dist/types/assetMediaGroupingMetaData.d.ts +4 -0
- package/dist/types/assetMediaGroupingMetaData.js +3 -0
- package/dist/types/assetMediaGroupingMetaData.js.map +1 -0
- package/dist/types/batch.d.ts +29 -0
- package/dist/types/batch.js +3 -0
- package/dist/types/batch.js.map +1 -0
- package/dist/types/batchItem.d.ts +13 -0
- package/dist/types/batchItem.js +3 -0
- package/dist/types/batchItem.js.map +1 -0
- package/dist/types/container.d.ts +47 -0
- package/dist/types/container.js +3 -0
- package/dist/types/container.js.map +1 -0
- package/dist/types/contentItem.d.ts +37 -0
- package/dist/types/contentItem.js +3 -0
- package/dist/types/contentItem.js.map +1 -0
- package/dist/types/contentItemHistory.d.ts +20 -0
- package/dist/types/contentItemHistory.js +3 -0
- package/dist/types/contentItemHistory.js.map +1 -0
- package/dist/types/contentListFilterModel.d.ts +26 -0
- package/dist/types/contentListFilterModel.js +3 -0
- package/dist/types/contentListFilterModel.js.map +1 -0
- package/dist/types/contentSectionDefaultModule.d.ts +7 -0
- package/dist/types/contentSectionDefaultModule.js +3 -0
- package/dist/types/contentSectionDefaultModule.js.map +1 -0
- package/dist/types/contentSectionDefinition.d.ts +35 -0
- package/dist/types/contentSectionDefinition.js +3 -0
- package/dist/types/contentSectionDefinition.js.map +1 -0
- package/dist/types/contentViewColumn.d.ts +8 -0
- package/dist/types/contentViewColumn.js +3 -0
- package/dist/types/contentViewColumn.js.map +1 -0
- package/dist/types/instanceRole.d.ts +7 -0
- package/dist/types/instanceRole.js +3 -0
- package/dist/types/instanceRole.js.map +1 -0
- package/dist/types/instanceUser.d.ts +14 -0
- package/dist/types/instanceUser.js +3 -0
- package/dist/types/instanceUser.js.map +1 -0
- package/dist/types/itemComments.d.ts +14 -0
- package/dist/types/itemComments.js +3 -0
- package/dist/types/itemComments.js.map +1 -0
- package/dist/types/listParams.d.ts +9 -0
- package/dist/types/listParams.js +3 -0
- package/dist/types/listParams.js.map +1 -0
- package/dist/types/locales.d.ts +1 -0
- package/dist/types/locales.js +3 -0
- package/dist/types/locales.js.map +1 -0
- package/dist/types/media.d.ts +30 -0
- package/dist/types/media.js +3 -0
- package/dist/types/media.js.map +1 -0
- package/dist/types/model.d.ts +30 -0
- package/dist/types/model.js +3 -0
- package/dist/types/model.js.map +1 -0
- package/dist/types/notification.d.ts +13 -0
- package/dist/types/notification.js +3 -0
- package/dist/types/notification.js.map +1 -0
- package/dist/types/options.d.ts +7 -0
- package/dist/types/options.js +3 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/pageHistory.d.ts +21 -0
- package/dist/types/pageHistory.js +3 -0
- package/dist/types/pageHistory.js.map +1 -0
- package/dist/types/pageItem.d.ts +56 -0
- package/dist/types/pageItem.js +3 -0
- package/dist/types/pageItem.js.map +1 -0
- package/dist/types/pageModel.d.ts +14 -0
- package/dist/types/pageModel.js +3 -0
- package/dist/types/pageModel.js.map +1 -0
- package/dist/types/serverUser.d.ts +21 -0
- package/dist/types/serverUser.js +3 -0
- package/dist/types/serverUser.js.map +1 -0
- package/dist/types/sharedModule.d.ts +7 -0
- package/dist/types/sharedModule.js +3 -0
- package/dist/types/sharedModule.js.map +1 -0
- package/dist/types/sitemap.d.ts +20 -0
- package/dist/types/sitemap.js +3 -0
- package/dist/types/sitemap.js.map +1 -0
- package/dist/types/tokenResponseData.d.ts +10 -0
- package/dist/types/tokenResponseData.js +3 -0
- package/dist/types/tokenResponseData.js.map +1 -0
- package/dist/types/webhook.d.ts +9 -0
- package/dist/types/webhook.js +3 -0
- package/dist/types/webhook.js.map +1 -0
- package/dist/types/websiteListing.d.ts +16 -0
- package/dist/types/websiteListing.js +3 -0
- package/dist/types/websiteListing.js.map +1 -0
- package/dist/types/websiteUser.d.ts +22 -0
- package/dist/types/websiteUser.js +3 -0
- package/dist/types/websiteUser.js.map +1 -0
- package/package.json +1 -1
|
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -51,14 +51,14 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
51
51
|
switch (_a.label) {
|
|
52
52
|
case 0:
|
|
53
53
|
_a.trys.push([0, 2, , 3]);
|
|
54
|
-
apiPath = "container/"
|
|
54
|
+
apiPath = "container/".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 retrieve the container for id: "
|
|
61
|
+
throw new exception_1.Exception("Unable to retrieve the container for id: ".concat(id), err_1);
|
|
62
62
|
case 3: return [2 /*return*/];
|
|
63
63
|
}
|
|
64
64
|
});
|
|
@@ -71,28 +71,35 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
71
71
|
switch (_a.label) {
|
|
72
72
|
case 0:
|
|
73
73
|
_a.trys.push([0, 2, , 3]);
|
|
74
|
-
apiPath = "container/model/"
|
|
74
|
+
apiPath = "container/model/".concat(modelId);
|
|
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 retrieve the containers for id: "
|
|
81
|
+
throw new exception_1.Exception("Unable to retrieve the containers for id: ".concat(modelId), err_2);
|
|
82
82
|
case 3: return [2 /*return*/];
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* Retrieves a container by its reference name.
|
|
89
|
+
* Returns the container if found, or null if the container does not exist (404 error).
|
|
90
|
+
* @param referenceName - The reference name of the container.
|
|
91
|
+
* @param guid - The GUID for authentication.
|
|
92
|
+
* @returns The container or null if not found.
|
|
93
|
+
*/
|
|
87
94
|
ContainerMethods.prototype.getContainerByReferenceName = function (referenceName, guid) {
|
|
88
|
-
var _a;
|
|
89
95
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
96
|
var apiPath, resp, err_3;
|
|
97
|
+
var _a;
|
|
91
98
|
return __generator(this, function (_b) {
|
|
92
99
|
switch (_b.label) {
|
|
93
100
|
case 0:
|
|
94
101
|
_b.trys.push([0, 2, , 3]);
|
|
95
|
-
apiPath = "container/"
|
|
102
|
+
apiPath = "container/".concat(referenceName);
|
|
96
103
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
97
104
|
case 1:
|
|
98
105
|
resp = _b.sent();
|
|
@@ -102,7 +109,7 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
102
109
|
if (((_a = err_3.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
|
|
103
110
|
return [2 /*return*/, null]; // If the container is not found, return null
|
|
104
111
|
}
|
|
105
|
-
throw new exception_1.Exception("Unable to retrieve the container for referenceName: "
|
|
112
|
+
throw new exception_1.Exception("Unable to retrieve the container for referenceName: ".concat(referenceName), err_3);
|
|
106
113
|
case 3: return [2 /*return*/];
|
|
107
114
|
}
|
|
108
115
|
});
|
|
@@ -115,14 +122,14 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
115
122
|
switch (_a.label) {
|
|
116
123
|
case 0:
|
|
117
124
|
_a.trys.push([0, 2, , 3]);
|
|
118
|
-
apiPath = "container/"
|
|
125
|
+
apiPath = "container/".concat(id, "/security");
|
|
119
126
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
120
127
|
case 1:
|
|
121
128
|
resp = _a.sent();
|
|
122
129
|
return [2 /*return*/, resp.data];
|
|
123
130
|
case 2:
|
|
124
131
|
err_4 = _a.sent();
|
|
125
|
-
throw new exception_1.Exception("Unable to retrieve the container for id: "
|
|
132
|
+
throw new exception_1.Exception("Unable to retrieve the container for id: ".concat(id), err_4);
|
|
126
133
|
case 3: return [2 /*return*/];
|
|
127
134
|
}
|
|
128
135
|
});
|
|
@@ -155,28 +162,28 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
155
162
|
switch (_a.label) {
|
|
156
163
|
case 0:
|
|
157
164
|
_a.trys.push([0, 2, , 3]);
|
|
158
|
-
apiPath = "container/"
|
|
165
|
+
apiPath = "container/".concat(id, "/notifications");
|
|
159
166
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
160
167
|
case 1:
|
|
161
168
|
resp = _a.sent();
|
|
162
169
|
return [2 /*return*/, resp.data];
|
|
163
170
|
case 2:
|
|
164
171
|
err_6 = _a.sent();
|
|
165
|
-
throw new exception_1.Exception("Unable to retrieve the notifications for container id: "
|
|
172
|
+
throw new exception_1.Exception("Unable to retrieve the notifications for container id: ".concat(id), err_6);
|
|
166
173
|
case 3: return [2 /*return*/];
|
|
167
174
|
}
|
|
168
175
|
});
|
|
169
176
|
});
|
|
170
177
|
};
|
|
171
|
-
ContainerMethods.prototype.saveContainer = function (
|
|
172
|
-
|
|
173
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
178
|
+
ContainerMethods.prototype.saveContainer = function (container_1, guid_1) {
|
|
179
|
+
return __awaiter(this, arguments, void 0, function (container, guid, forceReferenceName) {
|
|
174
180
|
var apiPath, resp, err_7;
|
|
181
|
+
if (forceReferenceName === void 0) { forceReferenceName = false; }
|
|
175
182
|
return __generator(this, function (_a) {
|
|
176
183
|
switch (_a.label) {
|
|
177
184
|
case 0:
|
|
178
185
|
_a.trys.push([0, 2, , 3]);
|
|
179
|
-
apiPath = "container"
|
|
186
|
+
apiPath = "container".concat(forceReferenceName ? '?forceReferenceName=true' : '');
|
|
180
187
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, container)];
|
|
181
188
|
case 1:
|
|
182
189
|
resp = _a.sent();
|
|
@@ -196,14 +203,14 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
196
203
|
switch (_a.label) {
|
|
197
204
|
case 0:
|
|
198
205
|
_a.trys.push([0, 2, , 3]);
|
|
199
|
-
apiPath = "container/"
|
|
206
|
+
apiPath = "container/".concat(id);
|
|
200
207
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
201
208
|
case 1:
|
|
202
209
|
resp = _a.sent();
|
|
203
210
|
return [2 /*return*/, resp.data];
|
|
204
211
|
case 2:
|
|
205
212
|
err_8 = _a.sent();
|
|
206
|
-
throw new exception_1.Exception("Unable to delete the container for id: "
|
|
213
|
+
throw new exception_1.Exception("Unable to delete the container for id: ".concat(id), err_8);
|
|
207
214
|
case 3: return [2 /*return*/];
|
|
208
215
|
}
|
|
209
216
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerMethods.js","sourceRoot":"","sources":["../../src/apiMethods/containerMethods.ts"],"names":[],"mappings":"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"}
|
|
@@ -12,14 +12,14 @@ export declare class ContentMethods {
|
|
|
12
12
|
_batchMethods: BatchMethods;
|
|
13
13
|
constructor(options: Options);
|
|
14
14
|
getContentItem(contentID: number, guid: string, locale: string): Promise<ContentItem>;
|
|
15
|
-
publishContent(contentID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
16
|
-
unPublishContent(contentID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
17
|
-
contentRequestApproval(contentID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
18
|
-
approveContent(contentID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
19
|
-
declineContent(contentID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
20
|
-
deleteContent(contentID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
21
|
-
saveContentItem(contentItem: ContentItem, guid: string, locale: string): Promise<
|
|
22
|
-
saveContentItems(contentItems: ContentItem[], guid: string, locale: string): Promise<
|
|
15
|
+
publishContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
16
|
+
unPublishContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
17
|
+
contentRequestApproval(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
18
|
+
approveContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
19
|
+
declineContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
20
|
+
deleteContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
21
|
+
saveContentItem(contentItem: ContentItem, guid: string, locale: string, returnBatchId?: boolean): Promise<number[]>;
|
|
22
|
+
saveContentItems(contentItems: ContentItem[], guid: string, locale: string, returnBatchId?: boolean): Promise<number[]>;
|
|
23
23
|
getContentItems(referenceName: string, guid: string, locale: string, listParams: ListParams): Promise<ContentList>;
|
|
24
24
|
getContentList(referenceName: string, guid: string, locale: string, listParams: ListParams, filterObject?: ContentListFilterModel): Promise<ContentList>;
|
|
25
25
|
getContentHistory(locale: string, guid: string, contentID: number, take?: number, skip?: number): Promise<ContentItemHistory>;
|
|
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -53,33 +53,38 @@ 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 retrieve the content for id: "
|
|
63
|
+
throw new exception_1.Exception("Unable to retrieve the content for id: ".concat(contentID), err_1);
|
|
64
64
|
case 3: return [2 /*return*/];
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
ContentMethods.prototype.publishContent = function (
|
|
70
|
-
|
|
71
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
ContentMethods.prototype.publishContent = function (contentID_1, guid_1, locale_1) {
|
|
70
|
+
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
72
71
|
var apiPath, resp, batchID_1, batch, contentIDs_1, err_2;
|
|
73
72
|
var _this = this;
|
|
73
|
+
if (comments === void 0) { comments = null; }
|
|
74
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
74
75
|
return __generator(this, function (_a) {
|
|
75
76
|
switch (_a.label) {
|
|
76
77
|
case 0:
|
|
77
78
|
_a.trys.push([0, 3, , 4]);
|
|
78
|
-
apiPath = locale
|
|
79
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/publish?comments=").concat(comments);
|
|
79
80
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
80
81
|
case 1:
|
|
81
82
|
resp = _a.sent();
|
|
82
83
|
batchID_1 = resp.data;
|
|
84
|
+
// If user wants batchID immediately, return it for custom polling
|
|
85
|
+
if (returnBatchId) {
|
|
86
|
+
return [2 /*return*/, [batchID_1]];
|
|
87
|
+
}
|
|
83
88
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
84
89
|
switch (_a.label) {
|
|
85
90
|
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_1, guid)];
|
|
@@ -93,26 +98,31 @@ var ContentMethods = /** @class */ (function () {
|
|
|
93
98
|
return [2 /*return*/, contentIDs_1];
|
|
94
99
|
case 3:
|
|
95
100
|
err_2 = _a.sent();
|
|
96
|
-
throw new exception_1.Exception("Unable to publish the content for id: "
|
|
101
|
+
throw new exception_1.Exception("Unable to publish the content for id: ".concat(contentID), err_2);
|
|
97
102
|
case 4: return [2 /*return*/];
|
|
98
103
|
}
|
|
99
104
|
});
|
|
100
105
|
});
|
|
101
106
|
};
|
|
102
|
-
ContentMethods.prototype.unPublishContent = function (
|
|
103
|
-
|
|
104
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
ContentMethods.prototype.unPublishContent = function (contentID_1, guid_1, locale_1) {
|
|
108
|
+
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
105
109
|
var apiPath, resp, batchID_2, batch, contentIDs_2, err_3;
|
|
106
110
|
var _this = this;
|
|
111
|
+
if (comments === void 0) { comments = null; }
|
|
112
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
107
113
|
return __generator(this, function (_a) {
|
|
108
114
|
switch (_a.label) {
|
|
109
115
|
case 0:
|
|
110
116
|
_a.trys.push([0, 3, , 4]);
|
|
111
|
-
apiPath = locale
|
|
117
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/unpublish?comments=").concat(comments);
|
|
112
118
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
113
119
|
case 1:
|
|
114
120
|
resp = _a.sent();
|
|
115
121
|
batchID_2 = resp.data;
|
|
122
|
+
// If user wants batchID immediately, return it for custom polling
|
|
123
|
+
if (returnBatchId) {
|
|
124
|
+
return [2 /*return*/, [batchID_2]];
|
|
125
|
+
}
|
|
116
126
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
117
127
|
switch (_a.label) {
|
|
118
128
|
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_2, guid)];
|
|
@@ -126,26 +136,31 @@ var ContentMethods = /** @class */ (function () {
|
|
|
126
136
|
return [2 /*return*/, contentIDs_2];
|
|
127
137
|
case 3:
|
|
128
138
|
err_3 = _a.sent();
|
|
129
|
-
throw new exception_1.Exception("Unable to un-publish the content for id: "
|
|
139
|
+
throw new exception_1.Exception("Unable to un-publish the content for id: ".concat(contentID), err_3);
|
|
130
140
|
case 4: return [2 /*return*/];
|
|
131
141
|
}
|
|
132
142
|
});
|
|
133
143
|
});
|
|
134
144
|
};
|
|
135
|
-
ContentMethods.prototype.contentRequestApproval = function (
|
|
136
|
-
|
|
137
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
+
ContentMethods.prototype.contentRequestApproval = function (contentID_1, guid_1, locale_1) {
|
|
146
|
+
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
138
147
|
var apiPath, resp, batchID_3, batch, contentIDs_3, err_4;
|
|
139
148
|
var _this = this;
|
|
149
|
+
if (comments === void 0) { comments = null; }
|
|
150
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
140
151
|
return __generator(this, function (_a) {
|
|
141
152
|
switch (_a.label) {
|
|
142
153
|
case 0:
|
|
143
154
|
_a.trys.push([0, 3, , 4]);
|
|
144
|
-
apiPath = locale
|
|
155
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/request-approval?comments=").concat(comments);
|
|
145
156
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
146
157
|
case 1:
|
|
147
158
|
resp = _a.sent();
|
|
148
159
|
batchID_3 = resp.data;
|
|
160
|
+
// If user wants batchID immediately, return it for custom polling
|
|
161
|
+
if (returnBatchId) {
|
|
162
|
+
return [2 /*return*/, [batchID_3]];
|
|
163
|
+
}
|
|
149
164
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
150
165
|
switch (_a.label) {
|
|
151
166
|
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_3, guid)];
|
|
@@ -159,26 +174,31 @@ var ContentMethods = /** @class */ (function () {
|
|
|
159
174
|
return [2 /*return*/, contentIDs_3];
|
|
160
175
|
case 3:
|
|
161
176
|
err_4 = _a.sent();
|
|
162
|
-
throw new exception_1.Exception("Unable to request approval the content for id: "
|
|
177
|
+
throw new exception_1.Exception("Unable to request approval the content for id: ".concat(contentID), err_4);
|
|
163
178
|
case 4: return [2 /*return*/];
|
|
164
179
|
}
|
|
165
180
|
});
|
|
166
181
|
});
|
|
167
182
|
};
|
|
168
|
-
ContentMethods.prototype.approveContent = function (
|
|
169
|
-
|
|
170
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
+
ContentMethods.prototype.approveContent = function (contentID_1, guid_1, locale_1) {
|
|
184
|
+
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
171
185
|
var apiPath, resp, batchID_4, batch, contentIDs_4, err_5;
|
|
172
186
|
var _this = this;
|
|
187
|
+
if (comments === void 0) { comments = null; }
|
|
188
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
173
189
|
return __generator(this, function (_a) {
|
|
174
190
|
switch (_a.label) {
|
|
175
191
|
case 0:
|
|
176
192
|
_a.trys.push([0, 3, , 4]);
|
|
177
|
-
apiPath = locale
|
|
193
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/approve?comments=").concat(comments);
|
|
178
194
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
179
195
|
case 1:
|
|
180
196
|
resp = _a.sent();
|
|
181
197
|
batchID_4 = resp.data;
|
|
198
|
+
// If user wants batchID immediately, return it for custom polling
|
|
199
|
+
if (returnBatchId) {
|
|
200
|
+
return [2 /*return*/, [batchID_4]];
|
|
201
|
+
}
|
|
182
202
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
183
203
|
switch (_a.label) {
|
|
184
204
|
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_4, guid)];
|
|
@@ -192,26 +212,31 @@ var ContentMethods = /** @class */ (function () {
|
|
|
192
212
|
return [2 /*return*/, contentIDs_4];
|
|
193
213
|
case 3:
|
|
194
214
|
err_5 = _a.sent();
|
|
195
|
-
throw new exception_1.Exception("Unable to approve the content for id: "
|
|
215
|
+
throw new exception_1.Exception("Unable to approve the content for id: ".concat(contentID), err_5);
|
|
196
216
|
case 4: return [2 /*return*/];
|
|
197
217
|
}
|
|
198
218
|
});
|
|
199
219
|
});
|
|
200
220
|
};
|
|
201
|
-
ContentMethods.prototype.declineContent = function (
|
|
202
|
-
|
|
203
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
221
|
+
ContentMethods.prototype.declineContent = function (contentID_1, guid_1, locale_1) {
|
|
222
|
+
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
204
223
|
var apiPath, resp, batchID_5, batch, contentIDs_5, err_6;
|
|
205
224
|
var _this = this;
|
|
225
|
+
if (comments === void 0) { comments = null; }
|
|
226
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
206
227
|
return __generator(this, function (_a) {
|
|
207
228
|
switch (_a.label) {
|
|
208
229
|
case 0:
|
|
209
230
|
_a.trys.push([0, 3, , 4]);
|
|
210
|
-
apiPath = locale
|
|
231
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/decline?comments=").concat(comments);
|
|
211
232
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
212
233
|
case 1:
|
|
213
234
|
resp = _a.sent();
|
|
214
235
|
batchID_5 = resp.data;
|
|
236
|
+
// If user wants batchID immediately, return it for custom polling
|
|
237
|
+
if (returnBatchId) {
|
|
238
|
+
return [2 /*return*/, [batchID_5]];
|
|
239
|
+
}
|
|
215
240
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
216
241
|
switch (_a.label) {
|
|
217
242
|
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_5, guid)];
|
|
@@ -225,26 +250,31 @@ var ContentMethods = /** @class */ (function () {
|
|
|
225
250
|
return [2 /*return*/, contentIDs_5];
|
|
226
251
|
case 3:
|
|
227
252
|
err_6 = _a.sent();
|
|
228
|
-
throw new exception_1.Exception("Unable to decline the content for id: "
|
|
253
|
+
throw new exception_1.Exception("Unable to decline the content for id: ".concat(contentID), err_6);
|
|
229
254
|
case 4: return [2 /*return*/];
|
|
230
255
|
}
|
|
231
256
|
});
|
|
232
257
|
});
|
|
233
258
|
};
|
|
234
|
-
ContentMethods.prototype.deleteContent = function (
|
|
235
|
-
|
|
236
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
259
|
+
ContentMethods.prototype.deleteContent = function (contentID_1, guid_1, locale_1) {
|
|
260
|
+
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
237
261
|
var apiPath, resp, batchID_6, batch, contentIDs_6, err_7;
|
|
238
262
|
var _this = this;
|
|
263
|
+
if (comments === void 0) { comments = null; }
|
|
264
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
239
265
|
return __generator(this, function (_a) {
|
|
240
266
|
switch (_a.label) {
|
|
241
267
|
case 0:
|
|
242
268
|
_a.trys.push([0, 3, , 4]);
|
|
243
|
-
apiPath = locale
|
|
269
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "?comments=").concat(comments);
|
|
244
270
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
245
271
|
case 1:
|
|
246
272
|
resp = _a.sent();
|
|
247
273
|
batchID_6 = resp.data;
|
|
274
|
+
// If user wants batchID immediately, return it for custom polling
|
|
275
|
+
if (returnBatchId) {
|
|
276
|
+
return [2 /*return*/, [batchID_6]];
|
|
277
|
+
}
|
|
248
278
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
249
279
|
switch (_a.label) {
|
|
250
280
|
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_6, guid)];
|
|
@@ -258,25 +288,30 @@ var ContentMethods = /** @class */ (function () {
|
|
|
258
288
|
return [2 /*return*/, contentIDs_6];
|
|
259
289
|
case 3:
|
|
260
290
|
err_7 = _a.sent();
|
|
261
|
-
throw new exception_1.Exception("Unable to delete the content for id: "
|
|
291
|
+
throw new exception_1.Exception("Unable to delete the content for id: ".concat(contentID), err_7);
|
|
262
292
|
case 4: return [2 /*return*/];
|
|
263
293
|
}
|
|
264
294
|
});
|
|
265
295
|
});
|
|
266
296
|
};
|
|
267
|
-
ContentMethods.prototype.saveContentItem = function (
|
|
268
|
-
return __awaiter(this,
|
|
297
|
+
ContentMethods.prototype.saveContentItem = function (contentItem_1, guid_1, locale_1) {
|
|
298
|
+
return __awaiter(this, arguments, void 0, function (contentItem, guid, locale, returnBatchId) {
|
|
269
299
|
var apiPath, resp, batchID_7, batch, contentIDs_7, err_8;
|
|
270
300
|
var _this = this;
|
|
301
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
271
302
|
return __generator(this, function (_a) {
|
|
272
303
|
switch (_a.label) {
|
|
273
304
|
case 0:
|
|
274
305
|
_a.trys.push([0, 3, , 4]);
|
|
275
|
-
apiPath = locale
|
|
306
|
+
apiPath = "".concat(locale, "/item");
|
|
276
307
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItem)];
|
|
277
308
|
case 1:
|
|
278
309
|
resp = _a.sent();
|
|
279
310
|
batchID_7 = resp.data;
|
|
311
|
+
// If user wants batchID immediately, return it for custom polling
|
|
312
|
+
if (returnBatchId) {
|
|
313
|
+
return [2 /*return*/, [batchID_7]];
|
|
314
|
+
}
|
|
280
315
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
281
316
|
switch (_a.label) {
|
|
282
317
|
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_7, guid)];
|
|
@@ -285,10 +320,6 @@ var ContentMethods = /** @class */ (function () {
|
|
|
285
320
|
}); }); })];
|
|
286
321
|
case 2:
|
|
287
322
|
batch = _a.sent();
|
|
288
|
-
// Aaaron May 1 2025 - if the batch has error data, return the batch not just the -1 contentID
|
|
289
|
-
if (batch.errorData) {
|
|
290
|
-
return [2 /*return*/, batch];
|
|
291
|
-
}
|
|
292
323
|
contentIDs_7 = [];
|
|
293
324
|
batch.items.forEach(function (element) { return contentIDs_7.push(element.itemID); });
|
|
294
325
|
return [2 /*return*/, contentIDs_7];
|
|
@@ -300,19 +331,24 @@ var ContentMethods = /** @class */ (function () {
|
|
|
300
331
|
});
|
|
301
332
|
});
|
|
302
333
|
};
|
|
303
|
-
ContentMethods.prototype.saveContentItems = function (
|
|
304
|
-
return __awaiter(this,
|
|
334
|
+
ContentMethods.prototype.saveContentItems = function (contentItems_1, guid_1, locale_1) {
|
|
335
|
+
return __awaiter(this, arguments, void 0, function (contentItems, guid, locale, returnBatchId) {
|
|
305
336
|
var apiPath, resp, batchID_8, batch, contentIDs_8, err_9;
|
|
306
337
|
var _this = this;
|
|
338
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
307
339
|
return __generator(this, function (_a) {
|
|
308
340
|
switch (_a.label) {
|
|
309
341
|
case 0:
|
|
310
342
|
_a.trys.push([0, 3, , 4]);
|
|
311
|
-
apiPath = locale
|
|
343
|
+
apiPath = "".concat(locale, "/item/multi");
|
|
312
344
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItems)];
|
|
313
345
|
case 1:
|
|
314
346
|
resp = _a.sent();
|
|
315
347
|
batchID_8 = resp.data;
|
|
348
|
+
// If user wants batchID immediately, return it for custom polling
|
|
349
|
+
if (returnBatchId) {
|
|
350
|
+
return [2 /*return*/, [batchID_8]];
|
|
351
|
+
}
|
|
316
352
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
317
353
|
switch (_a.label) {
|
|
318
354
|
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_8, guid)];
|
|
@@ -321,10 +357,6 @@ var ContentMethods = /** @class */ (function () {
|
|
|
321
357
|
}); }); })];
|
|
322
358
|
case 2:
|
|
323
359
|
batch = _a.sent();
|
|
324
|
-
// Aaaron May 1 2025 - if the batch has error data, return the batch not just the -1 contentID
|
|
325
|
-
if (batch.errorData) {
|
|
326
|
-
return [2 /*return*/, batch];
|
|
327
|
-
}
|
|
328
360
|
contentIDs_8 = [];
|
|
329
361
|
batch.items.forEach(function (element) { return contentIDs_8.push(element.itemID); });
|
|
330
362
|
return [2 /*return*/, contentIDs_8];
|
|
@@ -343,79 +375,79 @@ var ContentMethods = /** @class */ (function () {
|
|
|
343
375
|
switch (_a.label) {
|
|
344
376
|
case 0:
|
|
345
377
|
_a.trys.push([0, 2, , 3]);
|
|
346
|
-
apiPath = locale
|
|
378
|
+
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);
|
|
347
379
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
348
380
|
case 1:
|
|
349
381
|
resp = _a.sent();
|
|
350
382
|
return [2 /*return*/, resp.data];
|
|
351
383
|
case 2:
|
|
352
384
|
err_10 = _a.sent();
|
|
353
|
-
throw new exception_1.Exception("Unable retrieve the content details for reference name: "
|
|
385
|
+
throw new exception_1.Exception("Unable retrieve the content details for reference name: ".concat(referenceName), err_10);
|
|
354
386
|
case 3: return [2 /*return*/];
|
|
355
387
|
}
|
|
356
388
|
});
|
|
357
389
|
});
|
|
358
390
|
};
|
|
359
|
-
ContentMethods.prototype.getContentList = function (
|
|
360
|
-
|
|
361
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
391
|
+
ContentMethods.prototype.getContentList = function (referenceName_1, guid_1, locale_1, listParams_1) {
|
|
392
|
+
return __awaiter(this, arguments, void 0, function (referenceName, guid, locale, listParams, filterObject) {
|
|
362
393
|
var apiPath, resp, err_11;
|
|
394
|
+
if (filterObject === void 0) { filterObject = null; }
|
|
363
395
|
return __generator(this, function (_a) {
|
|
364
396
|
switch (_a.label) {
|
|
365
397
|
case 0:
|
|
366
398
|
_a.trys.push([0, 2, , 3]);
|
|
367
|
-
apiPath = locale
|
|
399
|
+
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);
|
|
368
400
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, filterObject)];
|
|
369
401
|
case 1:
|
|
370
402
|
resp = _a.sent();
|
|
371
403
|
return [2 /*return*/, resp.data];
|
|
372
404
|
case 2:
|
|
373
405
|
err_11 = _a.sent();
|
|
374
|
-
throw new exception_1.Exception("Unable retrieve the content details for list with reference name: "
|
|
406
|
+
throw new exception_1.Exception("Unable retrieve the content details for list with reference name: ".concat(referenceName), err_11);
|
|
375
407
|
case 3: return [2 /*return*/];
|
|
376
408
|
}
|
|
377
409
|
});
|
|
378
410
|
});
|
|
379
411
|
};
|
|
380
|
-
ContentMethods.prototype.getContentHistory = function (
|
|
381
|
-
|
|
382
|
-
if (skip === void 0) { skip = 0; }
|
|
383
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
412
|
+
ContentMethods.prototype.getContentHistory = function (locale_1, guid_1, contentID_1) {
|
|
413
|
+
return __awaiter(this, arguments, void 0, function (locale, guid, contentID, take, skip) {
|
|
384
414
|
var apiPath, resp, err_12;
|
|
415
|
+
if (take === void 0) { take = 50; }
|
|
416
|
+
if (skip === void 0) { skip = 0; }
|
|
385
417
|
return __generator(this, function (_a) {
|
|
386
418
|
switch (_a.label) {
|
|
387
419
|
case 0:
|
|
388
420
|
_a.trys.push([0, 2, , 3]);
|
|
389
|
-
apiPath = locale
|
|
421
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/history?take=").concat(take, "&skip=").concat(skip);
|
|
390
422
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
391
423
|
case 1:
|
|
392
424
|
resp = _a.sent();
|
|
393
425
|
return [2 /*return*/, resp.data];
|
|
394
426
|
case 2:
|
|
395
427
|
err_12 = _a.sent();
|
|
396
|
-
throw new exception_1.Exception("Unable to retrieve history for contentID: "
|
|
428
|
+
throw new exception_1.Exception("Unable to retrieve history for contentID: ".concat(contentID));
|
|
397
429
|
case 3: return [2 /*return*/];
|
|
398
430
|
}
|
|
399
431
|
});
|
|
400
432
|
});
|
|
401
433
|
};
|
|
402
|
-
ContentMethods.prototype.getContentComments = function (
|
|
403
|
-
|
|
404
|
-
if (skip === void 0) { skip = 0; }
|
|
405
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
434
|
+
ContentMethods.prototype.getContentComments = function (locale_1, guid_1, contentID_1) {
|
|
435
|
+
return __awaiter(this, arguments, void 0, function (locale, guid, contentID, take, skip) {
|
|
406
436
|
var apiPath, resp, err_13;
|
|
437
|
+
if (take === void 0) { take = 50; }
|
|
438
|
+
if (skip === void 0) { skip = 0; }
|
|
407
439
|
return __generator(this, function (_a) {
|
|
408
440
|
switch (_a.label) {
|
|
409
441
|
case 0:
|
|
410
442
|
_a.trys.push([0, 2, , 3]);
|
|
411
|
-
apiPath = locale
|
|
443
|
+
apiPath = "".concat(locale, "/item/").concat(contentID, "/comments?take=").concat(take, "&skip=").concat(skip);
|
|
412
444
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
413
445
|
case 1:
|
|
414
446
|
resp = _a.sent();
|
|
415
447
|
return [2 /*return*/, resp.data];
|
|
416
448
|
case 2:
|
|
417
449
|
err_13 = _a.sent();
|
|
418
|
-
throw new exception_1.Exception("Unable to retrieve comments for contentID: "
|
|
450
|
+
throw new exception_1.Exception("Unable to retrieve comments for contentID: ".concat(contentID));
|
|
419
451
|
case 3: return [2 /*return*/];
|
|
420
452
|
}
|
|
421
453
|
});
|