@agility/management-sdk 0.1.10 → 0.1.12
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 +9 -9
- package/dist/apiMethods/assetMethods.js +1 -1
- package/dist/apiMethods/batchMethods.js +1 -1
- package/dist/apiMethods/clientInstance.d.ts +10 -0
- package/dist/apiMethods/clientInstance.js +13 -1
- package/dist/apiMethods/containerMethods.js +1 -1
- package/dist/apiMethods/contentMethods.js +1 -1
- package/dist/apiMethods/instanceUserMethods.js +1 -1
- package/dist/apiMethods/modelMethods.js +1 -1
- package/dist/apiMethods/pageMethods.d.ts +6 -0
- package/dist/apiMethods/pageMethods.js +128 -25
- package/dist/enums/pageItemTemplateType.d.ts +4 -0
- package/dist/enums/pageItemTemplateType.js +8 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/models/contentSectionDefaultModule.d.ts +7 -0
- package/dist/models/contentSectionDefaultModule.js +9 -0
- package/dist/models/contentSectionDefinition.d.ts +35 -0
- package/dist/models/contentSectionDefinition.js +9 -0
- package/dist/models/pageModel.d.ts +14 -0
- package/dist/models/pageModel.js +9 -0
- package/dist/models/sharedModule.d.ts +7 -0
- package/dist/models/sharedModule.js +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
### Prerequisites
|
|
13
13
|
1. Clone the repository agility-cms-management-sdk-typescript.
|
|
14
14
|
2. Import the index file to make use of the Options class.
|
|
15
|
-
3. Create an object of the Options class to provide values of -
|
|
15
|
+
3. Create an object of the Options class to provide values of -
|
|
16
16
|
- token -> Bearer token to authenticate a Rest Request to perform an operation.
|
|
17
17
|
4. Create an object of Method class(es), which can be used to create and perform operations. Following is the description of Classes and their respective methods -
|
|
18
18
|
|
|
@@ -39,7 +39,7 @@ var contentItem = await apiClient.contentMethods.getContentItem(22,guid, locale)
|
|
|
39
39
|
console.log(JSON.stringify(contentItem));
|
|
40
40
|
```
|
|
41
41
|
## Class AssetMethods
|
|
42
|
-
This class is used to perform operations related to Assets. The following are the methods: -
|
|
42
|
+
This class is used to perform operations related to Assets. The following are the methods: -
|
|
43
43
|
|
|
44
44
|
### upload
|
|
45
45
|
| Parameter | Type | Description |
|
|
@@ -151,7 +151,7 @@ Returns: An object of ```Media``` class with the information of the asset.
|
|
|
151
151
|
Returns: An object of ```Media``` class with the information of the asset.
|
|
152
152
|
|
|
153
153
|
## Class BatchMethods
|
|
154
|
-
This class is used to perform operations related to Batches. The following are the methods: -
|
|
154
|
+
This class is used to perform operations related to Batches. The following are the methods: -
|
|
155
155
|
|
|
156
156
|
### getBatch
|
|
157
157
|
| Parameter | Type | Description |
|
|
@@ -162,7 +162,7 @@ This class is used to perform operations related to Batches. The following are t
|
|
|
162
162
|
Returns: A object of ```Batch``` class.
|
|
163
163
|
|
|
164
164
|
## Class ContainerMethods
|
|
165
|
-
This class is used to perform operations related to Containers. The following are the methods: -
|
|
165
|
+
This class is used to perform operations related to Containers. The following are the methods: -
|
|
166
166
|
|
|
167
167
|
### getContainerByID
|
|
168
168
|
| Parameter | Type | Description |
|
|
@@ -217,7 +217,7 @@ Returns: An object of ```Container``` class.
|
|
|
217
217
|
Returns: A ```string``` response if a container has been deleted.
|
|
218
218
|
|
|
219
219
|
## Class ContentMethods
|
|
220
|
-
This class is used to perform operations related to Content. The following are the methods: -
|
|
220
|
+
This class is used to perform operations related to Content. The following are the methods: -
|
|
221
221
|
|
|
222
222
|
### getContentItem
|
|
223
223
|
| Parameter | Type | Description |
|
|
@@ -322,7 +322,7 @@ Returns: An array of ```contentID``` of the requested content.
|
|
|
322
322
|
Returns: An object of ```ContentList``` class of the requested content.
|
|
323
323
|
|
|
324
324
|
## Class InstanceUserMethods
|
|
325
|
-
This class is used to perform operations related to User. The following are the methods: -
|
|
325
|
+
This class is used to perform operations related to User. The following are the methods: -
|
|
326
326
|
|
|
327
327
|
### getUsers
|
|
328
328
|
| Parameter | Type | Description |
|
|
@@ -350,7 +350,7 @@ Returns: An object of the ```InstanceUser``` class.
|
|
|
350
350
|
Returns: A ```string``` response if a user has been deleted.
|
|
351
351
|
|
|
352
352
|
## Class ModelMethods
|
|
353
|
-
This class is used to perform operations related to Models. The following are the methods: -
|
|
353
|
+
This class is used to perform operations related to Models. The following are the methods: -
|
|
354
354
|
|
|
355
355
|
### getContentModel
|
|
356
356
|
| Parameter | Type | Description |
|
|
@@ -400,7 +400,7 @@ Returns: An object of ```Model``` class.
|
|
|
400
400
|
Returns: A ```string``` response if a model is deleted.
|
|
401
401
|
|
|
402
402
|
## Class PageMethods
|
|
403
|
-
This class is used to perform operations related to Pages. The following are the methods: -
|
|
403
|
+
This class is used to perform operations related to Pages. The following are the methods: -
|
|
404
404
|
|
|
405
405
|
### getSitemap
|
|
406
406
|
| Parameter | Type | Description |
|
|
@@ -494,7 +494,7 @@ Returns: An array of ```pageID``` of the requested page.
|
|
|
494
494
|
|
|
495
495
|
- `npm run clean`
|
|
496
496
|
- `npm run prepare`
|
|
497
|
-
- `npm run build`
|
|
497
|
+
- `npm run build`
|
|
498
498
|
|
|
499
499
|
## How It Works
|
|
500
500
|
|
|
@@ -42,7 +42,7 @@ var exception_1 = require("../models/exception");
|
|
|
42
42
|
var AssetMethods = /** @class */ (function () {
|
|
43
43
|
function AssetMethods(options) {
|
|
44
44
|
this._options = options;
|
|
45
|
-
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
45
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
46
46
|
}
|
|
47
47
|
AssetMethods.prototype.deleteFile = function (mediaID, guid) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -43,7 +43,7 @@ var exception_1 = require("../models/exception");
|
|
|
43
43
|
var BatchMethods = /** @class */ (function () {
|
|
44
44
|
function BatchMethods(options) {
|
|
45
45
|
this._options = options;
|
|
46
|
-
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
46
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
47
47
|
}
|
|
48
48
|
BatchMethods.prototype.getBatch = function (batchID, guid) {
|
|
49
49
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Options } from "../models/options";
|
|
2
3
|
export declare class ClientInstance {
|
|
4
|
+
_options: Options;
|
|
5
|
+
constructor(options: Options);
|
|
6
|
+
/**
|
|
7
|
+
* Figure out the Base Url, which can be overriden using options.baseUrl
|
|
8
|
+
*
|
|
9
|
+
* @param {string} guid
|
|
10
|
+
* @returns {string}
|
|
11
|
+
* @memberof ClientInstance
|
|
12
|
+
*/
|
|
3
13
|
determineBaseUrl(guid: string): string;
|
|
4
14
|
getInstance(guid: string): AxiosInstance;
|
|
5
15
|
executeGet(apiPath: string, guid: string, token: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -42,10 +42,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
42
42
|
exports.ClientInstance = void 0;
|
|
43
43
|
var axios_1 = __importDefault(require("axios"));
|
|
44
44
|
var ClientInstance = /** @class */ (function () {
|
|
45
|
-
function ClientInstance() {
|
|
45
|
+
function ClientInstance(options) {
|
|
46
|
+
this._options = options;
|
|
46
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Figure out the Base Url, which can be overriden using options.baseUrl
|
|
50
|
+
*
|
|
51
|
+
* @param {string} guid
|
|
52
|
+
* @returns {string}
|
|
53
|
+
* @memberof ClientInstance
|
|
54
|
+
*/
|
|
47
55
|
ClientInstance.prototype.determineBaseUrl = function (guid) {
|
|
56
|
+
//if we have a baseUrl overridden, use it
|
|
57
|
+
if (this._options.baseUrl)
|
|
58
|
+
return this._options.baseUrl;
|
|
48
59
|
var seperator = guid.split('-');
|
|
60
|
+
//determine the base url based on the GUID
|
|
49
61
|
if (seperator[1] === 'd') {
|
|
50
62
|
return "https://mgmt-dev.aglty.io";
|
|
51
63
|
}
|
|
@@ -42,7 +42,7 @@ var exception_1 = require("../models/exception");
|
|
|
42
42
|
var ContainerMethods = /** @class */ (function () {
|
|
43
43
|
function ContainerMethods(options) {
|
|
44
44
|
this._options = options;
|
|
45
|
-
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
45
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
46
46
|
}
|
|
47
47
|
ContainerMethods.prototype.getContainerByID = function (id, guid) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -43,7 +43,7 @@ var exception_1 = require("../models/exception");
|
|
|
43
43
|
var ContentMethods = /** @class */ (function () {
|
|
44
44
|
function ContentMethods(options) {
|
|
45
45
|
this._options = options;
|
|
46
|
-
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
46
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
47
47
|
this._batchMethods = new batchMethods_1.BatchMethods(this._options);
|
|
48
48
|
}
|
|
49
49
|
ContentMethods.prototype.getContentItem = function (contentID, guid, locale) {
|
|
@@ -42,7 +42,7 @@ var exception_1 = require("../models/exception");
|
|
|
42
42
|
var InstanceUserMethods = /** @class */ (function () {
|
|
43
43
|
function InstanceUserMethods(options) {
|
|
44
44
|
this._options = options;
|
|
45
|
-
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
45
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
46
46
|
}
|
|
47
47
|
InstanceUserMethods.prototype.getUsers = function (guid) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -42,7 +42,7 @@ var exception_1 = require("../models/exception");
|
|
|
42
42
|
var ModelMethods = /** @class */ (function () {
|
|
43
43
|
function ModelMethods(options) {
|
|
44
44
|
this._options = options;
|
|
45
|
-
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
45
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
46
46
|
}
|
|
47
47
|
ModelMethods.prototype.getContentModel = function (id, guid) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -3,12 +3,18 @@ import { ClientInstance } from "./clientInstance";
|
|
|
3
3
|
import { PageItem } from "../models/pageItem";
|
|
4
4
|
import { Sitemap } from "../models/sitemap";
|
|
5
5
|
import { BatchMethods } from "./batchMethods";
|
|
6
|
+
import { PageModel } from "../models/pageModel";
|
|
6
7
|
export declare class PageMethods {
|
|
7
8
|
_options: Options;
|
|
8
9
|
_clientInstance: ClientInstance;
|
|
9
10
|
_batchMethods: BatchMethods;
|
|
10
11
|
constructor(options: Options);
|
|
11
12
|
getSitemap(guid: string, locale: string): Promise<Sitemap[]>;
|
|
13
|
+
getPageTemplates(guid: string, locale: string, includeModuleZones: boolean, searchFilter?: string): Promise<PageModel[]>;
|
|
14
|
+
getPageTemplate(guid: string, locale: string, pageTemplateId: number): Promise<PageModel>;
|
|
15
|
+
getPageTemplateName(guid: string, locale: string, templateName: string): Promise<PageModel>;
|
|
16
|
+
deletePageTemplate(guid: string, locale: string, pageTemplateId: number): Promise<string>;
|
|
17
|
+
savePageTemplate(guid: string, locale: string, pageModel: PageModel): Promise<PageModel>;
|
|
12
18
|
getPage(pageID: number, guid: string, locale: string): Promise<PageItem>;
|
|
13
19
|
publishPage(pageID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
14
20
|
unPublishPage(pageID: number, guid: string, locale: string, comments?: string): Promise<number[]>;
|
|
@@ -43,7 +43,7 @@ var exception_1 = require("../models/exception");
|
|
|
43
43
|
var PageMethods = /** @class */ (function () {
|
|
44
44
|
function PageMethods(options) {
|
|
45
45
|
this._options = options;
|
|
46
|
-
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
46
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
47
47
|
this._batchMethods = new batchMethods_1.BatchMethods(this._options);
|
|
48
48
|
}
|
|
49
49
|
PageMethods.prototype.getSitemap = function (guid, locale) {
|
|
@@ -66,21 +66,124 @@ var PageMethods = /** @class */ (function () {
|
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
PageMethods.prototype.
|
|
69
|
+
PageMethods.prototype.getPageTemplates = function (guid, locale, includeModuleZones, searchFilter) {
|
|
70
|
+
if (searchFilter === void 0) { searchFilter = null; }
|
|
70
71
|
return __awaiter(this, void 0, void 0, function () {
|
|
71
72
|
var apiPath, resp, err_2;
|
|
72
73
|
return __generator(this, function (_a) {
|
|
73
74
|
switch (_a.label) {
|
|
74
75
|
case 0:
|
|
75
76
|
_a.trys.push([0, 2, , 3]);
|
|
76
|
-
|
|
77
|
+
if (!searchFilter)
|
|
78
|
+
searchFilter = '';
|
|
79
|
+
apiPath = "".concat(locale, "/page/templates?includeModuleZones=").concat(includeModuleZones, "&searchFilter=").concat(searchFilter);
|
|
77
80
|
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
78
81
|
case 1:
|
|
79
82
|
resp = _a.sent();
|
|
80
83
|
return [2 /*return*/, resp.data];
|
|
81
84
|
case 2:
|
|
82
85
|
err_2 = _a.sent();
|
|
83
|
-
throw new exception_1.Exception("Unable to retreive
|
|
86
|
+
throw new exception_1.Exception("Unable to retreive Page Templates.", err_2);
|
|
87
|
+
case 3: return [2 /*return*/];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
PageMethods.prototype.getPageTemplate = function (guid, locale, pageTemplateId) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
+
var apiPath, resp, err_3;
|
|
95
|
+
return __generator(this, function (_a) {
|
|
96
|
+
switch (_a.label) {
|
|
97
|
+
case 0:
|
|
98
|
+
_a.trys.push([0, 2, , 3]);
|
|
99
|
+
apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId);
|
|
100
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
101
|
+
case 1:
|
|
102
|
+
resp = _a.sent();
|
|
103
|
+
return [2 /*return*/, resp.data];
|
|
104
|
+
case 2:
|
|
105
|
+
err_3 = _a.sent();
|
|
106
|
+
throw new exception_1.Exception("Unable to retreive Page Template.", err_3);
|
|
107
|
+
case 3: return [2 /*return*/];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
PageMethods.prototype.getPageTemplateName = function (guid, locale, templateName) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
var apiPath, resp, err_4;
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
switch (_a.label) {
|
|
117
|
+
case 0:
|
|
118
|
+
_a.trys.push([0, 2, , 3]);
|
|
119
|
+
apiPath = "".concat(locale, "/page/template/").concat(templateName);
|
|
120
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
121
|
+
case 1:
|
|
122
|
+
resp = _a.sent();
|
|
123
|
+
return [2 /*return*/, resp.data];
|
|
124
|
+
case 2:
|
|
125
|
+
err_4 = _a.sent();
|
|
126
|
+
throw new exception_1.Exception("Unable to retreive Page Template.", err_4);
|
|
127
|
+
case 3: return [2 /*return*/];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
PageMethods.prototype.deletePageTemplate = function (guid, locale, pageTemplateId) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
var apiPath, resp, err_5;
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0:
|
|
138
|
+
_a.trys.push([0, 2, , 3]);
|
|
139
|
+
apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId);
|
|
140
|
+
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
141
|
+
case 1:
|
|
142
|
+
resp = _a.sent();
|
|
143
|
+
return [2 /*return*/, resp.data];
|
|
144
|
+
case 2:
|
|
145
|
+
err_5 = _a.sent();
|
|
146
|
+
throw new exception_1.Exception("Unable to delete Page Template.", err_5);
|
|
147
|
+
case 3: return [2 /*return*/];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
PageMethods.prototype.savePageTemplate = function (guid, locale, pageModel) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
+
var apiPath, resp, err_6;
|
|
155
|
+
return __generator(this, function (_a) {
|
|
156
|
+
switch (_a.label) {
|
|
157
|
+
case 0:
|
|
158
|
+
_a.trys.push([0, 2, , 3]);
|
|
159
|
+
apiPath = "".concat(locale, "/page/template");
|
|
160
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageModel)];
|
|
161
|
+
case 1:
|
|
162
|
+
resp = _a.sent();
|
|
163
|
+
return [2 /*return*/, resp.data];
|
|
164
|
+
case 2:
|
|
165
|
+
err_6 = _a.sent();
|
|
166
|
+
throw new exception_1.Exception("Unable to save Page Template.", err_6);
|
|
167
|
+
case 3: return [2 /*return*/];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
PageMethods.prototype.getPage = function (pageID, guid, locale) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
174
|
+
var apiPath, resp, err_7;
|
|
175
|
+
return __generator(this, function (_a) {
|
|
176
|
+
switch (_a.label) {
|
|
177
|
+
case 0:
|
|
178
|
+
_a.trys.push([0, 2, , 3]);
|
|
179
|
+
apiPath = "".concat(locale, "/page/").concat(pageID);
|
|
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_7 = _a.sent();
|
|
186
|
+
throw new exception_1.Exception("Unable to retreive page for id ".concat(pageID, "."), err_7);
|
|
84
187
|
case 3: return [2 /*return*/];
|
|
85
188
|
}
|
|
86
189
|
});
|
|
@@ -89,7 +192,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
89
192
|
PageMethods.prototype.publishPage = function (pageID, guid, locale, comments) {
|
|
90
193
|
if (comments === void 0) { comments = null; }
|
|
91
194
|
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
-
var apiPath, resp, batchID_1, batch, pageIDs_1,
|
|
195
|
+
var apiPath, resp, batchID_1, batch, pageIDs_1, err_8;
|
|
93
196
|
var _this = this;
|
|
94
197
|
return __generator(this, function (_a) {
|
|
95
198
|
switch (_a.label) {
|
|
@@ -112,8 +215,8 @@ var PageMethods = /** @class */ (function () {
|
|
|
112
215
|
batch.items.forEach(function (element) { return pageIDs_1.push(element.itemID); });
|
|
113
216
|
return [2 /*return*/, pageIDs_1];
|
|
114
217
|
case 3:
|
|
115
|
-
|
|
116
|
-
throw new exception_1.Exception("Unable to publish the page for id: ".concat(pageID),
|
|
218
|
+
err_8 = _a.sent();
|
|
219
|
+
throw new exception_1.Exception("Unable to publish the page for id: ".concat(pageID), err_8);
|
|
117
220
|
case 4: return [2 /*return*/];
|
|
118
221
|
}
|
|
119
222
|
});
|
|
@@ -122,7 +225,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
122
225
|
PageMethods.prototype.unPublishPage = function (pageID, guid, locale, comments) {
|
|
123
226
|
if (comments === void 0) { comments = null; }
|
|
124
227
|
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
-
var apiPath, resp, batchID_2, batch, pageIDs_2,
|
|
228
|
+
var apiPath, resp, batchID_2, batch, pageIDs_2, err_9;
|
|
126
229
|
var _this = this;
|
|
127
230
|
return __generator(this, function (_a) {
|
|
128
231
|
switch (_a.label) {
|
|
@@ -145,8 +248,8 @@ var PageMethods = /** @class */ (function () {
|
|
|
145
248
|
batch.items.forEach(function (element) { return pageIDs_2.push(element.itemID); });
|
|
146
249
|
return [2 /*return*/, pageIDs_2];
|
|
147
250
|
case 3:
|
|
148
|
-
|
|
149
|
-
throw new exception_1.Exception("Unable to un-publish the page for id: ".concat(pageID),
|
|
251
|
+
err_9 = _a.sent();
|
|
252
|
+
throw new exception_1.Exception("Unable to un-publish the page for id: ".concat(pageID), err_9);
|
|
150
253
|
case 4: return [2 /*return*/];
|
|
151
254
|
}
|
|
152
255
|
});
|
|
@@ -155,7 +258,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
155
258
|
PageMethods.prototype.pageRequestApproval = function (pageID, guid, locale, comments) {
|
|
156
259
|
if (comments === void 0) { comments = null; }
|
|
157
260
|
return __awaiter(this, void 0, void 0, function () {
|
|
158
|
-
var apiPath, resp, batchID_3, batch, pageIDs_3,
|
|
261
|
+
var apiPath, resp, batchID_3, batch, pageIDs_3, err_10;
|
|
159
262
|
var _this = this;
|
|
160
263
|
return __generator(this, function (_a) {
|
|
161
264
|
switch (_a.label) {
|
|
@@ -178,8 +281,8 @@ var PageMethods = /** @class */ (function () {
|
|
|
178
281
|
batch.items.forEach(function (element) { return pageIDs_3.push(element.itemID); });
|
|
179
282
|
return [2 /*return*/, pageIDs_3];
|
|
180
283
|
case 3:
|
|
181
|
-
|
|
182
|
-
throw new exception_1.Exception("Unable to request approval the page for id: ".concat(pageID),
|
|
284
|
+
err_10 = _a.sent();
|
|
285
|
+
throw new exception_1.Exception("Unable to request approval the page for id: ".concat(pageID), err_10);
|
|
183
286
|
case 4: return [2 /*return*/];
|
|
184
287
|
}
|
|
185
288
|
});
|
|
@@ -188,7 +291,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
188
291
|
PageMethods.prototype.approvePage = function (pageID, guid, locale, comments) {
|
|
189
292
|
if (comments === void 0) { comments = null; }
|
|
190
293
|
return __awaiter(this, void 0, void 0, function () {
|
|
191
|
-
var apiPath, resp, batchID_4, batch, pageIDs_4,
|
|
294
|
+
var apiPath, resp, batchID_4, batch, pageIDs_4, err_11;
|
|
192
295
|
var _this = this;
|
|
193
296
|
return __generator(this, function (_a) {
|
|
194
297
|
switch (_a.label) {
|
|
@@ -211,8 +314,8 @@ var PageMethods = /** @class */ (function () {
|
|
|
211
314
|
batch.items.forEach(function (element) { return pageIDs_4.push(element.itemID); });
|
|
212
315
|
return [2 /*return*/, pageIDs_4];
|
|
213
316
|
case 3:
|
|
214
|
-
|
|
215
|
-
throw new exception_1.Exception("Unable to approve the page for id: ".concat(pageID),
|
|
317
|
+
err_11 = _a.sent();
|
|
318
|
+
throw new exception_1.Exception("Unable to approve the page for id: ".concat(pageID), err_11);
|
|
216
319
|
case 4: return [2 /*return*/];
|
|
217
320
|
}
|
|
218
321
|
});
|
|
@@ -221,7 +324,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
221
324
|
PageMethods.prototype.declinePage = function (pageID, guid, locale, comments) {
|
|
222
325
|
if (comments === void 0) { comments = null; }
|
|
223
326
|
return __awaiter(this, void 0, void 0, function () {
|
|
224
|
-
var apiPath, resp, batchID_5, batch, pageIDs_5,
|
|
327
|
+
var apiPath, resp, batchID_5, batch, pageIDs_5, err_12;
|
|
225
328
|
var _this = this;
|
|
226
329
|
return __generator(this, function (_a) {
|
|
227
330
|
switch (_a.label) {
|
|
@@ -244,8 +347,8 @@ var PageMethods = /** @class */ (function () {
|
|
|
244
347
|
batch.items.forEach(function (element) { return pageIDs_5.push(element.itemID); });
|
|
245
348
|
return [2 /*return*/, pageIDs_5];
|
|
246
349
|
case 3:
|
|
247
|
-
|
|
248
|
-
throw new exception_1.Exception("Unable to decline the page for id: ".concat(pageID),
|
|
350
|
+
err_12 = _a.sent();
|
|
351
|
+
throw new exception_1.Exception("Unable to decline the page for id: ".concat(pageID), err_12);
|
|
249
352
|
case 4: return [2 /*return*/];
|
|
250
353
|
}
|
|
251
354
|
});
|
|
@@ -254,7 +357,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
254
357
|
PageMethods.prototype.deletePage = function (pageID, guid, locale, comments) {
|
|
255
358
|
if (comments === void 0) { comments = null; }
|
|
256
359
|
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
-
var apiPath, resp, batchID_6, batch, pageIDs_6,
|
|
360
|
+
var apiPath, resp, batchID_6, batch, pageIDs_6, err_13;
|
|
258
361
|
var _this = this;
|
|
259
362
|
return __generator(this, function (_a) {
|
|
260
363
|
switch (_a.label) {
|
|
@@ -277,8 +380,8 @@ var PageMethods = /** @class */ (function () {
|
|
|
277
380
|
batch.items.forEach(function (element) { return pageIDs_6.push(element.itemID); });
|
|
278
381
|
return [2 /*return*/, pageIDs_6];
|
|
279
382
|
case 3:
|
|
280
|
-
|
|
281
|
-
throw new exception_1.Exception("Unable to delete the page for id: ".concat(pageID),
|
|
383
|
+
err_13 = _a.sent();
|
|
384
|
+
throw new exception_1.Exception("Unable to delete the page for id: ".concat(pageID), err_13);
|
|
282
385
|
case 4: return [2 /*return*/];
|
|
283
386
|
}
|
|
284
387
|
});
|
|
@@ -288,7 +391,7 @@ var PageMethods = /** @class */ (function () {
|
|
|
288
391
|
if (parentPageID === void 0) { parentPageID = -1; }
|
|
289
392
|
if (placeBeforePageItemID === void 0) { placeBeforePageItemID = -1; }
|
|
290
393
|
return __awaiter(this, void 0, void 0, function () {
|
|
291
|
-
var apiPath, resp, batchID_7, batch, pageIDs_7,
|
|
394
|
+
var apiPath, resp, batchID_7, batch, pageIDs_7, err_14;
|
|
292
395
|
var _this = this;
|
|
293
396
|
return __generator(this, function (_a) {
|
|
294
397
|
switch (_a.label) {
|
|
@@ -311,8 +414,8 @@ var PageMethods = /** @class */ (function () {
|
|
|
311
414
|
batch.items.forEach(function (element) { return pageIDs_7.push(element.itemID); });
|
|
312
415
|
return [2 /*return*/, pageIDs_7];
|
|
313
416
|
case 3:
|
|
314
|
-
|
|
315
|
-
throw new exception_1.Exception("Unable to create page. ".concat(
|
|
417
|
+
err_14 = _a.sent();
|
|
418
|
+
throw new exception_1.Exception("Unable to create page. ".concat(err_14), err_14);
|
|
316
419
|
case 4: return [2 /*return*/];
|
|
317
420
|
}
|
|
318
421
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageItemTemplateType = void 0;
|
|
4
|
+
var PageItemTemplateType;
|
|
5
|
+
(function (PageItemTemplateType) {
|
|
6
|
+
PageItemTemplateType[PageItemTemplateType["Variable"] = 0] = "Variable";
|
|
7
|
+
PageItemTemplateType[PageItemTemplateType["FixedModule"] = 1] = "FixedModule";
|
|
8
|
+
})(PageItemTemplateType = exports.PageItemTemplateType || (exports.PageItemTemplateType = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -16,4 +16,8 @@ export * from "./models/assetContainer";
|
|
|
16
16
|
export * from "./models/assetGalleries";
|
|
17
17
|
export * from "./models/assetMediaGrouping";
|
|
18
18
|
export * from "./models/assetMediaGroupingMetaData";
|
|
19
|
+
export * from "./models/contentSectionDefaultModule";
|
|
20
|
+
export * from "./models/contentSectionDefinition";
|
|
21
|
+
export * from "./models/sharedModule";
|
|
22
|
+
export * from "./models/pageModel";
|
|
19
23
|
export * from "./apiClient";
|
package/dist/index.js
CHANGED
|
@@ -32,4 +32,8 @@ __exportStar(require("./models/assetContainer"), exports);
|
|
|
32
32
|
__exportStar(require("./models/assetGalleries"), exports);
|
|
33
33
|
__exportStar(require("./models/assetMediaGrouping"), exports);
|
|
34
34
|
__exportStar(require("./models/assetMediaGroupingMetaData"), exports);
|
|
35
|
+
__exportStar(require("./models/contentSectionDefaultModule"), exports);
|
|
36
|
+
__exportStar(require("./models/contentSectionDefinition"), exports);
|
|
37
|
+
__exportStar(require("./models/sharedModule"), exports);
|
|
38
|
+
__exportStar(require("./models/pageModel"), exports);
|
|
35
39
|
__exportStar(require("./apiClient"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentSectionDefaultModule = void 0;
|
|
4
|
+
var ContentSectionDefaultModule = /** @class */ (function () {
|
|
5
|
+
function ContentSectionDefaultModule() {
|
|
6
|
+
}
|
|
7
|
+
return ContentSectionDefaultModule;
|
|
8
|
+
}());
|
|
9
|
+
exports.ContentSectionDefaultModule = ContentSectionDefaultModule;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PageItemTemplateType } from "../enums/pageItemTemplateType";
|
|
2
|
+
import { ContentSectionDefaultModule } from "./contentSectionDefaultModule";
|
|
3
|
+
import { SharedModule } from "./sharedModule";
|
|
4
|
+
export declare class ContentSectionDefinition {
|
|
5
|
+
defaultModules: ContentSectionDefaultModule[];
|
|
6
|
+
sharedModules: SharedModule[];
|
|
7
|
+
pageItemTemplateID: number | null;
|
|
8
|
+
pageTemplateID: number | null;
|
|
9
|
+
pageItemTemplateName: string | null;
|
|
10
|
+
pageItemTemplateReferenceName: string | null;
|
|
11
|
+
pageItemTemplateType: PageItemTemplateType;
|
|
12
|
+
pageItemTemplateTypeName: string | null;
|
|
13
|
+
itemOrder: number | null;
|
|
14
|
+
moduleOrder: number | null;
|
|
15
|
+
contentViewID: number | null;
|
|
16
|
+
contentReferenceName: string | null;
|
|
17
|
+
contentDefinitionID: number | null;
|
|
18
|
+
contentViewName: string | null;
|
|
19
|
+
itemContainerID: number | null;
|
|
20
|
+
publishContentItemID: number | null;
|
|
21
|
+
releaseDate: string;
|
|
22
|
+
pullDate: string;
|
|
23
|
+
isShared: boolean;
|
|
24
|
+
isSharedTemplate: boolean;
|
|
25
|
+
enablePersonalization: boolean;
|
|
26
|
+
doesPageTemplateHavePages: boolean;
|
|
27
|
+
moduleID: number | null;
|
|
28
|
+
contentDefinitionTitle: string | null;
|
|
29
|
+
userControlPath: string | null;
|
|
30
|
+
templateMarkup: string | null;
|
|
31
|
+
sortExpression: string | null;
|
|
32
|
+
filterExpression: string | null;
|
|
33
|
+
contentTemplateID: number | null;
|
|
34
|
+
contentTemplateName: string | null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentSectionDefinition = void 0;
|
|
4
|
+
var ContentSectionDefinition = /** @class */ (function () {
|
|
5
|
+
function ContentSectionDefinition() {
|
|
6
|
+
}
|
|
7
|
+
return ContentSectionDefinition;
|
|
8
|
+
}());
|
|
9
|
+
exports.ContentSectionDefinition = ContentSectionDefinition;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContentSectionDefinition } from "./contentSectionDefinition";
|
|
2
|
+
export declare class PageModel {
|
|
3
|
+
doesPageTemplateHavePages: boolean;
|
|
4
|
+
pageTemplateID: number | null;
|
|
5
|
+
digitalChannelTypeID: number | null;
|
|
6
|
+
digitalChannelTypeName: string | null;
|
|
7
|
+
agilityCode: boolean;
|
|
8
|
+
pageTemplateName: string | null;
|
|
9
|
+
relativeURL: string | null;
|
|
10
|
+
pageNames: string | null;
|
|
11
|
+
isDeleted: boolean;
|
|
12
|
+
previewUrl: string | null;
|
|
13
|
+
contentSectionDefinitions: (ContentSectionDefinition | null)[] | null;
|
|
14
|
+
}
|