@agility/management-sdk 0.1.35 → 0.1.37
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 +371 -317
- package/dist/apiMethods/clientInstance.d.ts +2 -0
- package/dist/apiMethods/clientInstance.js +11 -2
- package/dist/apiMethods/containerMethods.d.ts +3 -0
- package/dist/apiMethods/containerMethods.js +43 -9
- package/dist/apiMethods/contentMethods.d.ts +12 -0
- package/dist/apiMethods/contentMethods.js +119 -48
- package/dist/apiMethods/pageMethods.d.ts +12 -0
- package/dist/apiMethods/pageMethods.js +88 -34
- package/dist/enums/contentViewType.d.ts +6 -0
- package/dist/enums/contentViewType.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/models/pagedResult.d.ts +4 -0
- package/dist/models/pagedResult.js +2 -0
- package/dist/util/queryString.d.ts +8 -0
- package/dist/util/queryString.js +27 -0
- package/docs/asset-methods.md +381 -381
- package/docs/auth-component.md +360 -360
- package/docs/auth.md +593 -593
- package/docs/batch-methods.md +243 -243
- package/docs/cicd.md +606 -606
- package/docs/container-methods.md +267 -267
- package/docs/content-methods.md +491 -422
- package/docs/instance-methods.md +104 -104
- package/docs/instance-user-methods.md +230 -230
- package/docs/model-methods.md +433 -433
- package/docs/multi-instance-operations.md +191 -191
- package/docs/page-methods.md +737 -670
- package/docs/server-user-methods.md +279 -279
- package/docs/webhook-methods.md +451 -451
- package/license.txt +20 -20
- package/package.json +40 -40
- package/tsconfig.json +14 -14
- package/.cursor/api-coverage.md +0 -217
- package/.cursor/api-documentation-manifest.md +0 -275
- package/.cursor/api-functions-analysis.md +0 -111
- package/.cursor/breakout-manifest.md +0 -278
- package/.cursor/docs-final-check.md +0 -269
- package/.cursor/github-actions-improvements.md +0 -76
- package/.cursor/hardening.md +0 -271
- package/.cursor/linting-fix.md +0 -160
- package/.cursor/manifest.md +0 -243
- package/.cursor/mocks.md +0 -100
- package/.cursor/test-coverage.md +0 -841
- package/.env +0 -92
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/coverage-summary.json +0 -43
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -161
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -161
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/src/apiClient.ts.html +0 -199
- package/coverage/lcov-report/src/apiMethods/assetMethods.ts.html +0 -682
- package/coverage/lcov-report/src/apiMethods/batchMethods.ts.html +0 -736
- package/coverage/lcov-report/src/apiMethods/clientInstance.ts.html +0 -403
- package/coverage/lcov-report/src/apiMethods/containerMethods.ts.html +0 -460
- package/coverage/lcov-report/src/apiMethods/contentMethods.ts.html +0 -1183
- package/coverage/lcov-report/src/apiMethods/index.html +0 -266
- package/coverage/lcov-report/src/apiMethods/instanceMethods.ts.html +0 -160
- package/coverage/lcov-report/src/apiMethods/instanceUserMethods.ts.html +0 -268
- package/coverage/lcov-report/src/apiMethods/modelMethods.ts.html +0 -352
- package/coverage/lcov-report/src/apiMethods/pageMethods.ts.html +0 -1276
- package/coverage/lcov-report/src/apiMethods/serverUserMethods.ts.html +0 -196
- package/coverage/lcov-report/src/apiMethods/webhookMethods.ts.html +0 -271
- package/coverage/lcov-report/src/enums/batchItemType.ts.html +0 -106
- package/coverage/lcov-report/src/enums/batchOperationType.ts.html +0 -142
- package/coverage/lcov-report/src/enums/batchState..ts.html +0 -106
- package/coverage/lcov-report/src/enums/index.html +0 -161
- package/coverage/lcov-report/src/enums/workflowOperationType.ts.html +0 -175
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/src/models/assetContainer.ts.html +0 -106
- package/coverage/lcov-report/src/models/assetGalleries.ts.html +0 -103
- package/coverage/lcov-report/src/models/assetMediaGrouping.ts.html +0 -136
- package/coverage/lcov-report/src/models/assetMediaGroupingMetaData.ts.html +0 -97
- package/coverage/lcov-report/src/models/batch.ts.html +0 -178
- package/coverage/lcov-report/src/models/batchItem.ts.html +0 -127
- package/coverage/lcov-report/src/models/container.ts.html +0 -232
- package/coverage/lcov-report/src/models/contentDefinitionTypeID.ts.html +0 -142
- package/coverage/lcov-report/src/models/contentItem.ts.html +0 -202
- package/coverage/lcov-report/src/models/contentSectionDefaultModule.ts.html +0 -106
- package/coverage/lcov-report/src/models/contentSectionDefinition.ts.html +0 -196
- package/coverage/lcov-report/src/models/contentViewColumn.ts.html +0 -109
- package/coverage/lcov-report/src/models/exception.ts.html +0 -109
- package/coverage/lcov-report/src/models/index.html +0 -476
- package/coverage/lcov-report/src/models/instanceRole.ts.html +0 -106
- package/coverage/lcov-report/src/models/instanceUser.ts.html +0 -130
- package/coverage/lcov-report/src/models/locales.ts.html +0 -100
- package/coverage/lcov-report/src/models/media.ts.html +0 -178
- package/coverage/lcov-report/src/models/model.ts.html +0 -172
- package/coverage/lcov-report/src/models/notification.ts.html +0 -124
- package/coverage/lcov-report/src/models/options.ts.html +0 -109
- package/coverage/lcov-report/src/models/pageItem.ts.html +0 -268
- package/coverage/lcov-report/src/models/pageModel.ts.html +0 -130
- package/coverage/lcov-report/src/models/sharedModule.ts.html +0 -106
- package/coverage/lcov-report/src/models/sitemap.ts.html +0 -148
- package/coverage/lcov-report/src/models/websiteUser.ts.html +0 -157
- package/coverage/lcov.info +0 -1459
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/coverage/src/apiClient.ts.html +0 -199
- package/coverage/src/apiMethods/assetMethods.ts.html +0 -682
- package/coverage/src/apiMethods/batchMethods.ts.html +0 -736
- package/coverage/src/apiMethods/clientInstance.ts.html +0 -403
- package/coverage/src/apiMethods/containerMethods.ts.html +0 -460
- package/coverage/src/apiMethods/contentMethods.ts.html +0 -1183
- package/coverage/src/apiMethods/index.html +0 -266
- package/coverage/src/apiMethods/instanceMethods.ts.html +0 -160
- package/coverage/src/apiMethods/instanceUserMethods.ts.html +0 -268
- package/coverage/src/apiMethods/modelMethods.ts.html +0 -352
- package/coverage/src/apiMethods/pageMethods.ts.html +0 -1276
- package/coverage/src/apiMethods/serverUserMethods.ts.html +0 -196
- package/coverage/src/apiMethods/webhookMethods.ts.html +0 -271
- package/coverage/src/enums/batchItemType.ts.html +0 -106
- package/coverage/src/enums/batchOperationType.ts.html +0 -142
- package/coverage/src/enums/batchState..ts.html +0 -106
- package/coverage/src/enums/index.html +0 -161
- package/coverage/src/enums/workflowOperationType.ts.html +0 -175
- package/coverage/src/index.html +0 -116
- package/coverage/src/models/assetContainer.ts.html +0 -106
- package/coverage/src/models/assetGalleries.ts.html +0 -103
- package/coverage/src/models/assetMediaGrouping.ts.html +0 -136
- package/coverage/src/models/assetMediaGroupingMetaData.ts.html +0 -97
- package/coverage/src/models/batch.ts.html +0 -178
- package/coverage/src/models/batchItem.ts.html +0 -127
- package/coverage/src/models/container.ts.html +0 -232
- package/coverage/src/models/contentDefinitionTypeID.ts.html +0 -142
- package/coverage/src/models/contentItem.ts.html +0 -202
- package/coverage/src/models/contentSectionDefaultModule.ts.html +0 -106
- package/coverage/src/models/contentSectionDefinition.ts.html +0 -196
- package/coverage/src/models/contentViewColumn.ts.html +0 -109
- package/coverage/src/models/exception.ts.html +0 -109
- package/coverage/src/models/index.html +0 -476
- package/coverage/src/models/instanceRole.ts.html +0 -106
- package/coverage/src/models/instanceUser.ts.html +0 -130
- package/coverage/src/models/locales.ts.html +0 -100
- package/coverage/src/models/media.ts.html +0 -178
- package/coverage/src/models/model.ts.html +0 -172
- package/coverage/src/models/notification.ts.html +0 -124
- package/coverage/src/models/options.ts.html +0 -109
- package/coverage/src/models/pageItem.ts.html +0 -268
- package/coverage/src/models/pageModel.ts.html +0 -130
- package/coverage/src/models/sharedModule.ts.html +0 -106
- package/coverage/src/models/sitemap.ts.html +0 -148
- package/coverage/src/models/websiteUser.ts.html +0 -157
- package/dist/.tsbuildinfo +0 -1
- package/dist/apiClient.d.ts.map +0 -1
- package/dist/apiClient.js.map +0 -1
- package/dist/apiMethods/assetMethods.d.ts.map +0 -1
- package/dist/apiMethods/assetMethods.js.map +0 -1
- package/dist/apiMethods/batchMethods.d.ts.map +0 -1
- package/dist/apiMethods/batchMethods.js.map +0 -1
- package/dist/apiMethods/clientInstance.d.ts.map +0 -1
- package/dist/apiMethods/clientInstance.js.map +0 -1
- package/dist/apiMethods/containerMethods.d.ts.map +0 -1
- package/dist/apiMethods/containerMethods.js.map +0 -1
- package/dist/apiMethods/contentMethods.d.ts.map +0 -1
- package/dist/apiMethods/contentMethods.js.map +0 -1
- package/dist/apiMethods/instanceMethods.d.ts.map +0 -1
- package/dist/apiMethods/instanceMethods.js.map +0 -1
- package/dist/apiMethods/instanceUserMethods.d.ts.map +0 -1
- package/dist/apiMethods/instanceUserMethods.js.map +0 -1
- package/dist/apiMethods/modelMethods.d.ts.map +0 -1
- package/dist/apiMethods/modelMethods.js.map +0 -1
- package/dist/apiMethods/pageMethods.d.ts.map +0 -1
- package/dist/apiMethods/pageMethods.js.map +0 -1
- package/dist/apiMethods/serverUserMethods.d.ts.map +0 -1
- package/dist/apiMethods/serverUserMethods.js.map +0 -1
- package/dist/apiMethods/webhookMethods.d.ts.map +0 -1
- package/dist/apiMethods/webhookMethods.js.map +0 -1
- package/dist/enums/assetGroupingType.d.ts.map +0 -1
- package/dist/enums/assetGroupingType.js.map +0 -1
- package/dist/enums/batchItemType.d.ts.map +0 -1
- package/dist/enums/batchItemType.js.map +0 -1
- package/dist/enums/batchOperationType.d.ts.map +0 -1
- package/dist/enums/batchOperationType.js.map +0 -1
- package/dist/enums/batchState..d.ts.map +0 -1
- package/dist/enums/batchState..js.map +0 -1
- package/dist/enums/pageItemTemplateType.d.ts.map +0 -1
- package/dist/enums/pageItemTemplateType.js.map +0 -1
- package/dist/enums/workflowOperationType.d.ts.map +0 -1
- package/dist/enums/workflowOperationType.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/models/assetContainer.d.ts.map +0 -1
- package/dist/models/assetContainer.js.map +0 -1
- package/dist/models/assetGalleries.d.ts.map +0 -1
- package/dist/models/assetGalleries.js.map +0 -1
- package/dist/models/assetMediaGrouping.d.ts.map +0 -1
- package/dist/models/assetMediaGrouping.js.map +0 -1
- package/dist/models/assetMediaGroupingMetaData.d.ts.map +0 -1
- package/dist/models/assetMediaGroupingMetaData.js.map +0 -1
- package/dist/models/batch.d.ts.map +0 -1
- package/dist/models/batch.js.map +0 -1
- package/dist/models/batchItem.d.ts.map +0 -1
- package/dist/models/batchItem.js.map +0 -1
- package/dist/models/batchTypes.d.ts.map +0 -1
- package/dist/models/batchTypes.js.map +0 -1
- package/dist/models/container.d.ts.map +0 -1
- package/dist/models/container.js.map +0 -1
- package/dist/models/contentDefinitionTypeID.d.ts.map +0 -1
- package/dist/models/contentDefinitionTypeID.js.map +0 -1
- package/dist/models/contentItem.d.ts.map +0 -1
- package/dist/models/contentItem.js.map +0 -1
- package/dist/models/contentItemHistory.d.ts.map +0 -1
- package/dist/models/contentItemHistory.js.map +0 -1
- package/dist/models/contentListFilterModel.d.ts.map +0 -1
- package/dist/models/contentListFilterModel.js.map +0 -1
- package/dist/models/contentSectionDefaultModule.d.ts.map +0 -1
- package/dist/models/contentSectionDefaultModule.js.map +0 -1
- package/dist/models/contentSectionDefinition.d.ts.map +0 -1
- package/dist/models/contentSectionDefinition.js.map +0 -1
- package/dist/models/contentViewColumn.d.ts.map +0 -1
- package/dist/models/contentViewColumn.js.map +0 -1
- package/dist/models/exception.d.ts.map +0 -1
- package/dist/models/exception.js.map +0 -1
- package/dist/models/instanceRole.d.ts.map +0 -1
- package/dist/models/instanceRole.js.map +0 -1
- package/dist/models/instanceUser.d.ts.map +0 -1
- package/dist/models/instanceUser.js.map +0 -1
- package/dist/models/itemComments.d.ts.map +0 -1
- package/dist/models/itemComments.js.map +0 -1
- package/dist/models/listParams.d.ts.map +0 -1
- package/dist/models/listParams.js.map +0 -1
- package/dist/models/locales.d.ts.map +0 -1
- package/dist/models/locales.js.map +0 -1
- package/dist/models/media.d.ts.map +0 -1
- package/dist/models/media.js.map +0 -1
- package/dist/models/model.d.ts.map +0 -1
- package/dist/models/model.js.map +0 -1
- package/dist/models/notification.d.ts.map +0 -1
- package/dist/models/notification.js.map +0 -1
- package/dist/models/options.d.ts.map +0 -1
- package/dist/models/options.js.map +0 -1
- package/dist/models/pageHistory.d.ts.map +0 -1
- package/dist/models/pageHistory.js.map +0 -1
- package/dist/models/pageItem.d.ts.map +0 -1
- package/dist/models/pageItem.js.map +0 -1
- package/dist/models/pageModel.d.ts.map +0 -1
- package/dist/models/pageModel.js.map +0 -1
- package/dist/models/serverUser.d.ts.map +0 -1
- package/dist/models/serverUser.js.map +0 -1
- package/dist/models/sharedModule.d.ts.map +0 -1
- package/dist/models/sharedModule.js.map +0 -1
- package/dist/models/sitemap.d.ts.map +0 -1
- package/dist/models/sitemap.js.map +0 -1
- package/dist/models/webhook.d.ts.map +0 -1
- package/dist/models/webhook.js.map +0 -1
- package/dist/models/websiteListing.d.ts.map +0 -1
- package/dist/models/websiteListing.js.map +0 -1
- package/dist/models/websiteUser.d.ts.map +0 -1
- package/dist/models/websiteUser.js.map +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import https from 'https';
|
|
2
3
|
import { Options } from "../models/options";
|
|
3
4
|
export declare class ClientInstance {
|
|
4
5
|
_options: Options;
|
|
6
|
+
_httpsAgent: https.Agent | undefined;
|
|
5
7
|
constructor(options: Options);
|
|
6
8
|
/**
|
|
7
9
|
* Figure out the Base Url, which can be overriden using options.baseUrl
|
|
@@ -41,9 +41,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
exports.ClientInstance = void 0;
|
|
43
43
|
var axios_1 = __importDefault(require("axios"));
|
|
44
|
+
var https_1 = __importDefault(require("https"));
|
|
44
45
|
var ClientInstance = /** @class */ (function () {
|
|
45
46
|
function ClientInstance(options) {
|
|
46
47
|
this._options = options;
|
|
48
|
+
// Create an HTTPS agent that ignores SSL certificate errors for local development
|
|
49
|
+
if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') {
|
|
50
|
+
this._httpsAgent = new https_1.default.Agent({
|
|
51
|
+
rejectUnauthorized: false
|
|
52
|
+
});
|
|
53
|
+
}
|
|
47
54
|
}
|
|
48
55
|
/**
|
|
49
56
|
* Figure out the Base Url, which can be overriden using options.baseUrl
|
|
@@ -83,7 +90,8 @@ var ClientInstance = /** @class */ (function () {
|
|
|
83
90
|
var instance = axios_1.default.create({
|
|
84
91
|
baseURL: "".concat(baseUrl, "/api/v1/instance/").concat(guid),
|
|
85
92
|
maxContentLength: Infinity,
|
|
86
|
-
maxBodyLength: Infinity
|
|
93
|
+
maxBodyLength: Infinity,
|
|
94
|
+
httpsAgent: this._httpsAgent
|
|
87
95
|
});
|
|
88
96
|
return instance;
|
|
89
97
|
};
|
|
@@ -92,7 +100,8 @@ var ClientInstance = /** @class */ (function () {
|
|
|
92
100
|
var instance = axios_1.default.create({
|
|
93
101
|
baseURL: "".concat(baseUrl, "/api/v1"),
|
|
94
102
|
maxContentLength: Infinity,
|
|
95
|
-
maxBodyLength: Infinity
|
|
103
|
+
maxBodyLength: Infinity,
|
|
104
|
+
httpsAgent: this._httpsAgent
|
|
96
105
|
});
|
|
97
106
|
return instance;
|
|
98
107
|
};
|
|
@@ -2,6 +2,8 @@ import { Options } from "../models/options";
|
|
|
2
2
|
import { ClientInstance } from "./clientInstance";
|
|
3
3
|
import { Container } from "../models/container";
|
|
4
4
|
import { Notification } from "../models/notification";
|
|
5
|
+
import { PagedResult } from "../models/pagedResult";
|
|
6
|
+
import { ContentViewType } from "../enums/contentViewType";
|
|
5
7
|
export declare class ContainerMethods {
|
|
6
8
|
_options: Options;
|
|
7
9
|
_clientInstance: ClientInstance;
|
|
@@ -18,6 +20,7 @@ export declare class ContainerMethods {
|
|
|
18
20
|
getContainerByReferenceName(referenceName: string, guid: string): Promise<Container | null>;
|
|
19
21
|
getContainerSecurity(id: number, guid: string): Promise<Container>;
|
|
20
22
|
getContainerList(guid: string): Promise<Container[]>;
|
|
23
|
+
getContainerListPaged(guid: string, pageSize?: number, recordOffset?: number, contentType?: ContentViewType, includeModules?: boolean, updatedSince?: Date): Promise<PagedResult<Container>>;
|
|
21
24
|
getNotificationList(id: number, guid: string): Promise<Notification[]>;
|
|
22
25
|
saveContainer(container: Container, guid: string, forceReferenceName?: boolean): Promise<Container>;
|
|
23
26
|
deleteContainer(id: number, guid: string): Promise<string>;
|
|
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.ContainerMethods = void 0;
|
|
40
40
|
var clientInstance_1 = require("./clientInstance");
|
|
41
41
|
var exception_1 = require("../models/exception");
|
|
42
|
+
var contentViewType_1 = require("../enums/contentViewType");
|
|
42
43
|
var ContainerMethods = /** @class */ (function () {
|
|
43
44
|
function ContainerMethods(options) {
|
|
44
45
|
this._options = options;
|
|
@@ -155,9 +156,42 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
155
156
|
});
|
|
156
157
|
});
|
|
157
158
|
};
|
|
159
|
+
ContainerMethods.prototype.getContainerListPaged = function (guid_1) {
|
|
160
|
+
return __awaiter(this, arguments, void 0, function (guid, pageSize, recordOffset, contentType, includeModules, updatedSince) {
|
|
161
|
+
var params, apiPath, resp, err_6;
|
|
162
|
+
if (pageSize === void 0) { pageSize = 20; }
|
|
163
|
+
if (recordOffset === void 0) { recordOffset = 0; }
|
|
164
|
+
if (contentType === void 0) { contentType = contentViewType_1.ContentViewType.All; }
|
|
165
|
+
if (includeModules === void 0) { includeModules = true; }
|
|
166
|
+
return __generator(this, function (_a) {
|
|
167
|
+
switch (_a.label) {
|
|
168
|
+
case 0:
|
|
169
|
+
_a.trys.push([0, 2, , 3]);
|
|
170
|
+
params = new URLSearchParams({
|
|
171
|
+
pageSize: pageSize.toString(),
|
|
172
|
+
recordOffset: recordOffset.toString(),
|
|
173
|
+
contentType: contentType.toString(),
|
|
174
|
+
includeModules: includeModules.toString()
|
|
175
|
+
});
|
|
176
|
+
if (updatedSince) {
|
|
177
|
+
params.append('updatedSince', updatedSince.toISOString());
|
|
178
|
+
}
|
|
179
|
+
apiPath = "container/list/paged?".concat(params.toString());
|
|
180
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
181
|
+
case 1:
|
|
182
|
+
resp = _a.sent();
|
|
183
|
+
return [2 /*return*/, resp.data];
|
|
184
|
+
case 2:
|
|
185
|
+
err_6 = _a.sent();
|
|
186
|
+
throw new exception_1.Exception("Unable to retrieve the paged container list", err_6);
|
|
187
|
+
case 3: return [2 /*return*/];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
};
|
|
158
192
|
ContainerMethods.prototype.getNotificationList = function (id, guid) {
|
|
159
193
|
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
-
var apiPath, resp,
|
|
194
|
+
var apiPath, resp, err_7;
|
|
161
195
|
return __generator(this, function (_a) {
|
|
162
196
|
switch (_a.label) {
|
|
163
197
|
case 0:
|
|
@@ -168,8 +202,8 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
168
202
|
resp = _a.sent();
|
|
169
203
|
return [2 /*return*/, resp.data];
|
|
170
204
|
case 2:
|
|
171
|
-
|
|
172
|
-
throw new exception_1.Exception("Unable to retrieve the notifications for container id: ".concat(id),
|
|
205
|
+
err_7 = _a.sent();
|
|
206
|
+
throw new exception_1.Exception("Unable to retrieve the notifications for container id: ".concat(id), err_7);
|
|
173
207
|
case 3: return [2 /*return*/];
|
|
174
208
|
}
|
|
175
209
|
});
|
|
@@ -177,7 +211,7 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
177
211
|
};
|
|
178
212
|
ContainerMethods.prototype.saveContainer = function (container_1, guid_1) {
|
|
179
213
|
return __awaiter(this, arguments, void 0, function (container, guid, forceReferenceName) {
|
|
180
|
-
var apiPath, resp,
|
|
214
|
+
var apiPath, resp, err_8;
|
|
181
215
|
if (forceReferenceName === void 0) { forceReferenceName = false; }
|
|
182
216
|
return __generator(this, function (_a) {
|
|
183
217
|
switch (_a.label) {
|
|
@@ -189,8 +223,8 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
189
223
|
resp = _a.sent();
|
|
190
224
|
return [2 /*return*/, resp.data];
|
|
191
225
|
case 2:
|
|
192
|
-
|
|
193
|
-
throw new exception_1.Exception("Unable to save the container",
|
|
226
|
+
err_8 = _a.sent();
|
|
227
|
+
throw new exception_1.Exception("Unable to save the container", err_8);
|
|
194
228
|
case 3: return [2 /*return*/];
|
|
195
229
|
}
|
|
196
230
|
});
|
|
@@ -198,7 +232,7 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
198
232
|
};
|
|
199
233
|
ContainerMethods.prototype.deleteContainer = function (id, guid) {
|
|
200
234
|
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
var apiPath, resp,
|
|
235
|
+
var apiPath, resp, err_9;
|
|
202
236
|
return __generator(this, function (_a) {
|
|
203
237
|
switch (_a.label) {
|
|
204
238
|
case 0:
|
|
@@ -209,8 +243,8 @@ var ContainerMethods = /** @class */ (function () {
|
|
|
209
243
|
resp = _a.sent();
|
|
210
244
|
return [2 /*return*/, resp.data];
|
|
211
245
|
case 2:
|
|
212
|
-
|
|
213
|
-
throw new exception_1.Exception("Unable to delete the container for id: ".concat(id),
|
|
246
|
+
err_9 = _a.sent();
|
|
247
|
+
throw new exception_1.Exception("Unable to delete the container for id: ".concat(id), err_9);
|
|
214
248
|
case 3: return [2 /*return*/];
|
|
215
249
|
}
|
|
216
250
|
});
|
|
@@ -6,6 +6,7 @@ import { ContentListFilterModel } from "../models/contentListFilterModel";
|
|
|
6
6
|
import { ContentItemHistory } from "../models/contentItemHistory";
|
|
7
7
|
import { ItemComments } from "../models/itemComments";
|
|
8
8
|
import { ListParams } from "../models/listParams";
|
|
9
|
+
import { WorkflowOperationType } from "../enums/workflowOperationType";
|
|
9
10
|
export declare class ContentMethods {
|
|
10
11
|
_options: Options;
|
|
11
12
|
_clientInstance: ClientInstance;
|
|
@@ -14,6 +15,17 @@ export declare class ContentMethods {
|
|
|
14
15
|
getContentItem(contentID: number, guid: string, locale: string): Promise<ContentItem>;
|
|
15
16
|
publishContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
16
17
|
unPublishContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Perform a batch workflow operation on multiple content items.
|
|
20
|
+
* Supports Publish, Unpublish, Approve, Decline, and RequestApproval operations.
|
|
21
|
+
* @param contentIDs Array of content IDs to process
|
|
22
|
+
* @param guid The GUID of the user making the request
|
|
23
|
+
* @param locale The locale of the content items
|
|
24
|
+
* @param operation The workflow operation type (Publish, Unpublish, Approve, Decline, RequestApproval)
|
|
25
|
+
* @param returnBatchId Whether to return the batch ID immediately
|
|
26
|
+
* @returns The IDs of the processed content items
|
|
27
|
+
*/
|
|
28
|
+
batchWorkflowContent(contentIDs: number[], guid: string, locale: string, operation: WorkflowOperationType, returnBatchId?: boolean): Promise<number[]>;
|
|
17
29
|
contentRequestApproval(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
18
30
|
approveContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
19
31
|
declineContent(contentID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
@@ -40,6 +40,9 @@ exports.ContentMethods = void 0;
|
|
|
40
40
|
var clientInstance_1 = require("./clientInstance");
|
|
41
41
|
var batchMethods_1 = require("./batchMethods");
|
|
42
42
|
var exception_1 = require("../models/exception");
|
|
43
|
+
var queryString_1 = require("../util/queryString");
|
|
44
|
+
var batchState_1 = require("../enums/batchState.");
|
|
45
|
+
var workflowOperationType_1 = require("../enums/workflowOperationType");
|
|
43
46
|
var ContentMethods = /** @class */ (function () {
|
|
44
47
|
function ContentMethods(options) {
|
|
45
48
|
this._options = options;
|
|
@@ -142,9 +145,61 @@ var ContentMethods = /** @class */ (function () {
|
|
|
142
145
|
});
|
|
143
146
|
});
|
|
144
147
|
};
|
|
148
|
+
/**
|
|
149
|
+
* Perform a batch workflow operation on multiple content items.
|
|
150
|
+
* Supports Publish, Unpublish, Approve, Decline, and RequestApproval operations.
|
|
151
|
+
* @param contentIDs Array of content IDs to process
|
|
152
|
+
* @param guid The GUID of the user making the request
|
|
153
|
+
* @param locale The locale of the content items
|
|
154
|
+
* @param operation The workflow operation type (Publish, Unpublish, Approve, Decline, RequestApproval)
|
|
155
|
+
* @param returnBatchId Whether to return the batch ID immediately
|
|
156
|
+
* @returns The IDs of the processed content items
|
|
157
|
+
*/
|
|
158
|
+
ContentMethods.prototype.batchWorkflowContent = function (contentIDs_3, guid_1, locale_1, operation_1) {
|
|
159
|
+
return __awaiter(this, arguments, void 0, function (contentIDs, guid, locale, operation, returnBatchId) {
|
|
160
|
+
var contentIDsParam, operationName, apiPath, resp, batchID_3, batch, processedContentIDs_1, err_4;
|
|
161
|
+
var _this = this;
|
|
162
|
+
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
_a.trys.push([0, 3, , 4]);
|
|
167
|
+
contentIDsParam = contentIDs.join(',');
|
|
168
|
+
operationName = workflowOperationType_1.WorkflowOperationType[operation];
|
|
169
|
+
apiPath = "".concat(locale, "/item/batch-workflow?contentIDs=").concat(contentIDsParam, "&operation=").concat(operationName);
|
|
170
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
171
|
+
case 1:
|
|
172
|
+
resp = _a.sent();
|
|
173
|
+
batchID_3 = resp.data;
|
|
174
|
+
// If user wants batchID immediately, return it for custom polling
|
|
175
|
+
if (returnBatchId) {
|
|
176
|
+
return [2 /*return*/, [batchID_3]];
|
|
177
|
+
}
|
|
178
|
+
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
179
|
+
switch (_a.label) {
|
|
180
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_3, guid)];
|
|
181
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
182
|
+
}
|
|
183
|
+
}); }); })];
|
|
184
|
+
case 2:
|
|
185
|
+
batch = _a.sent();
|
|
186
|
+
if (batch.batchState === batchState_1.BatchState.Processed && batch.errorData && batch.errorData.length > 0) {
|
|
187
|
+
throw new exception_1.Exception("Unable to batch ".concat(operationName.toLowerCase(), " content items. Batch is not completed. Error: ").concat(batch.errorData), null);
|
|
188
|
+
}
|
|
189
|
+
processedContentIDs_1 = [];
|
|
190
|
+
batch.items.forEach(function (element) { return processedContentIDs_1.push(element.itemID); });
|
|
191
|
+
return [2 /*return*/, processedContentIDs_1];
|
|
192
|
+
case 3:
|
|
193
|
+
err_4 = _a.sent();
|
|
194
|
+
throw new exception_1.Exception("Unable to batch ".concat(workflowOperationType_1.WorkflowOperationType[operation].toLowerCase(), " content items."), err_4);
|
|
195
|
+
case 4: return [2 /*return*/];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
};
|
|
145
200
|
ContentMethods.prototype.contentRequestApproval = function (contentID_1, guid_1, locale_1) {
|
|
146
201
|
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
147
|
-
var apiPath, resp,
|
|
202
|
+
var apiPath, resp, batchID_4, batch, contentIDs_3, err_5;
|
|
148
203
|
var _this = this;
|
|
149
204
|
if (comments === void 0) { comments = null; }
|
|
150
205
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
@@ -156,14 +211,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
156
211
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
157
212
|
case 1:
|
|
158
213
|
resp = _a.sent();
|
|
159
|
-
|
|
214
|
+
batchID_4 = resp.data;
|
|
160
215
|
// If user wants batchID immediately, return it for custom polling
|
|
161
216
|
if (returnBatchId) {
|
|
162
|
-
return [2 /*return*/, [
|
|
217
|
+
return [2 /*return*/, [batchID_4]];
|
|
163
218
|
}
|
|
164
219
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
165
220
|
switch (_a.label) {
|
|
166
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
221
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_4, guid)];
|
|
167
222
|
case 1: return [2 /*return*/, _a.sent()];
|
|
168
223
|
}
|
|
169
224
|
}); }); })];
|
|
@@ -173,8 +228,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
173
228
|
batch.items.forEach(function (element) { return contentIDs_3.push(element.itemID); });
|
|
174
229
|
return [2 /*return*/, contentIDs_3];
|
|
175
230
|
case 3:
|
|
176
|
-
|
|
177
|
-
throw new exception_1.Exception("Unable to request approval the content for id: ".concat(contentID),
|
|
231
|
+
err_5 = _a.sent();
|
|
232
|
+
throw new exception_1.Exception("Unable to request approval the content for id: ".concat(contentID), err_5);
|
|
178
233
|
case 4: return [2 /*return*/];
|
|
179
234
|
}
|
|
180
235
|
});
|
|
@@ -182,7 +237,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
182
237
|
};
|
|
183
238
|
ContentMethods.prototype.approveContent = function (contentID_1, guid_1, locale_1) {
|
|
184
239
|
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
185
|
-
var apiPath, resp,
|
|
240
|
+
var apiPath, resp, batchID_5, batch, contentIDs_4, err_6;
|
|
186
241
|
var _this = this;
|
|
187
242
|
if (comments === void 0) { comments = null; }
|
|
188
243
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
@@ -194,14 +249,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
194
249
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
195
250
|
case 1:
|
|
196
251
|
resp = _a.sent();
|
|
197
|
-
|
|
252
|
+
batchID_5 = resp.data;
|
|
198
253
|
// If user wants batchID immediately, return it for custom polling
|
|
199
254
|
if (returnBatchId) {
|
|
200
|
-
return [2 /*return*/, [
|
|
255
|
+
return [2 /*return*/, [batchID_5]];
|
|
201
256
|
}
|
|
202
257
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
203
258
|
switch (_a.label) {
|
|
204
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
259
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_5, guid)];
|
|
205
260
|
case 1: return [2 /*return*/, _a.sent()];
|
|
206
261
|
}
|
|
207
262
|
}); }); })];
|
|
@@ -211,8 +266,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
211
266
|
batch.items.forEach(function (element) { return contentIDs_4.push(element.itemID); });
|
|
212
267
|
return [2 /*return*/, contentIDs_4];
|
|
213
268
|
case 3:
|
|
214
|
-
|
|
215
|
-
throw new exception_1.Exception("Unable to approve the content for id: ".concat(contentID),
|
|
269
|
+
err_6 = _a.sent();
|
|
270
|
+
throw new exception_1.Exception("Unable to approve the content for id: ".concat(contentID), err_6);
|
|
216
271
|
case 4: return [2 /*return*/];
|
|
217
272
|
}
|
|
218
273
|
});
|
|
@@ -220,7 +275,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
220
275
|
};
|
|
221
276
|
ContentMethods.prototype.declineContent = function (contentID_1, guid_1, locale_1) {
|
|
222
277
|
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
223
|
-
var apiPath, resp,
|
|
278
|
+
var apiPath, resp, batchID_6, batch, contentIDs_5, err_7;
|
|
224
279
|
var _this = this;
|
|
225
280
|
if (comments === void 0) { comments = null; }
|
|
226
281
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
@@ -232,14 +287,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
232
287
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
233
288
|
case 1:
|
|
234
289
|
resp = _a.sent();
|
|
235
|
-
|
|
290
|
+
batchID_6 = resp.data;
|
|
236
291
|
// If user wants batchID immediately, return it for custom polling
|
|
237
292
|
if (returnBatchId) {
|
|
238
|
-
return [2 /*return*/, [
|
|
293
|
+
return [2 /*return*/, [batchID_6]];
|
|
239
294
|
}
|
|
240
295
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
241
296
|
switch (_a.label) {
|
|
242
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
297
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_6, guid)];
|
|
243
298
|
case 1: return [2 /*return*/, _a.sent()];
|
|
244
299
|
}
|
|
245
300
|
}); }); })];
|
|
@@ -249,8 +304,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
249
304
|
batch.items.forEach(function (element) { return contentIDs_5.push(element.itemID); });
|
|
250
305
|
return [2 /*return*/, contentIDs_5];
|
|
251
306
|
case 3:
|
|
252
|
-
|
|
253
|
-
throw new exception_1.Exception("Unable to decline the content for id: ".concat(contentID),
|
|
307
|
+
err_7 = _a.sent();
|
|
308
|
+
throw new exception_1.Exception("Unable to decline the content for id: ".concat(contentID), err_7);
|
|
254
309
|
case 4: return [2 /*return*/];
|
|
255
310
|
}
|
|
256
311
|
});
|
|
@@ -258,7 +313,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
258
313
|
};
|
|
259
314
|
ContentMethods.prototype.deleteContent = function (contentID_1, guid_1, locale_1) {
|
|
260
315
|
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
261
|
-
var apiPath, resp,
|
|
316
|
+
var apiPath, resp, batchID_7, batch, contentIDs_6, err_8;
|
|
262
317
|
var _this = this;
|
|
263
318
|
if (comments === void 0) { comments = null; }
|
|
264
319
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
@@ -270,14 +325,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
270
325
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
271
326
|
case 1:
|
|
272
327
|
resp = _a.sent();
|
|
273
|
-
|
|
328
|
+
batchID_7 = resp.data;
|
|
274
329
|
// If user wants batchID immediately, return it for custom polling
|
|
275
330
|
if (returnBatchId) {
|
|
276
|
-
return [2 /*return*/, [
|
|
331
|
+
return [2 /*return*/, [batchID_7]];
|
|
277
332
|
}
|
|
278
333
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
279
334
|
switch (_a.label) {
|
|
280
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
335
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_7, guid)];
|
|
281
336
|
case 1: return [2 /*return*/, _a.sent()];
|
|
282
337
|
}
|
|
283
338
|
}); }); })];
|
|
@@ -287,8 +342,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
287
342
|
batch.items.forEach(function (element) { return contentIDs_6.push(element.itemID); });
|
|
288
343
|
return [2 /*return*/, contentIDs_6];
|
|
289
344
|
case 3:
|
|
290
|
-
|
|
291
|
-
throw new exception_1.Exception("Unable to delete the content for id: ".concat(contentID),
|
|
345
|
+
err_8 = _a.sent();
|
|
346
|
+
throw new exception_1.Exception("Unable to delete the content for id: ".concat(contentID), err_8);
|
|
292
347
|
case 4: return [2 /*return*/];
|
|
293
348
|
}
|
|
294
349
|
});
|
|
@@ -296,7 +351,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
296
351
|
};
|
|
297
352
|
ContentMethods.prototype.saveContentItem = function (contentItem_1, guid_1, locale_1) {
|
|
298
353
|
return __awaiter(this, arguments, void 0, function (contentItem, guid, locale, returnBatchId) {
|
|
299
|
-
var apiPath, resp,
|
|
354
|
+
var apiPath, resp, batchID_8, batch, contentIDs_7, err_9;
|
|
300
355
|
var _this = this;
|
|
301
356
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
302
357
|
return __generator(this, function (_a) {
|
|
@@ -307,14 +362,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
307
362
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItem)];
|
|
308
363
|
case 1:
|
|
309
364
|
resp = _a.sent();
|
|
310
|
-
|
|
365
|
+
batchID_8 = resp.data;
|
|
311
366
|
// If user wants batchID immediately, return it for custom polling
|
|
312
367
|
if (returnBatchId) {
|
|
313
|
-
return [2 /*return*/, [
|
|
368
|
+
return [2 /*return*/, [batchID_8]];
|
|
314
369
|
}
|
|
315
370
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
316
371
|
switch (_a.label) {
|
|
317
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
372
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_8, guid)];
|
|
318
373
|
case 1: return [2 /*return*/, _a.sent()];
|
|
319
374
|
}
|
|
320
375
|
}); }); })];
|
|
@@ -324,8 +379,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
324
379
|
batch.items.forEach(function (element) { return contentIDs_7.push(element.itemID); });
|
|
325
380
|
return [2 /*return*/, contentIDs_7];
|
|
326
381
|
case 3:
|
|
327
|
-
|
|
328
|
-
throw new exception_1.Exception('Unable to create content.',
|
|
382
|
+
err_9 = _a.sent();
|
|
383
|
+
throw new exception_1.Exception('Unable to create content.', err_9);
|
|
329
384
|
case 4: return [2 /*return*/];
|
|
330
385
|
}
|
|
331
386
|
});
|
|
@@ -333,7 +388,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
333
388
|
};
|
|
334
389
|
ContentMethods.prototype.saveContentItems = function (contentItems_1, guid_1, locale_1) {
|
|
335
390
|
return __awaiter(this, arguments, void 0, function (contentItems, guid, locale, returnBatchId) {
|
|
336
|
-
var apiPath, resp,
|
|
391
|
+
var apiPath, resp, batchID_9, batch, contentIDs_8, err_10;
|
|
337
392
|
var _this = this;
|
|
338
393
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
339
394
|
return __generator(this, function (_a) {
|
|
@@ -344,14 +399,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
344
399
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItems)];
|
|
345
400
|
case 1:
|
|
346
401
|
resp = _a.sent();
|
|
347
|
-
|
|
402
|
+
batchID_9 = resp.data;
|
|
348
403
|
// If user wants batchID immediately, return it for custom polling
|
|
349
404
|
if (returnBatchId) {
|
|
350
|
-
return [2 /*return*/, [
|
|
405
|
+
return [2 /*return*/, [batchID_9]];
|
|
351
406
|
}
|
|
352
407
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
353
408
|
switch (_a.label) {
|
|
354
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
409
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_9, guid)];
|
|
355
410
|
case 1: return [2 /*return*/, _a.sent()];
|
|
356
411
|
}
|
|
357
412
|
}); }); })];
|
|
@@ -361,8 +416,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
361
416
|
batch.items.forEach(function (element) { return contentIDs_8.push(element.itemID); });
|
|
362
417
|
return [2 /*return*/, contentIDs_8];
|
|
363
418
|
case 3:
|
|
364
|
-
|
|
365
|
-
throw new exception_1.Exception('Unable to create contents.',
|
|
419
|
+
err_10 = _a.sent();
|
|
420
|
+
throw new exception_1.Exception('Unable to create contents.', err_10);
|
|
366
421
|
case 4: return [2 /*return*/];
|
|
367
422
|
}
|
|
368
423
|
});
|
|
@@ -370,19 +425,27 @@ var ContentMethods = /** @class */ (function () {
|
|
|
370
425
|
};
|
|
371
426
|
ContentMethods.prototype.getContentItems = function (referenceName, guid, locale, listParams) {
|
|
372
427
|
return __awaiter(this, void 0, void 0, function () {
|
|
373
|
-
var apiPath, resp,
|
|
428
|
+
var queryParams, apiPath, resp, err_11;
|
|
374
429
|
return __generator(this, function (_a) {
|
|
375
430
|
switch (_a.label) {
|
|
376
431
|
case 0:
|
|
377
432
|
_a.trys.push([0, 2, , 3]);
|
|
378
|
-
|
|
433
|
+
queryParams = (0, queryString_1.buildQueryString)({
|
|
434
|
+
filter: listParams.filter,
|
|
435
|
+
fields: listParams.fields,
|
|
436
|
+
sortDirection: listParams.sortDirection,
|
|
437
|
+
sortField: listParams.sortField,
|
|
438
|
+
take: listParams.take,
|
|
439
|
+
skip: listParams.skip
|
|
440
|
+
});
|
|
441
|
+
apiPath = "".concat(locale, "/list/").concat(referenceName).concat(queryParams);
|
|
379
442
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
380
443
|
case 1:
|
|
381
444
|
resp = _a.sent();
|
|
382
445
|
return [2 /*return*/, resp.data];
|
|
383
446
|
case 2:
|
|
384
|
-
|
|
385
|
-
throw new exception_1.Exception("Unable retrieve the content details for reference name: ".concat(referenceName),
|
|
447
|
+
err_11 = _a.sent();
|
|
448
|
+
throw new exception_1.Exception("Unable retrieve the content details for reference name: ".concat(referenceName), err_11);
|
|
386
449
|
case 3: return [2 /*return*/];
|
|
387
450
|
}
|
|
388
451
|
});
|
|
@@ -390,20 +453,28 @@ var ContentMethods = /** @class */ (function () {
|
|
|
390
453
|
};
|
|
391
454
|
ContentMethods.prototype.getContentList = function (referenceName_1, guid_1, locale_1, listParams_1) {
|
|
392
455
|
return __awaiter(this, arguments, void 0, function (referenceName, guid, locale, listParams, filterObject) {
|
|
393
|
-
var apiPath, resp,
|
|
456
|
+
var queryParams, apiPath, resp, err_12;
|
|
394
457
|
if (filterObject === void 0) { filterObject = null; }
|
|
395
458
|
return __generator(this, function (_a) {
|
|
396
459
|
switch (_a.label) {
|
|
397
460
|
case 0:
|
|
398
461
|
_a.trys.push([0, 2, , 3]);
|
|
399
|
-
|
|
462
|
+
queryParams = (0, queryString_1.buildQueryString)({
|
|
463
|
+
fields: listParams.fields,
|
|
464
|
+
sortDirection: listParams.sortDirection,
|
|
465
|
+
sortField: listParams.sortField,
|
|
466
|
+
take: listParams.take,
|
|
467
|
+
skip: listParams.skip,
|
|
468
|
+
showDeleted: listParams.showDeleted
|
|
469
|
+
});
|
|
470
|
+
apiPath = "".concat(locale, "/list/").concat(referenceName).concat(queryParams);
|
|
400
471
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, filterObject)];
|
|
401
472
|
case 1:
|
|
402
473
|
resp = _a.sent();
|
|
403
474
|
return [2 /*return*/, resp.data];
|
|
404
475
|
case 2:
|
|
405
|
-
|
|
406
|
-
throw new exception_1.Exception("Unable retrieve the content details for list with reference name: ".concat(referenceName),
|
|
476
|
+
err_12 = _a.sent();
|
|
477
|
+
throw new exception_1.Exception("Unable retrieve the content details for list with reference name: ".concat(referenceName), err_12);
|
|
407
478
|
case 3: return [2 /*return*/];
|
|
408
479
|
}
|
|
409
480
|
});
|
|
@@ -411,7 +482,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
411
482
|
};
|
|
412
483
|
ContentMethods.prototype.getContentHistory = function (locale_1, guid_1, contentID_1) {
|
|
413
484
|
return __awaiter(this, arguments, void 0, function (locale, guid, contentID, take, skip) {
|
|
414
|
-
var apiPath, resp,
|
|
485
|
+
var apiPath, resp, err_13;
|
|
415
486
|
if (take === void 0) { take = 50; }
|
|
416
487
|
if (skip === void 0) { skip = 0; }
|
|
417
488
|
return __generator(this, function (_a) {
|
|
@@ -424,7 +495,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
424
495
|
resp = _a.sent();
|
|
425
496
|
return [2 /*return*/, resp.data];
|
|
426
497
|
case 2:
|
|
427
|
-
|
|
498
|
+
err_13 = _a.sent();
|
|
428
499
|
throw new exception_1.Exception("Unable to retrieve history for contentID: ".concat(contentID));
|
|
429
500
|
case 3: return [2 /*return*/];
|
|
430
501
|
}
|
|
@@ -433,7 +504,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
433
504
|
};
|
|
434
505
|
ContentMethods.prototype.getContentComments = function (locale_1, guid_1, contentID_1) {
|
|
435
506
|
return __awaiter(this, arguments, void 0, function (locale, guid, contentID, take, skip) {
|
|
436
|
-
var apiPath, resp,
|
|
507
|
+
var apiPath, resp, err_14;
|
|
437
508
|
if (take === void 0) { take = 50; }
|
|
438
509
|
if (skip === void 0) { skip = 0; }
|
|
439
510
|
return __generator(this, function (_a) {
|
|
@@ -446,7 +517,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
446
517
|
resp = _a.sent();
|
|
447
518
|
return [2 /*return*/, resp.data];
|
|
448
519
|
case 2:
|
|
449
|
-
|
|
520
|
+
err_14 = _a.sent();
|
|
450
521
|
throw new exception_1.Exception("Unable to retrieve comments for contentID: ".concat(contentID));
|
|
451
522
|
case 3: return [2 /*return*/];
|
|
452
523
|
}
|
|
@@ -7,6 +7,7 @@ import { PageModel } from "../models/pageModel";
|
|
|
7
7
|
import { ContentSectionDefinition } from "../models/contentSectionDefinition";
|
|
8
8
|
import { PageHistory } from "../models/pageHistory";
|
|
9
9
|
import { ItemComments } from "../models/itemComments";
|
|
10
|
+
import { WorkflowOperationType } from "../enums/workflowOperationType";
|
|
10
11
|
export declare class PageMethods {
|
|
11
12
|
_options: Options;
|
|
12
13
|
_clientInstance: ClientInstance;
|
|
@@ -22,6 +23,17 @@ export declare class PageMethods {
|
|
|
22
23
|
getPage(pageID: number, guid: string, locale: string): Promise<PageItem>;
|
|
23
24
|
publishPage(pageID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
24
25
|
unPublishPage(pageID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Perform a batch workflow operation on multiple pages.
|
|
28
|
+
* Supports Publish, Unpublish, Approve, Decline, and RequestApproval operations.
|
|
29
|
+
* @param pageIDs Array of page IDs to process
|
|
30
|
+
* @param guid The GUID of the user making the request
|
|
31
|
+
* @param locale The locale of the pages
|
|
32
|
+
* @param operation The workflow operation type (Publish, Unpublish, Approve, Decline, RequestApproval)
|
|
33
|
+
* @param returnBatchId Whether to return the batch ID immediately
|
|
34
|
+
* @returns The IDs of the processed pages
|
|
35
|
+
*/
|
|
36
|
+
batchWorkflowPages(pageIDs: number[], guid: string, locale: string, operation: WorkflowOperationType, returnBatchId?: boolean): Promise<number[]>;
|
|
25
37
|
pageRequestApproval(pageID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
26
38
|
approvePage(pageID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|
|
27
39
|
declinePage(pageID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
|