@agility/management-sdk 0.1.0 → 0.1.1
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 +395 -397
- package/dist/apiMethods/assetMethods.d.ts +14 -14
- package/dist/apiMethods/assetMethods.js +95 -95
- package/dist/apiMethods/batchMethods.d.ts +11 -11
- package/dist/apiMethods/batchMethods.js +65 -65
- package/dist/apiMethods/clientInstance.d.ts +8 -8
- package/dist/apiMethods/clientInstance.js +77 -77
- package/dist/apiMethods/containerMethods.d.ts +16 -16
- package/dist/apiMethods/containerMethods.js +105 -105
- package/dist/apiMethods/contentMethods.d.ts +20 -20
- package/dist/apiMethods/contentMethods.js +175 -175
- package/dist/apiMethods/instanceUserMethods.d.ts +13 -13
- package/dist/apiMethods/instanceUserMethods.js +57 -57
- package/dist/apiMethods/modelMethods.d.ts +13 -13
- package/dist/apiMethods/modelMethods.js +81 -81
- package/dist/apiMethods/pageMethods.d.ts +20 -20
- package/dist/apiMethods/pageMethods.js +159 -159
- package/dist/enums/batchOperationType.d.ts +19 -19
- package/dist/enums/batchOperationType.js +23 -23
- package/dist/enums/batchState..d.ts +7 -7
- package/dist/enums/batchState..js +11 -11
- package/dist/index.d.ts +21 -21
- package/dist/index.js +37 -33
- package/dist/models/batch.d.ts +29 -29
- package/dist/models/batch.js +6 -6
- package/dist/models/batchItem.d.ts +13 -13
- package/dist/models/batchItem.js +6 -6
- package/dist/models/container.d.ts +47 -47
- package/dist/models/container.js +6 -6
- package/dist/models/contentItem.d.ts +37 -37
- package/dist/models/contentItem.js +18 -18
- package/dist/models/contentViewColumn.d.ts +8 -8
- package/dist/models/contentViewColumn.js +6 -6
- package/dist/models/exception.d.ts +4 -4
- package/dist/models/exception.js +10 -10
- package/dist/models/instanceRole.d.ts +7 -7
- package/dist/models/instanceRole.js +6 -6
- package/dist/models/instanceUser.d.ts +14 -14
- package/dist/models/instanceUser.js +6 -6
- package/dist/models/media.d.ts +30 -30
- package/dist/models/media.js +9 -9
- package/dist/models/model.d.ts +30 -30
- package/dist/models/model.js +9 -9
- package/dist/models/notification.d.ts +13 -13
- package/dist/models/notification.js +6 -6
- package/dist/models/options.d.ts +10 -10
- package/dist/models/options.js +25 -25
- package/dist/models/pageItem.d.ts +56 -56
- package/dist/models/pageItem.js +21 -21
- package/dist/models/sitemap.d.ts +20 -20
- package/dist/models/sitemap.js +9 -9
- package/dist/models/websiteUser.d.ts +22 -22
- package/dist/models/websiteUser.js +9 -9
- package/license.txt +20 -20
- package/package.json +39 -39
- package/tsconfig.json +14 -14
package/README.md
CHANGED
|
@@ -1,398 +1,396 @@
|
|
|
1
|
-
# Agility CMS & Management API TypeScript SDK
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
options.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
| `
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
|
216
|
-
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
|
224
|
-
|
|
|
225
|
-
| `
|
|
226
|
-
| `
|
|
227
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
|
243
|
-
|
|
|
244
|
-
| `
|
|
245
|
-
| `
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
|
270
|
-
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
|
312
|
-
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
|
320
|
-
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
|
328
|
-
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
|
336
|
-
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
|
344
|
-
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
|
352
|
-
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
|
360
|
-
|
|
|
361
|
-
| `
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
- `npm run
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
- [How
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
- [
|
|
390
|
-
- [
|
|
391
|
-
- [
|
|
392
|
-
- [
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
## Feedback and Questions
|
|
397
|
-
|
|
1
|
+
# Agility CMS & Management API TypeScript SDK
|
|
2
|
+
|
|
3
|
+
## About the Management API SDK
|
|
4
|
+
|
|
5
|
+
- Provides a facility to developers to use the new Agility Management API more effectively.
|
|
6
|
+
- Provides methods to perform operations on Assets, Batches, Containers, Content, Models, Pages, and Users.
|
|
7
|
+
- Supports the creation of Pages and Content in batches.
|
|
8
|
+
- Ability to generate Content in bulk for a Website.
|
|
9
|
+
|
|
10
|
+
## Getting Started
|
|
11
|
+
|
|
12
|
+
### Prerequisites
|
|
13
|
+
1. Clone the repository agility-cms-management-sdk-typescript.
|
|
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 -
|
|
16
|
+
- token -> Bearer token to authenticate a Rest Request to perform an operation.
|
|
17
|
+
- locale -> The locale under which your application is hosted. Example en-us.
|
|
18
|
+
- guid -> The guid under which your application is hosted.
|
|
19
|
+
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 -
|
|
20
|
+
|
|
21
|
+
### Making a Request
|
|
22
|
+
```Javascript
|
|
23
|
+
import * as index from "./index";
|
|
24
|
+
|
|
25
|
+
//initialize the Options Class
|
|
26
|
+
let options = new index.Options();
|
|
27
|
+
|
|
28
|
+
options.token = "<<Provide Auth Token>>";
|
|
29
|
+
options.guid = "<<Provide the Guid of the Website>>";
|
|
30
|
+
options.locale = "<<Provide the locale of the Website>>"; //Example: en-us
|
|
31
|
+
|
|
32
|
+
//Initialize the Method Class
|
|
33
|
+
let contentMethods = new index.ContentMethods(options);
|
|
34
|
+
|
|
35
|
+
//make the request: get a content item with the ID '22'
|
|
36
|
+
var contentItem = await contentMethods.getContentItem(22);
|
|
37
|
+
|
|
38
|
+
//To log the response of the contentItem object in console.
|
|
39
|
+
console.log(JSON.stringify(contentItem));
|
|
40
|
+
```
|
|
41
|
+
## Class AssetMethods
|
|
42
|
+
This class is used to perform operations related to Assets. The following are the methods: -
|
|
43
|
+
|
|
44
|
+
### upload
|
|
45
|
+
| Parameter | Type | Description |
|
|
46
|
+
| :-------- | :------- | :------------------------- |
|
|
47
|
+
| `formData` | `FormData` | This is an object of type FormData where files can be posted eg : `const file = fs.readFileSync(<<Local File>>, null);const form = new FormData(); form.append('files',file,'<<File Name>>');`|
|
|
48
|
+
| `agilityFolderPath` | `string` | Path of the folder in Agility where the file(s) needs to be uploaded.|
|
|
49
|
+
| `groupingID` | `number` | Path of the folder in Agility where the file(s) needs to be uploaded.|
|
|
50
|
+
|
|
51
|
+
Returns: A collection of ```Media``` class Object.
|
|
52
|
+
|
|
53
|
+
### deleteFile
|
|
54
|
+
| Parameter | Type | Description |
|
|
55
|
+
| :-------- | :------- | :------------------------- |
|
|
56
|
+
| `mediaID` | `number` | The mediaID of the asset which needs to be deleted.|
|
|
57
|
+
Returns
|
|
58
|
+
A ```string``` response if a file has been deleted.
|
|
59
|
+
|
|
60
|
+
### moveFile
|
|
61
|
+
| Parameter | Type | Description |
|
|
62
|
+
| :-------- | :------- | :------------------------- |
|
|
63
|
+
| `mediaID` | `number` | The mediaID of the file that needs to be moved.|
|
|
64
|
+
| `newFolder` | `string` | The new location (in Agility) where the file needs to be moved.|
|
|
65
|
+
|
|
66
|
+
Returns: An object of ```Media``` class with the new location of the file.
|
|
67
|
+
|
|
68
|
+
### getMediaList
|
|
69
|
+
| Parameter | Type | Description |
|
|
70
|
+
| :-------- | :------- | :------------------------- |
|
|
71
|
+
| `pageSize` | `number` | The page size on which the assets needs to selected.|
|
|
72
|
+
| `recordOffset` | `number` | The record offset value to skip search results.|
|
|
73
|
+
|
|
74
|
+
Returns: An object of ```AssetMediaList``` class.
|
|
75
|
+
|
|
76
|
+
### getAssetByID
|
|
77
|
+
| Parameter | Type | Description |
|
|
78
|
+
| :-------- | :------- | :------------------------- |
|
|
79
|
+
| `mediaID` | `number` | The mediaID of the requested asset.|
|
|
80
|
+
|
|
81
|
+
Returns: An object of ```Media``` class with the information of the asset.
|
|
82
|
+
|
|
83
|
+
### getAssetByUrl
|
|
84
|
+
| Parameter | Type | Description |
|
|
85
|
+
| :-------- | :------- | :------------------------- |
|
|
86
|
+
| `url` | `string` | The url of the requested asset.|
|
|
87
|
+
|
|
88
|
+
Returns: An object of ```Media``` class with the information of the asset.
|
|
89
|
+
|
|
90
|
+
## Class BatchMethods
|
|
91
|
+
This class is used to perform operations related to Batches. The following are the methods: -
|
|
92
|
+
|
|
93
|
+
### getBatch
|
|
94
|
+
| Parameter | Type | Description |
|
|
95
|
+
| :-------- | :------- | :------------------------- |
|
|
96
|
+
| `id` | `number` | The batchID of the requested batch.|
|
|
97
|
+
|
|
98
|
+
Returns: A object of ```Batch``` class.
|
|
99
|
+
|
|
100
|
+
## Class ContainerMethods
|
|
101
|
+
This class is used to perform operations related to Containers. The following are the methods: -
|
|
102
|
+
|
|
103
|
+
### getContainerByID
|
|
104
|
+
| Parameter | Type | Description |
|
|
105
|
+
| :-------- | :------- | :------------------------- |
|
|
106
|
+
| `id` | `number` | The container id of the requested container.|
|
|
107
|
+
|
|
108
|
+
Returns: A object of ```Container``` class.
|
|
109
|
+
|
|
110
|
+
### getContainerByReferenceName
|
|
111
|
+
| Parameter | Type | Description |
|
|
112
|
+
| :-------- | :------- | :------------------------- |
|
|
113
|
+
| `referenceName` | `string` | The container reference name of the requested container.|
|
|
114
|
+
|
|
115
|
+
Returns: A object of ```Container``` class.
|
|
116
|
+
|
|
117
|
+
### getContainerSecurity
|
|
118
|
+
| Parameter | Type | Description |
|
|
119
|
+
| :-------- | :------- | :------------------------- |
|
|
120
|
+
| `id` | `number` | The container id of the requested container.|
|
|
121
|
+
|
|
122
|
+
Returns: A object of ```Container``` class.
|
|
123
|
+
|
|
124
|
+
### getContainerList
|
|
125
|
+
Returns: A collection object of ```Container``` class.
|
|
126
|
+
|
|
127
|
+
### getNotificationList
|
|
128
|
+
| Parameter | Type | Description |
|
|
129
|
+
| :-------- | :------- | :------------------------- |
|
|
130
|
+
| `id` | `number` | The container id of the requested container.|
|
|
131
|
+
|
|
132
|
+
Returns: A collection object of ```Notification``` class.
|
|
133
|
+
|
|
134
|
+
### saveContainer
|
|
135
|
+
| Parameter | Type | Description |
|
|
136
|
+
| :-------- | :------- | :------------------------- |
|
|
137
|
+
| `container` | `Container` | A Container type object to create or update a container.|
|
|
138
|
+
|
|
139
|
+
Returns: An object of ```Container``` class.
|
|
140
|
+
|
|
141
|
+
### deleteContainer
|
|
142
|
+
| Parameter | Type | Description |
|
|
143
|
+
| :-------- | :------- | :------------------------- |
|
|
144
|
+
| `id` | `number` | The container id of the requested container.|
|
|
145
|
+
|
|
146
|
+
Returns: A ```string``` response if a container has been deleted.
|
|
147
|
+
|
|
148
|
+
## Class ContentMethods
|
|
149
|
+
This class is used to perform operations related to Content. The following are the methods: -
|
|
150
|
+
|
|
151
|
+
### getContentItem
|
|
152
|
+
| Parameter | Type | Description |
|
|
153
|
+
| :-------- | :------- | :------------------------- |
|
|
154
|
+
| `contentID` | `number` | The contentid of the requested content.|
|
|
155
|
+
|
|
156
|
+
Returns: An object of ```ContentItem``` class.
|
|
157
|
+
|
|
158
|
+
### publishContent
|
|
159
|
+
| Parameter | Type | Description |
|
|
160
|
+
| :-------- | :------- | :------------------------- |
|
|
161
|
+
| `contentID` | `number` | The contentid of the requested content.|
|
|
162
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
163
|
+
|
|
164
|
+
Returns: An array of ```contentID``` of the requested content.
|
|
165
|
+
|
|
166
|
+
### unPublishContent
|
|
167
|
+
| Parameter | Type | Description |
|
|
168
|
+
| :-------- | :------- | :------------------------- |
|
|
169
|
+
| `contentID` | `number` | The contentid of the requested content.|
|
|
170
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
171
|
+
|
|
172
|
+
Returns: An array of ```contentID``` of the requested content.
|
|
173
|
+
|
|
174
|
+
### contentRequestApproval
|
|
175
|
+
| Parameter | Type | Description |
|
|
176
|
+
| :-------- | :------- | :------------------------- |
|
|
177
|
+
| `contentID` | `number` | The contentid of the requested content.|
|
|
178
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
179
|
+
|
|
180
|
+
Returns: An array of ```contentID``` of the requested content.
|
|
181
|
+
|
|
182
|
+
### approveContent
|
|
183
|
+
| Parameter | Type | Description |
|
|
184
|
+
| :-------- | :------- | :------------------------- |
|
|
185
|
+
| `contentID` | `number` | The contentid of the requested content.|
|
|
186
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
187
|
+
|
|
188
|
+
Returns: An array of ```contentID``` of the requested content.
|
|
189
|
+
|
|
190
|
+
### declineContent
|
|
191
|
+
| Parameter | Type | Description |
|
|
192
|
+
| :-------- | :------- | :------------------------- |
|
|
193
|
+
| `contentID` | `number` | The contentid of the requested content.|
|
|
194
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
195
|
+
|
|
196
|
+
Returns: An array of ```contentID``` of the requested content.
|
|
197
|
+
|
|
198
|
+
### saveContentItem
|
|
199
|
+
| Parameter | Type | Description |
|
|
200
|
+
| :-------- | :------- | :------------------------- |
|
|
201
|
+
| `contentItem` | `ContentItem` | A contentItem object to create or update a content.|
|
|
202
|
+
|
|
203
|
+
Returns: An array of ```contentID``` of the requested content.
|
|
204
|
+
|
|
205
|
+
### saveContentItems
|
|
206
|
+
| Parameter | Type | Description |
|
|
207
|
+
| :-------- | :------- | :------------------------- |
|
|
208
|
+
| `contentItems` | `ContentItem[]` | A collection of contentItems object to create or update multiple contents.|
|
|
209
|
+
|
|
210
|
+
Returns: An array of ```contentID``` of the requested content.
|
|
211
|
+
|
|
212
|
+
### deleteContent
|
|
213
|
+
| Parameter | Type | Description |
|
|
214
|
+
| :-------- | :------- | :------------------------- |
|
|
215
|
+
| `contentID` | `number` | The contentid of the requested content.|
|
|
216
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
217
|
+
|
|
218
|
+
Returns: An array of ```contentID``` of the requested content.
|
|
219
|
+
|
|
220
|
+
### getContentItems
|
|
221
|
+
| Parameter | Type | Description |
|
|
222
|
+
| :-------- | :------- | :------------------------- |
|
|
223
|
+
| `referenceName` | `string` | The reference name of the container for the requested content.|
|
|
224
|
+
| `filter` | `string` | The filter condition for the requested content.|
|
|
225
|
+
| `fields` | `string` | The fields mapped to the container.|
|
|
226
|
+
| `sortDirection` | `string` | The direction to sort the result.|
|
|
227
|
+
| `sortField` | `string` | The field on which the sort needs to be performed.|
|
|
228
|
+
| `take` | `number` | The page size for the result.|
|
|
229
|
+
| `skip` | `number` | The record offset for the result.|
|
|
230
|
+
|
|
231
|
+
Returns: An object of ```ContentList``` class of the requested content.
|
|
232
|
+
|
|
233
|
+
## Class InstanceUserMethods
|
|
234
|
+
This class is used to perform operations related to User. The following are the methods: -
|
|
235
|
+
|
|
236
|
+
### getUsers
|
|
237
|
+
Returns: A collection of ```WebsiteUser``` class of the requested content.
|
|
238
|
+
|
|
239
|
+
### saveUser
|
|
240
|
+
| Parameter | Type | Description |
|
|
241
|
+
| :-------- | :------- | :------------------------- |
|
|
242
|
+
| `emailAddress` | `string` | The email address of the requested user.|
|
|
243
|
+
| `roles` | `InstanceRole[]` | Collection object of InstanceRole class for the requested user.|
|
|
244
|
+
| `firstName` | `string` | The first name of the requested user.|
|
|
245
|
+
| `lastName` | `string` | The last name of the requested user.|
|
|
246
|
+
|
|
247
|
+
Returns: An object of the ```InstanceUser``` class.
|
|
248
|
+
|
|
249
|
+
### deleteUser
|
|
250
|
+
| Parameter | Type | Description |
|
|
251
|
+
| :-------- | :------- | :------------------------- |
|
|
252
|
+
| `userID` | `number` | The userID of the requested user.|
|
|
253
|
+
|
|
254
|
+
Returns: A ```string``` response if a user has been deleted.
|
|
255
|
+
|
|
256
|
+
## Class ModelMethods
|
|
257
|
+
This class is used to perform operations related to Models. The following are the methods: -
|
|
258
|
+
|
|
259
|
+
### getContentModel
|
|
260
|
+
| Parameter | Type | Description |
|
|
261
|
+
| :-------- | :------- | :------------------------- |
|
|
262
|
+
| `id` | `number` | The id of the requested model.|
|
|
263
|
+
|
|
264
|
+
Returns: An object of ```Model``` class.
|
|
265
|
+
|
|
266
|
+
### getContentModules
|
|
267
|
+
| Parameter | Type | Description |
|
|
268
|
+
| :-------- | :------- | :------------------------- |
|
|
269
|
+
| `includeDefaults` | `bool` | Boolean value to include defaults.|
|
|
270
|
+
| `includeModules` | `bool` | Boolean value to include modules.|
|
|
271
|
+
|
|
272
|
+
Returns: A collection object of ```Model``` class.
|
|
273
|
+
|
|
274
|
+
### getPageModules
|
|
275
|
+
| Parameter | Type | Description |
|
|
276
|
+
| :-------- | :------- | :------------------------- |
|
|
277
|
+
| `includeDefault` | `bool` | Boolean value to include defaults.|
|
|
278
|
+
|
|
279
|
+
Returns: A collection object of ```Model``` class.
|
|
280
|
+
|
|
281
|
+
### saveModel
|
|
282
|
+
| Parameter | Type | Description |
|
|
283
|
+
| :-------- | :------- | :------------------------- |
|
|
284
|
+
| `model` | `Model` | The object of Model to for the requested model.|
|
|
285
|
+
|
|
286
|
+
Returns: An object of ```Model``` class.
|
|
287
|
+
|
|
288
|
+
### deleteModel
|
|
289
|
+
| Parameter | Type | Description |
|
|
290
|
+
| :-------- | :------- | :------------------------- |
|
|
291
|
+
| `id` | `number` | The id for the requested model.|
|
|
292
|
+
|
|
293
|
+
Returns: A ```string``` response if a model is deleted.
|
|
294
|
+
|
|
295
|
+
## Class PageMethods
|
|
296
|
+
This class is used to perform operations related to Pages. The following are the methods: -
|
|
297
|
+
|
|
298
|
+
### getSitemap
|
|
299
|
+
Returns: A collection object of ```Sitemap``` class.
|
|
300
|
+
|
|
301
|
+
### getPage
|
|
302
|
+
| Parameter | Type | Description |
|
|
303
|
+
| :-------- | :------- | :------------------------- |
|
|
304
|
+
| `pageID` | `number` | The id of the requested page.|
|
|
305
|
+
|
|
306
|
+
Returns: An object of ```PageItem``` class.
|
|
307
|
+
|
|
308
|
+
### publishPage
|
|
309
|
+
| Parameter | Type | Description |
|
|
310
|
+
| :-------- | :------- | :------------------------- |
|
|
311
|
+
| `pageID` | `number` | The pageID of the requested page.|
|
|
312
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
313
|
+
|
|
314
|
+
Returns: An array of ```pageID``` of the requested page.
|
|
315
|
+
|
|
316
|
+
### unPublishPage
|
|
317
|
+
| Parameter | Type | Description |
|
|
318
|
+
| :-------- | :------- | :------------------------- |
|
|
319
|
+
| `pageID` | `number` | The pageID of the requested page.|
|
|
320
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
321
|
+
|
|
322
|
+
Returns: An array of ```pageID``` of the requested page.
|
|
323
|
+
|
|
324
|
+
### deletePage
|
|
325
|
+
| Parameter | Type | Description |
|
|
326
|
+
| :-------- | :------- | :------------------------- |
|
|
327
|
+
| `pageID` | `number` | The pageID of the requested page.|
|
|
328
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
329
|
+
|
|
330
|
+
Returns: An array of ```pageID``` of the requested page.
|
|
331
|
+
|
|
332
|
+
### approvePage
|
|
333
|
+
| Parameter | Type | Description |
|
|
334
|
+
| :-------- | :------- | :------------------------- |
|
|
335
|
+
| `pageID` | `number` | The pageID of the requested page.|
|
|
336
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
337
|
+
|
|
338
|
+
Returns: An array of ```pageID``` of the requested page.
|
|
339
|
+
|
|
340
|
+
### declinePage
|
|
341
|
+
| Parameter | Type | Description |
|
|
342
|
+
| :-------- | :------- | :------------------------- |
|
|
343
|
+
| `pageID` | `number` | The pageID of the requested page.|
|
|
344
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
345
|
+
|
|
346
|
+
Returns: An array of ```pageID``` of the requested page.
|
|
347
|
+
|
|
348
|
+
### pageRequestApproval
|
|
349
|
+
| Parameter | Type | Description |
|
|
350
|
+
| :-------- | :------- | :------------------------- |
|
|
351
|
+
| `pageID` | `number` | The pageID of the requested page.|
|
|
352
|
+
| `comments` | `string` | Additional comments for a batch request.|
|
|
353
|
+
|
|
354
|
+
Returns: An array of ```pageID``` of the requested page.
|
|
355
|
+
|
|
356
|
+
### savePage
|
|
357
|
+
| Parameter | Type | Description |
|
|
358
|
+
| :-------- | :------- | :------------------------- |
|
|
359
|
+
| `pageItem` | `PageItem` | The object of PageItem class for the requested Page.|
|
|
360
|
+
| `parentPageID` | `number` | The id of the parent page.|
|
|
361
|
+
| `placeBeforePageItemID` | `number` | The id of the page before the page.|
|
|
362
|
+
|
|
363
|
+
Returns: An array of ```pageID``` of the requested page.
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
## Running the SDK Locally
|
|
367
|
+
|
|
368
|
+
- `npm run clean`
|
|
369
|
+
- `npm run prepare`
|
|
370
|
+
- `npm run build`
|
|
371
|
+
|
|
372
|
+
## How It Works
|
|
373
|
+
|
|
374
|
+
- [How Pages Work](https://help.agilitycms.com/hc/en-us/articles/4404222849677)
|
|
375
|
+
- [How Page Modules Work](https://help.agilitycms.com/hc/en-us/articles/4404222989453)
|
|
376
|
+
- [How Page Templates Work](https://help.agilitycms.com/hc/en-us/articles/4404229108877)
|
|
377
|
+
|
|
378
|
+
## Resources
|
|
379
|
+
|
|
380
|
+
### Agility CMS
|
|
381
|
+
|
|
382
|
+
- [Official site](https://agilitycms.com)
|
|
383
|
+
- [Documentation](https://help.agilitycms.com/hc/en-us)
|
|
384
|
+
|
|
385
|
+
### Community
|
|
386
|
+
|
|
387
|
+
- [Official Slack](https://join.slack.com/t/agilitycommunity/shared_invite/enQtNzI2NDc3MzU4Njc2LWI2OTNjZTI3ZGY1NWRiNTYzNmEyNmI0MGZlZTRkYzI3NmRjNzkxYmI5YTZjNTg2ZTk4NGUzNjg5NzY3OWViZGI)
|
|
388
|
+
- [Blog](https://agilitycms.com/resources/posts)
|
|
389
|
+
- [GitHub](https://github.com/agility)
|
|
390
|
+
- [Forums](https://help.agilitycms.com/hc/en-us/community/topics)
|
|
391
|
+
- [Facebook](https://www.facebook.com/AgilityCMS/)
|
|
392
|
+
- [Twitter](https://twitter.com/AgilityCMS)
|
|
393
|
+
|
|
394
|
+
## Feedback and Questions
|
|
395
|
+
|
|
398
396
|
If you have feedback or questions about this starter, please use the [Github Issues](https://github.com/agility/agility-cms-management-sdk-typescript/issues) on this repo, join our [Community Slack Channel](https://join.slack.com/t/agilitycommunity/shared_invite/enQtNzI2NDc3MzU4Njc2LWI2OTNjZTI3ZGY1NWRiNTYzNmEyNmI0MGZlZTRkYzI3NmRjNzkxYmI5YTZjNTg2ZTk4NGUzNjg5NzY3OWViZGI) or create a post on the [Agility Developer Community](https://help.agilitycms.com/hc/en-us/community/topics).
|