@agility/management-sdk 0.1.36 → 0.1.38
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 +396 -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 +100 -46
- package/dist/apiMethods/instanceMethods.d.ts +13 -0
- package/dist/apiMethods/instanceMethods.js +48 -0
- 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 +3 -0
- package/dist/index.js +3 -0
- package/dist/models/fetchApiStatus.d.ts +38 -0
- package/dist/models/fetchApiStatus.js +2 -0
- package/dist/models/pagedResult.d.ts +4 -0
- package/dist/models/pagedResult.js +2 -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 +185 -105
- 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[]>;
|
|
@@ -41,6 +41,8 @@ var clientInstance_1 = require("./clientInstance");
|
|
|
41
41
|
var batchMethods_1 = require("./batchMethods");
|
|
42
42
|
var exception_1 = require("../models/exception");
|
|
43
43
|
var queryString_1 = require("../util/queryString");
|
|
44
|
+
var batchState_1 = require("../enums/batchState.");
|
|
45
|
+
var workflowOperationType_1 = require("../enums/workflowOperationType");
|
|
44
46
|
var ContentMethods = /** @class */ (function () {
|
|
45
47
|
function ContentMethods(options) {
|
|
46
48
|
this._options = options;
|
|
@@ -143,9 +145,61 @@ var ContentMethods = /** @class */ (function () {
|
|
|
143
145
|
});
|
|
144
146
|
});
|
|
145
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
|
+
};
|
|
146
200
|
ContentMethods.prototype.contentRequestApproval = function (contentID_1, guid_1, locale_1) {
|
|
147
201
|
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
148
|
-
var apiPath, resp,
|
|
202
|
+
var apiPath, resp, batchID_4, batch, contentIDs_3, err_5;
|
|
149
203
|
var _this = this;
|
|
150
204
|
if (comments === void 0) { comments = null; }
|
|
151
205
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
@@ -157,14 +211,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
157
211
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
158
212
|
case 1:
|
|
159
213
|
resp = _a.sent();
|
|
160
|
-
|
|
214
|
+
batchID_4 = resp.data;
|
|
161
215
|
// If user wants batchID immediately, return it for custom polling
|
|
162
216
|
if (returnBatchId) {
|
|
163
|
-
return [2 /*return*/, [
|
|
217
|
+
return [2 /*return*/, [batchID_4]];
|
|
164
218
|
}
|
|
165
219
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
166
220
|
switch (_a.label) {
|
|
167
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
221
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_4, guid)];
|
|
168
222
|
case 1: return [2 /*return*/, _a.sent()];
|
|
169
223
|
}
|
|
170
224
|
}); }); })];
|
|
@@ -174,8 +228,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
174
228
|
batch.items.forEach(function (element) { return contentIDs_3.push(element.itemID); });
|
|
175
229
|
return [2 /*return*/, contentIDs_3];
|
|
176
230
|
case 3:
|
|
177
|
-
|
|
178
|
-
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);
|
|
179
233
|
case 4: return [2 /*return*/];
|
|
180
234
|
}
|
|
181
235
|
});
|
|
@@ -183,7 +237,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
183
237
|
};
|
|
184
238
|
ContentMethods.prototype.approveContent = function (contentID_1, guid_1, locale_1) {
|
|
185
239
|
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
186
|
-
var apiPath, resp,
|
|
240
|
+
var apiPath, resp, batchID_5, batch, contentIDs_4, err_6;
|
|
187
241
|
var _this = this;
|
|
188
242
|
if (comments === void 0) { comments = null; }
|
|
189
243
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
@@ -195,14 +249,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
195
249
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
196
250
|
case 1:
|
|
197
251
|
resp = _a.sent();
|
|
198
|
-
|
|
252
|
+
batchID_5 = resp.data;
|
|
199
253
|
// If user wants batchID immediately, return it for custom polling
|
|
200
254
|
if (returnBatchId) {
|
|
201
|
-
return [2 /*return*/, [
|
|
255
|
+
return [2 /*return*/, [batchID_5]];
|
|
202
256
|
}
|
|
203
257
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
204
258
|
switch (_a.label) {
|
|
205
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
259
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_5, guid)];
|
|
206
260
|
case 1: return [2 /*return*/, _a.sent()];
|
|
207
261
|
}
|
|
208
262
|
}); }); })];
|
|
@@ -212,8 +266,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
212
266
|
batch.items.forEach(function (element) { return contentIDs_4.push(element.itemID); });
|
|
213
267
|
return [2 /*return*/, contentIDs_4];
|
|
214
268
|
case 3:
|
|
215
|
-
|
|
216
|
-
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);
|
|
217
271
|
case 4: return [2 /*return*/];
|
|
218
272
|
}
|
|
219
273
|
});
|
|
@@ -221,7 +275,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
221
275
|
};
|
|
222
276
|
ContentMethods.prototype.declineContent = function (contentID_1, guid_1, locale_1) {
|
|
223
277
|
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
224
|
-
var apiPath, resp,
|
|
278
|
+
var apiPath, resp, batchID_6, batch, contentIDs_5, err_7;
|
|
225
279
|
var _this = this;
|
|
226
280
|
if (comments === void 0) { comments = null; }
|
|
227
281
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
@@ -233,14 +287,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
233
287
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
234
288
|
case 1:
|
|
235
289
|
resp = _a.sent();
|
|
236
|
-
|
|
290
|
+
batchID_6 = resp.data;
|
|
237
291
|
// If user wants batchID immediately, return it for custom polling
|
|
238
292
|
if (returnBatchId) {
|
|
239
|
-
return [2 /*return*/, [
|
|
293
|
+
return [2 /*return*/, [batchID_6]];
|
|
240
294
|
}
|
|
241
295
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
242
296
|
switch (_a.label) {
|
|
243
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
297
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_6, guid)];
|
|
244
298
|
case 1: return [2 /*return*/, _a.sent()];
|
|
245
299
|
}
|
|
246
300
|
}); }); })];
|
|
@@ -250,8 +304,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
250
304
|
batch.items.forEach(function (element) { return contentIDs_5.push(element.itemID); });
|
|
251
305
|
return [2 /*return*/, contentIDs_5];
|
|
252
306
|
case 3:
|
|
253
|
-
|
|
254
|
-
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);
|
|
255
309
|
case 4: return [2 /*return*/];
|
|
256
310
|
}
|
|
257
311
|
});
|
|
@@ -259,7 +313,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
259
313
|
};
|
|
260
314
|
ContentMethods.prototype.deleteContent = function (contentID_1, guid_1, locale_1) {
|
|
261
315
|
return __awaiter(this, arguments, void 0, function (contentID, guid, locale, comments, returnBatchId) {
|
|
262
|
-
var apiPath, resp,
|
|
316
|
+
var apiPath, resp, batchID_7, batch, contentIDs_6, err_8;
|
|
263
317
|
var _this = this;
|
|
264
318
|
if (comments === void 0) { comments = null; }
|
|
265
319
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
@@ -271,14 +325,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
271
325
|
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
272
326
|
case 1:
|
|
273
327
|
resp = _a.sent();
|
|
274
|
-
|
|
328
|
+
batchID_7 = resp.data;
|
|
275
329
|
// If user wants batchID immediately, return it for custom polling
|
|
276
330
|
if (returnBatchId) {
|
|
277
|
-
return [2 /*return*/, [
|
|
331
|
+
return [2 /*return*/, [batchID_7]];
|
|
278
332
|
}
|
|
279
333
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
280
334
|
switch (_a.label) {
|
|
281
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
335
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_7, guid)];
|
|
282
336
|
case 1: return [2 /*return*/, _a.sent()];
|
|
283
337
|
}
|
|
284
338
|
}); }); })];
|
|
@@ -288,8 +342,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
288
342
|
batch.items.forEach(function (element) { return contentIDs_6.push(element.itemID); });
|
|
289
343
|
return [2 /*return*/, contentIDs_6];
|
|
290
344
|
case 3:
|
|
291
|
-
|
|
292
|
-
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);
|
|
293
347
|
case 4: return [2 /*return*/];
|
|
294
348
|
}
|
|
295
349
|
});
|
|
@@ -297,7 +351,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
297
351
|
};
|
|
298
352
|
ContentMethods.prototype.saveContentItem = function (contentItem_1, guid_1, locale_1) {
|
|
299
353
|
return __awaiter(this, arguments, void 0, function (contentItem, guid, locale, returnBatchId) {
|
|
300
|
-
var apiPath, resp,
|
|
354
|
+
var apiPath, resp, batchID_8, batch, contentIDs_7, err_9;
|
|
301
355
|
var _this = this;
|
|
302
356
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
303
357
|
return __generator(this, function (_a) {
|
|
@@ -308,14 +362,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
308
362
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItem)];
|
|
309
363
|
case 1:
|
|
310
364
|
resp = _a.sent();
|
|
311
|
-
|
|
365
|
+
batchID_8 = resp.data;
|
|
312
366
|
// If user wants batchID immediately, return it for custom polling
|
|
313
367
|
if (returnBatchId) {
|
|
314
|
-
return [2 /*return*/, [
|
|
368
|
+
return [2 /*return*/, [batchID_8]];
|
|
315
369
|
}
|
|
316
370
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
317
371
|
switch (_a.label) {
|
|
318
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
372
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_8, guid)];
|
|
319
373
|
case 1: return [2 /*return*/, _a.sent()];
|
|
320
374
|
}
|
|
321
375
|
}); }); })];
|
|
@@ -325,8 +379,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
325
379
|
batch.items.forEach(function (element) { return contentIDs_7.push(element.itemID); });
|
|
326
380
|
return [2 /*return*/, contentIDs_7];
|
|
327
381
|
case 3:
|
|
328
|
-
|
|
329
|
-
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);
|
|
330
384
|
case 4: return [2 /*return*/];
|
|
331
385
|
}
|
|
332
386
|
});
|
|
@@ -334,7 +388,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
334
388
|
};
|
|
335
389
|
ContentMethods.prototype.saveContentItems = function (contentItems_1, guid_1, locale_1) {
|
|
336
390
|
return __awaiter(this, arguments, void 0, function (contentItems, guid, locale, returnBatchId) {
|
|
337
|
-
var apiPath, resp,
|
|
391
|
+
var apiPath, resp, batchID_9, batch, contentIDs_8, err_10;
|
|
338
392
|
var _this = this;
|
|
339
393
|
if (returnBatchId === void 0) { returnBatchId = false; }
|
|
340
394
|
return __generator(this, function (_a) {
|
|
@@ -345,14 +399,14 @@ var ContentMethods = /** @class */ (function () {
|
|
|
345
399
|
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, contentItems)];
|
|
346
400
|
case 1:
|
|
347
401
|
resp = _a.sent();
|
|
348
|
-
|
|
402
|
+
batchID_9 = resp.data;
|
|
349
403
|
// If user wants batchID immediately, return it for custom polling
|
|
350
404
|
if (returnBatchId) {
|
|
351
|
-
return [2 /*return*/, [
|
|
405
|
+
return [2 /*return*/, [batchID_9]];
|
|
352
406
|
}
|
|
353
407
|
return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
354
408
|
switch (_a.label) {
|
|
355
|
-
case 0: return [4 /*yield*/, this._batchMethods.getBatch(
|
|
409
|
+
case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_9, guid)];
|
|
356
410
|
case 1: return [2 /*return*/, _a.sent()];
|
|
357
411
|
}
|
|
358
412
|
}); }); })];
|
|
@@ -362,8 +416,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
362
416
|
batch.items.forEach(function (element) { return contentIDs_8.push(element.itemID); });
|
|
363
417
|
return [2 /*return*/, contentIDs_8];
|
|
364
418
|
case 3:
|
|
365
|
-
|
|
366
|
-
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);
|
|
367
421
|
case 4: return [2 /*return*/];
|
|
368
422
|
}
|
|
369
423
|
});
|
|
@@ -371,7 +425,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
371
425
|
};
|
|
372
426
|
ContentMethods.prototype.getContentItems = function (referenceName, guid, locale, listParams) {
|
|
373
427
|
return __awaiter(this, void 0, void 0, function () {
|
|
374
|
-
var queryParams, apiPath, resp,
|
|
428
|
+
var queryParams, apiPath, resp, err_11;
|
|
375
429
|
return __generator(this, function (_a) {
|
|
376
430
|
switch (_a.label) {
|
|
377
431
|
case 0:
|
|
@@ -390,8 +444,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
390
444
|
resp = _a.sent();
|
|
391
445
|
return [2 /*return*/, resp.data];
|
|
392
446
|
case 2:
|
|
393
|
-
|
|
394
|
-
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);
|
|
395
449
|
case 3: return [2 /*return*/];
|
|
396
450
|
}
|
|
397
451
|
});
|
|
@@ -399,7 +453,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
399
453
|
};
|
|
400
454
|
ContentMethods.prototype.getContentList = function (referenceName_1, guid_1, locale_1, listParams_1) {
|
|
401
455
|
return __awaiter(this, arguments, void 0, function (referenceName, guid, locale, listParams, filterObject) {
|
|
402
|
-
var queryParams, apiPath, resp,
|
|
456
|
+
var queryParams, apiPath, resp, err_12;
|
|
403
457
|
if (filterObject === void 0) { filterObject = null; }
|
|
404
458
|
return __generator(this, function (_a) {
|
|
405
459
|
switch (_a.label) {
|
|
@@ -419,8 +473,8 @@ var ContentMethods = /** @class */ (function () {
|
|
|
419
473
|
resp = _a.sent();
|
|
420
474
|
return [2 /*return*/, resp.data];
|
|
421
475
|
case 2:
|
|
422
|
-
|
|
423
|
-
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);
|
|
424
478
|
case 3: return [2 /*return*/];
|
|
425
479
|
}
|
|
426
480
|
});
|
|
@@ -428,7 +482,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
428
482
|
};
|
|
429
483
|
ContentMethods.prototype.getContentHistory = function (locale_1, guid_1, contentID_1) {
|
|
430
484
|
return __awaiter(this, arguments, void 0, function (locale, guid, contentID, take, skip) {
|
|
431
|
-
var apiPath, resp,
|
|
485
|
+
var apiPath, resp, err_13;
|
|
432
486
|
if (take === void 0) { take = 50; }
|
|
433
487
|
if (skip === void 0) { skip = 0; }
|
|
434
488
|
return __generator(this, function (_a) {
|
|
@@ -441,7 +495,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
441
495
|
resp = _a.sent();
|
|
442
496
|
return [2 /*return*/, resp.data];
|
|
443
497
|
case 2:
|
|
444
|
-
|
|
498
|
+
err_13 = _a.sent();
|
|
445
499
|
throw new exception_1.Exception("Unable to retrieve history for contentID: ".concat(contentID));
|
|
446
500
|
case 3: return [2 /*return*/];
|
|
447
501
|
}
|
|
@@ -450,7 +504,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
450
504
|
};
|
|
451
505
|
ContentMethods.prototype.getContentComments = function (locale_1, guid_1, contentID_1) {
|
|
452
506
|
return __awaiter(this, arguments, void 0, function (locale, guid, contentID, take, skip) {
|
|
453
|
-
var apiPath, resp,
|
|
507
|
+
var apiPath, resp, err_14;
|
|
454
508
|
if (take === void 0) { take = 50; }
|
|
455
509
|
if (skip === void 0) { skip = 0; }
|
|
456
510
|
return __generator(this, function (_a) {
|
|
@@ -463,7 +517,7 @@ var ContentMethods = /** @class */ (function () {
|
|
|
463
517
|
resp = _a.sent();
|
|
464
518
|
return [2 /*return*/, resp.data];
|
|
465
519
|
case 2:
|
|
466
|
-
|
|
520
|
+
err_14 = _a.sent();
|
|
467
521
|
throw new exception_1.Exception("Unable to retrieve comments for contentID: ".concat(contentID));
|
|
468
522
|
case 3: return [2 /*return*/];
|
|
469
523
|
}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { Options } from "../models/options";
|
|
2
2
|
import { ClientInstance } from "./clientInstance";
|
|
3
3
|
import { Locales } from "../models/locales";
|
|
4
|
+
import { FetchApiStatus, FetchApiSyncMode } from "../models/fetchApiStatus";
|
|
4
5
|
export declare class InstanceMethods {
|
|
5
6
|
_options: Options;
|
|
6
7
|
_clientInstance: ClientInstance;
|
|
7
8
|
constructor(options: Options);
|
|
8
9
|
getLocales(guid: string): Promise<Locales[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the Fetch API sync status for an instance.
|
|
12
|
+
* Use this to check if changes made via the Management API have propagated to the Fetch API CDNs.
|
|
13
|
+
* This is particularly useful after large batch operations or batch workflows to verify
|
|
14
|
+
* that content changes are available on the CDN before proceeding with dependent operations.
|
|
15
|
+
*
|
|
16
|
+
* @param guid - The website GUID
|
|
17
|
+
* @param mode - Sync mode: 'fetch' (live/published content) or 'preview' (preview content). Defaults to 'fetch'.
|
|
18
|
+
* @param waitForCompletion - If true, polls until sync is complete. Defaults to false.
|
|
19
|
+
* @returns The sync status including whether a sync is in progress and version information
|
|
20
|
+
*/
|
|
21
|
+
getFetchApiStatus(guid: string, mode?: FetchApiSyncMode, waitForCompletion?: boolean): Promise<FetchApiStatus>;
|
|
9
22
|
}
|
|
@@ -64,6 +64,54 @@ var InstanceMethods = /** @class */ (function () {
|
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Gets the Fetch API sync status for an instance.
|
|
69
|
+
* Use this to check if changes made via the Management API have propagated to the Fetch API CDNs.
|
|
70
|
+
* This is particularly useful after large batch operations or batch workflows to verify
|
|
71
|
+
* that content changes are available on the CDN before proceeding with dependent operations.
|
|
72
|
+
*
|
|
73
|
+
* @param guid - The website GUID
|
|
74
|
+
* @param mode - Sync mode: 'fetch' (live/published content) or 'preview' (preview content). Defaults to 'fetch'.
|
|
75
|
+
* @param waitForCompletion - If true, polls until sync is complete. Defaults to false.
|
|
76
|
+
* @returns The sync status including whether a sync is in progress and version information
|
|
77
|
+
*/
|
|
78
|
+
InstanceMethods.prototype.getFetchApiStatus = function (guid_1) {
|
|
79
|
+
return __awaiter(this, arguments, void 0, function (guid, mode, waitForCompletion) {
|
|
80
|
+
var apiPath, resp, resp, status_1, err_2;
|
|
81
|
+
if (mode === void 0) { mode = 'fetch'; }
|
|
82
|
+
if (waitForCompletion === void 0) { waitForCompletion = false; }
|
|
83
|
+
return __generator(this, function (_a) {
|
|
84
|
+
switch (_a.label) {
|
|
85
|
+
case 0:
|
|
86
|
+
_a.trys.push([0, 6, , 7]);
|
|
87
|
+
apiPath = "fetch-api-status?mode=".concat(mode);
|
|
88
|
+
if (!!waitForCompletion) return [3 /*break*/, 2];
|
|
89
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
90
|
+
case 1:
|
|
91
|
+
resp = _a.sent();
|
|
92
|
+
return [2 /*return*/, resp.data];
|
|
93
|
+
case 2:
|
|
94
|
+
if (!true) return [3 /*break*/, 5];
|
|
95
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
96
|
+
case 3:
|
|
97
|
+
resp = _a.sent();
|
|
98
|
+
status_1 = resp.data;
|
|
99
|
+
if (!status_1.inProgress) {
|
|
100
|
+
return [2 /*return*/, status_1];
|
|
101
|
+
}
|
|
102
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
|
|
103
|
+
case 4:
|
|
104
|
+
_a.sent();
|
|
105
|
+
return [3 /*break*/, 2];
|
|
106
|
+
case 5: return [3 /*break*/, 7];
|
|
107
|
+
case 6:
|
|
108
|
+
err_2 = _a.sent();
|
|
109
|
+
throw new exception_1.Exception("Unable to retrieve Fetch API status.", err_2);
|
|
110
|
+
case 7: return [2 /*return*/];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
};
|
|
67
115
|
return InstanceMethods;
|
|
68
116
|
}());
|
|
69
117
|
exports.InstanceMethods = InstanceMethods;
|