@agility/management-sdk 0.1.17 → 0.1.19

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.
Files changed (75) hide show
  1. package/README.md +695 -680
  2. package/dist/apiMethods/assetMethods.d.ts +2 -0
  3. package/dist/apiMethods/assetMethods.js +52 -10
  4. package/dist/apiMethods/batchMethods.js +2 -2
  5. package/dist/apiMethods/clientInstance.js +2 -2
  6. package/dist/apiMethods/containerMethods.js +2 -2
  7. package/dist/apiMethods/contentMethods.js +31 -31
  8. package/dist/apiMethods/instanceMethods.d.ts +9 -0
  9. package/dist/{src/apiMethods/instanceUserMethods.js → apiMethods/instanceMethods.js} +69 -111
  10. package/dist/apiMethods/instanceUserMethods.js +6 -6
  11. package/dist/apiMethods/modelMethods.js +5 -5
  12. package/dist/apiMethods/pageMethods.js +35 -35
  13. package/dist/apiMethods/serverUserMethods.js +2 -2
  14. package/dist/apiMethods/webhookMethods.js +6 -6
  15. package/dist/enums/assetGroupingType.js +1 -1
  16. package/dist/enums/batchOperationType.js +1 -1
  17. package/dist/enums/batchState..js +1 -1
  18. package/dist/enums/pageItemTemplateType.js +1 -1
  19. package/dist/models/locales.d.ts +3 -0
  20. package/dist/{src/models/exception.js → models/locales.js} +30 -28
  21. package/license.txt +20 -20
  22. package/package.json +41 -40
  23. package/tsconfig.json +14 -14
  24. package/dist/apiMethods/apiClient.d.ts +0 -19
  25. package/dist/apiMethods/apiClient.js +0 -24
  26. package/dist/src/apiMethods/assetMethods.d.ts +0 -14
  27. package/dist/src/apiMethods/assetMethods.js +0 -172
  28. package/dist/src/apiMethods/batchMethods.d.ts +0 -11
  29. package/dist/src/apiMethods/batchMethods.js +0 -117
  30. package/dist/src/apiMethods/clientInstance.d.ts +0 -8
  31. package/dist/src/apiMethods/clientInstance.js +0 -156
  32. package/dist/src/apiMethods/containerMethods.d.ts +0 -16
  33. package/dist/src/apiMethods/containerMethods.js +0 -189
  34. package/dist/src/apiMethods/contentMethods.d.ts +0 -20
  35. package/dist/src/apiMethods/contentMethods.js +0 -359
  36. package/dist/src/apiMethods/instanceUserMethods.d.ts +0 -13
  37. package/dist/src/apiMethods/modelMethods.d.ts +0 -13
  38. package/dist/src/apiMethods/modelMethods.js +0 -150
  39. package/dist/src/apiMethods/pageMethods.d.ts +0 -20
  40. package/dist/src/apiMethods/pageMethods.js +0 -323
  41. package/dist/src/enums/batchOperationType.d.ts +0 -19
  42. package/dist/src/enums/batchOperationType.js +0 -23
  43. package/dist/src/enums/batchState..d.ts +0 -7
  44. package/dist/src/enums/batchState..js +0 -11
  45. package/dist/src/index.d.ts +0 -14
  46. package/dist/src/index.js +0 -30
  47. package/dist/src/models/batch.d.ts +0 -29
  48. package/dist/src/models/batch.js +0 -9
  49. package/dist/src/models/batchItem.d.ts +0 -13
  50. package/dist/src/models/batchItem.js +0 -9
  51. package/dist/src/models/container.d.ts +0 -47
  52. package/dist/src/models/container.js +0 -9
  53. package/dist/src/models/contentItem.d.ts +0 -37
  54. package/dist/src/models/contentItem.js +0 -33
  55. package/dist/src/models/contentViewColumn.d.ts +0 -8
  56. package/dist/src/models/contentViewColumn.js +0 -9
  57. package/dist/src/models/exception.d.ts +0 -4
  58. package/dist/src/models/instanceRole.d.ts +0 -7
  59. package/dist/src/models/instanceRole.js +0 -9
  60. package/dist/src/models/instanceUser.d.ts +0 -14
  61. package/dist/src/models/instanceUser.js +0 -9
  62. package/dist/src/models/media.d.ts +0 -30
  63. package/dist/src/models/media.js +0 -15
  64. package/dist/src/models/model.d.ts +0 -30
  65. package/dist/src/models/model.js +0 -15
  66. package/dist/src/models/notification.d.ts +0 -13
  67. package/dist/src/models/notification.js +0 -9
  68. package/dist/src/models/options.d.ts +0 -7
  69. package/dist/src/models/options.js +0 -9
  70. package/dist/src/models/pageItem.d.ts +0 -56
  71. package/dist/src/models/pageItem.js +0 -39
  72. package/dist/src/models/sitemap.d.ts +0 -20
  73. package/dist/src/models/sitemap.js +0 -15
  74. package/dist/src/models/websiteUser.d.ts +0 -22
  75. package/dist/src/models/websiteUser.js +0 -15
package/README.md CHANGED
@@ -1,681 +1,696 @@
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
- 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
-
19
- ### Making a Request
20
- ```Javascript
21
- import * as mgmtApi from "./index";
22
-
23
- //initialize the Options Class
24
- let options = new mgmtApi.Options();
25
-
26
- options.token = "<<Provide Auth Token>>"
27
- //Initialize the APIClient Class
28
- let apiClient = new mgmtApi.ApiClient(options);
29
-
30
- let guid = "<<Provide the Guid of the Website>>";
31
- let locale = "<<Provide the locale of the Website>>"; //Example: en-us
32
-
33
-
34
-
35
- //make the request: get a content item with the ID '22'
36
- var contentItem = await apiClient.contentMethods.getContentItem(22,guid, locale);
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
- | `guid` | `string` | Current website guid.|
50
- | `groupingID` | `number` | Path of the folder in Agility where the file(s) needs to be uploaded.|
51
-
52
- Returns: A collection of ```Media``` class Object.
53
-
54
- ### createFolder
55
- | Parameter | Type | Description |
56
- | :-------- | :------- | :------------------------- |
57
- | `originKey` | `string` | The origin key of the requested folder. |
58
- | `guid` | `string` | Current website guid.|
59
-
60
- Returns: A collection of ```Media``` class Object.
61
-
62
- ### deleteFile
63
- | Parameter | Type | Description |
64
- | :-------- | :------- | :------------------------- |
65
- | `mediaID` | `number` | The mediaID of the asset which needs to be deleted.|
66
- | `guid` | `string` | Current website guid.|
67
- Returns
68
- A ```string``` response if a file has been deleted.
69
-
70
- ### moveFile
71
- | Parameter | Type | Description |
72
- | :-------- | :------- | :------------------------- |
73
- | `mediaID` | `number` | The mediaID of the file that needs to be moved.|
74
- | `newFolder` | `string` | The new location (in Agility) where the file needs to be moved.|
75
- | `guid` | `string` | Current website guid.|
76
-
77
- Returns: An object of ```Media``` class with the new location of the file.
78
-
79
- ### getMediaList
80
- | Parameter | Type | Description |
81
- | :-------- | :------- | :------------------------- |
82
- | `pageSize` | `number` | The page size on which the assets needs to selected.|
83
- | `recordOffset` | `number` | The record offset value to skip search results.|
84
- | `guid` | `string` | Current website guid.|
85
-
86
- Returns: An object of ```AssetMediaList``` class.
87
-
88
- ### getGalleryById
89
- | Parameter | Type | Description |
90
- | :-------- | :------- | :------------------------- |
91
- | `guid` | `string` | Current website guid.|
92
- | `id` | `number` | The ID of the requested gallery.|
93
-
94
- Returns: An object of ```assetMediaGrouping``` class.
95
-
96
- ### getGalleryByName
97
- | Parameter | Type | Description |
98
- | :-------- | :------- | :------------------------- |
99
- | `guid` | `string` | Current website guid.|
100
- | `galleryName` | `string` | The name of the requested gallery.|
101
-
102
- Returns: An object of ```assetMediaGrouping``` class.
103
-
104
- ### getDefaultContainer
105
- | Parameter | Type | Description |
106
- | :-------- | :------- | :------------------------- |
107
- | `guid` | `string` | Current website guid.|
108
-
109
- Returns: An object of ```assetContainer``` class.
110
-
111
- ### getGalleries
112
- | Parameter | Type | Description |
113
- | :-------- | :------- | :------------------------- |
114
- | `guid` | `string` | Current website guid.|
115
- | `search` | `string` | String to search a specific gallery item.|
116
- | `pageSize` | `number` | The pageSize on which the galleries needs to be selected.|
117
- | `rowIndex` | `number` | The rowIndex value for the resultant record set.|
118
-
119
- Returns: An object of ```assetGalleries``` class.
120
-
121
- ### saveGallery
122
- | Parameter | Type | Description |
123
- | :-------- | :------- | :------------------------- |
124
- | `guid` | `string` | Current website guid.|
125
- | `gallery` | `assetMediaGrouping` | Object of AssetMediaGrouping class.|
126
-
127
- Returns: An object of ```assetMediaGrouping``` class.
128
-
129
- ### deleteGallery
130
- | Parameter | Type | Description |
131
- | :-------- | :------- | :------------------------- |
132
- | `guid` | `string` | Current website guid.|
133
- | `id` | `number` | The id of the gallery to be deleted.|
134
-
135
- A ```string``` response if the gallery has been deleted.
136
-
137
- ### getAssetByID
138
- | Parameter | Type | Description |
139
- | :-------- | :------- | :------------------------- |
140
- | `mediaID` | `number` | The mediaID of the requested asset.|
141
- | `guid` | `string` | Current website guid.|
142
-
143
- Returns: An object of ```Media``` class with the information of the asset.
144
-
145
- ### getAssetByUrl
146
- | Parameter | Type | Description |
147
- | :-------- | :------- | :------------------------- |
148
- | `url` | `string` | The url of the requested asset.|
149
- | `guid` | `string` | Current website guid.|
150
-
151
- Returns: An object of ```Media``` class with the information of the asset.
152
-
153
- ## Class BatchMethods
154
- This class is used to perform operations related to Batches. The following are the methods: -
155
-
156
- ### getBatch
157
- | Parameter | Type | Description |
158
- | :-------- | :------- | :------------------------- |
159
- | `id` | `number` | The batchID of the requested batch.|
160
- | `guid` | `string` | Current website guid.|
161
-
162
- Returns: A object of ```Batch``` class.
163
-
164
- ## Class ContainerMethods
165
- This class is used to perform operations related to Containers. The following are the methods: -
166
-
167
- ### getContainerByID
168
- | Parameter | Type | Description |
169
- | :-------- | :------- | :------------------------- |
170
- | `id` | `number` | The container id of the requested container.|
171
- | `guid` | `string` | Current website guid.|
172
-
173
- Returns: A object of ```Container``` class.
174
-
175
- ### getContainersByModel
176
- | Parameter | Type | Description |
177
- | :-------- | :------- | :------------------------- |
178
- | `modelId` | `number` | The model id of the requested container.|
179
- | `guid` | `string` | Current website guid.|
180
-
181
- Returns: A object of ```Container``` class.
182
-
183
- ### getContainerByReferenceName
184
- | Parameter | Type | Description |
185
- | :-------- | :------- | :------------------------- |
186
- | `referenceName` | `string` | The container reference name of the requested container.|
187
- | `guid` | `string` | Current website guid.|
188
-
189
- Returns: A object of ```Container``` class.
190
-
191
- ### getContainerSecurity
192
- | Parameter | Type | Description |
193
- | :-------- | :------- | :------------------------- |
194
- | `id` | `number` | The container id of the requested container.|
195
- | `guid` | `string` | Current website guid.|
196
-
197
- Returns: A object of ```Container``` class.
198
-
199
- ### getContainerList
200
- | Parameter | Type | Description |
201
- | :-------- | :------- | :------------------------- |
202
- | `guid` | `string` | Current website guid.|
203
- Returns: A collection object of ```Container``` class.
204
-
205
- ### getNotificationList
206
- | Parameter | Type | Description |
207
- | :-------- | :------- | :------------------------- |
208
- | `id` | `number` | The container id of the requested container.|
209
- | `guid` | `string` | Current website guid.|
210
- Returns: A collection object of ```Notification``` class.
211
-
212
- ### saveContainer
213
- | Parameter | Type | Description |
214
- | :-------- | :------- | :------------------------- |
215
- | `container` | `Container` | A Container type object to create or update a container.|
216
- | `guid` | `string` | Current website guid.|
217
-
218
- Returns: An object of ```Container``` class.
219
-
220
- ### deleteContainer
221
- | Parameter | Type | Description |
222
- | :-------- | :------- | :------------------------- |
223
- | `id` | `number` | The container id of the requested container.|
224
- | `guid` | `string` | Current website guid.|
225
- Returns: A ```string``` response if a container has been deleted.
226
-
227
- ## Class ContentMethods
228
- This class is used to perform operations related to Content. The following are the methods: -
229
-
230
- ### getContentItem
231
- | Parameter | Type | Description |
232
- | :-------- | :------- | :------------------------- |
233
- | `contentID` | `number` | The contentid of the requested content.|
234
- | `guid` | `string` | Current website guid.|
235
- | `locale` | `string` | Current website locale.|
236
-
237
- Returns: An object of ```ContentItem``` class.
238
-
239
- ### publishContent
240
- | Parameter | Type | Description |
241
- | :-------- | :------- | :------------------------- |
242
- | `contentID` | `number` | The contentid of the requested content.|
243
- | `guid` | `string` | Current website guid.|
244
- | `locale` | `string` | Current website locale.|
245
- | `comments` | `string` | Additional comments for a batch request.|
246
-
247
- Returns: An array of ```contentID``` of the requested content.
248
-
249
- ### unPublishContent
250
- | Parameter | Type | Description |
251
- | :-------- | :------- | :------------------------- |
252
- | `contentID` | `number` | The contentid of the requested content.|
253
- | `guid` | `string` | Current website guid.|
254
- | `locale` | `string` | Current website locale.|
255
- | `comments` | `string` | Additional comments for a batch request.|
256
-
257
- Returns: An array of ```contentID``` of the requested content.
258
-
259
- ### contentRequestApproval
260
- | Parameter | Type | Description |
261
- | :-------- | :------- | :------------------------- |
262
- | `contentID` | `number` | The contentid of the requested content.|
263
- | `guid` | `string` | Current website guid.|
264
- | `locale` | `string` | Current website locale.|
265
- | `comments` | `string` | Additional comments for a batch request.|
266
-
267
- Returns: An array of ```contentID``` of the requested content.
268
-
269
- ### approveContent
270
- | Parameter | Type | Description |
271
- | :-------- | :------- | :------------------------- |
272
- | `contentID` | `number` | The contentid of the requested content.|
273
- | `guid` | `string` | Current website guid.|
274
- | `locale` | `string` | Current website locale.|
275
- | `comments` | `string` | Additional comments for a batch request.|
276
-
277
- Returns: An array of ```contentID``` of the requested content.
278
-
279
- ### declineContent
280
- | Parameter | Type | Description |
281
- | :-------- | :------- | :------------------------- |
282
- | `contentID` | `number` | The contentid of the requested content.|
283
- | `guid` | `string` | Current website guid.|
284
- | `locale` | `string` | Current website locale.|
285
- | `comments` | `string` | Additional comments for a batch request.|
286
-
287
- Returns: An array of ```contentID``` of the requested content.
288
-
289
- ### saveContentItem
290
- | Parameter | Type | Description |
291
- | :-------- | :------- | :------------------------- |
292
- | `contentItem` | `ContentItem` | A contentItem object to create or update a content.|
293
- | `guid` | `string` | Current website guid.|
294
- | `locale` | `string` | Current website locale.|
295
-
296
- Returns: An array of ```contentID``` of the requested content.
297
-
298
- ### saveContentItems
299
- | Parameter | Type | Description |
300
- | :-------- | :------- | :------------------------- |
301
- | `contentItems` | `ContentItem[]` | A collection of contentItems object to create or update multiple contents.|
302
- | `guid` | `string` | Current website guid.|
303
- | `locale` | `string` | Current website locale.|
304
-
305
- Returns: An array of ```contentID``` of the requested content.
306
-
307
- ### deleteContent
308
- | Parameter | Type | Description |
309
- | :-------- | :------- | :------------------------- |
310
- | `contentID` | `number` | The contentid of the requested content.|
311
- | `guid` | `string` | Current website guid.|
312
- | `locale` | `string` | Current website locale.|
313
- | `comments` | `string` | Additional comments for a batch request.|
314
-
315
- Returns: An array of ```contentID``` of the requested content.
316
-
317
- ### getContentItems
318
- | Parameter | Type | Description |
319
- | :-------- | :------- | :------------------------- |
320
- | `referenceName` | `string` | The reference name of the container for the requested content.|
321
- | `guid` | `string` | Current website guid.|
322
- | `locale` | `string` | Current website locale.|
323
- | `listParams` | `ListParams` | The parameters list to apply filter on the content list.|
324
-
325
- Returns: An object of ```ContentList``` class of the requested content.
326
-
327
- ### getContentList
328
- | Parameter | Type | Description |
329
- | :-------- | :------- | :------------------------- |
330
- | `referenceName` | `string` | The reference name of the container for the requested content.|
331
- | `guid` | `string` | Current website guid.|
332
- | `locale` | `string` | Current website locale.|
333
- | `listParams` | `ListParams` | The parameters list to apply filter on the content list.|
334
- | `filterObject` | `ContentListFilterModel` | To apply filter at the field level.|
335
-
336
- Returns: An object of ```ContentList``` class of the requested content.
337
-
338
- ### getContentHistory
339
- | Parameter | Type | Description |
340
- | :-------- | :------- | :------------------------- |
341
- | `locale` | `string` | Current website locale.|
342
- | `guid` | `string` | Current website guid.|
343
- | `contentID` | `number` | The contentID of the requested content.|
344
- | `take` | `number` | The number of items per record set default value 50.|
345
- | `skip` | `number` | The skip level on the record set default value 0.|
346
-
347
- Returns: An object of ```ContentItemHistory``` class of the requested content history.
348
-
349
- ### getContentComments
350
- | Parameter | Type | Description |
351
- | :-------- | :------- | :------------------------- |
352
- | `locale` | `string` | Current website locale.|
353
- | `guid` | `string` | Current website guid.|
354
- | `contentID` | `number` | The contentID of the requested content.|
355
- | `take` | `number` | The number of items per record set default value 50.|
356
- | `skip` | `number` | The skip level on the record set default value 0.|
357
-
358
- Returns: An object of ```ItemComments``` class of the requested content comments.
359
-
360
- ## Class InstanceUserMethods
361
- This class is used to perform operations related to User. The following are the methods: -
362
-
363
- ### getUsers
364
- | Parameter | Type | Description |
365
- | :-------- | :------- | :------------------------- |
366
- | `guid` | `string` | Current website guid.|
367
- Returns: A collection of ```WebsiteUser``` class of the requested content.
368
-
369
- ### saveUser
370
- | Parameter | Type | Description |
371
- | :-------- | :------- | :------------------------- |
372
- | `emailAddress` | `string` | The email address of the requested user.|
373
- | `roles` | `InstanceRole[]` | Collection object of InstanceRole class for the requested user.|
374
- | `guid` | `string` | Current website guid.|
375
- | `firstName` | `string` | The first name of the requested user.|
376
- | `lastName` | `string` | The last name of the requested user.|
377
-
378
- Returns: An object of the ```InstanceUser``` class.
379
-
380
- ### deleteUser
381
- | Parameter | Type | Description |
382
- | :-------- | :------- | :------------------------- |
383
- | `userID` | `number` | The userID of the requested user.|
384
- | `guid` | `string` | Current website guid.|
385
-
386
- Returns: A ```string``` response if a user has been deleted.
387
-
388
- ## Class ModelMethods
389
- This class is used to perform operations related to Models. The following are the methods: -
390
-
391
- ### getContentModel
392
- | Parameter | Type | Description |
393
- | :-------- | :------- | :------------------------- |
394
- | `id` | `number` | The id of the requested model.|
395
- | `guid` | `string` | Current website guid.|
396
-
397
- Returns: An object of ```Model``` class.
398
-
399
- ### GetModelByReferenceName
400
- | Parameter | Type | Description |
401
- | :-------- | :------- | :------------------------- |
402
- | `referenceName` | `string` | The referenceName of the requested model.|
403
- | `guid` | `string` | The guid of the requested model.|
404
-
405
- ### getContentModules
406
- | Parameter | Type | Description |
407
- | :-------- | :------- | :------------------------- |
408
- | `includeDefaults` | `bool` | Boolean value to include defaults.|
409
- | `guid` | `string` | Current website guid.|
410
- | `includeModules` | `bool` | Boolean value to include modules.|
411
-
412
- Returns: A collection object of ```Model``` class.
413
-
414
- ### getPageModules
415
- | Parameter | Type | Description |
416
- | :-------- | :------- | :------------------------- |
417
- | `includeDefault` | `bool` | Boolean value to include defaults.|
418
- | `guid` | `string` | Current website guid.|
419
-
420
- Returns: A collection object of ```Model``` class.
421
-
422
- ### saveModel
423
- | Parameter | Type | Description |
424
- | :-------- | :------- | :------------------------- |
425
- | `model` | `Model` | The object of Model to for the requested model.|
426
- | `guid` | `string` | Current website guid.|
427
-
428
- Returns: An object of ```Model``` class.
429
-
430
- ### deleteModel
431
- | Parameter | Type | Description |
432
- | :-------- | :------- | :------------------------- |
433
- | `id` | `number` | The id for the requested model.|
434
- | `guid` | `string` | Current website guid.|
435
-
436
- Returns: A ```string``` response if a model is deleted.
437
-
438
- ## Class PageMethods
439
- This class is used to perform operations related to Pages. The following are the methods: -
440
-
441
- ### getSitemap
442
- | Parameter | Type | Description |
443
- | :-------- | :------- | :------------------------- |
444
- | `guid` | `string` | Current website guid.|
445
- | `locale` | `string` | Current website locale.|
446
- Returns: A collection object of ```Sitemap``` class.
447
-
448
- ### getPageTemplates
449
- | Parameter | Type | Description |
450
- | :-------- | :------- | :------------------------- |
451
- | `guid` | `string` | Current website guid.|
452
- | `locale` | `string` | Current website locale.|
453
- | `includeModuleZones` | `boolean` | To include zones in the result set.|
454
- | `searchFilter` | `string` | To apply search criteria on the requested page template.|
455
- Returns: A collection object of ```PageModel``` class.
456
-
457
- ### getPageTemplate
458
- | Parameter | Type | Description |
459
- | :-------- | :------- | :------------------------- |
460
- | `guid` | `string` | Current website guid.|
461
- | `locale` | `string` | Current website locale.|
462
- | `pageTemplateId` | `number` | The pageTemplateId of the requested page template.|
463
- Returns: An object of ```PageModel``` class.
464
-
465
- ### getPageTemplateName
466
- | Parameter | Type | Description |
467
- | :-------- | :------- | :------------------------- |
468
- | `guid` | `string` | Current website guid.|
469
- | `locale` | `string` | Current website locale.|
470
- | `templateName` | `string` | The templateName of the requested page template.|
471
- Returns: An object of ```PageModel``` class.
472
-
473
- ### deletePageTemplate
474
- | Parameter | Type | Description |
475
- | :-------- | :------- | :------------------------- |
476
- | `guid` | `string` | Current website guid.|
477
- | `locale` | `string` | Current website locale.|
478
- | `pageTemplateId` | `string` | The pageTemplateId of the requested page template.|
479
-
480
- ### getPageItemTemplates
481
- | Parameter | Type | Description |
482
- | :-------- | :------- | :------------------------- |
483
- | `guid` | `string` | Current website guid.|
484
- | `locale` | `string` | Current website locale.|
485
- | `id` | `number` | The id of the requested page template.|
486
- Returns: A collection of ```ContentSectionDefinition``` class.
487
-
488
- ### savePageTemplate
489
- | Parameter | Type | Description |
490
- | :-------- | :------- | :------------------------- |
491
- | `guid` | `string` | Current website guid.|
492
- | `locale` | `string` | Current website locale.|
493
- | `pageModel` | `PageModel` | The pageModel object of the requested page template.|
494
- Returns: An object of ```PageModel``` class.
495
-
496
- ### getPage
497
- | Parameter | Type | Description |
498
- | :-------- | :------- | :------------------------- |
499
- | `pageID` | `number` | The id of the requested page.|
500
- | `guid` | `string` | Current website guid.|
501
- | `locale` | `string` | Current website locale.|
502
-
503
- Returns: An object of ```PageItem``` class.
504
-
505
- ### publishPage
506
- | Parameter | Type | Description |
507
- | :-------- | :------- | :------------------------- |
508
- | `pageID` | `number` | The pageID of the requested page.|
509
- | `guid` | `string` | Current website guid.|
510
- | `locale` | `string` | Current website locale.|
511
- | `comments` | `string` | Additional comments for a batch request.|
512
-
513
- Returns: An array of ```pageID``` of the requested page.
514
-
515
- ### unPublishPage
516
- | Parameter | Type | Description |
517
- | :-------- | :------- | :------------------------- |
518
- | `pageID` | `number` | The pageID of the requested page.|
519
- | `guid` | `string` | Current website guid.|
520
- | `locale` | `string` | Current website locale.|
521
- | `comments` | `string` | Additional comments for a batch request.|
522
-
523
- Returns: An array of ```pageID``` of the requested page.
524
-
525
- ### deletePage
526
- | Parameter | Type | Description |
527
- | :-------- | :------- | :------------------------- |
528
- | `pageID` | `number` | The pageID of the requested page.|
529
- | `guid` | `string` | Current website guid.|
530
- | `locale` | `string` | Current website locale.|
531
- | `comments` | `string` | Additional comments for a batch request.|
532
-
533
- Returns: An array of ```pageID``` of the requested page.
534
-
535
- ### approvePage
536
- | Parameter | Type | Description |
537
- | :-------- | :------- | :------------------------- |
538
- | `pageID` | `number` | The pageID of the requested page.|
539
- | `guid` | `string` | Current website guid.|
540
- | `locale` | `string` | Current website locale.|
541
- | `comments` | `string` | Additional comments for a batch request.|
542
-
543
- Returns: An array of ```pageID``` of the requested page.
544
-
545
- ### declinePage
546
- | Parameter | Type | Description |
547
- | :-------- | :------- | :------------------------- |
548
- | `pageID` | `number` | The pageID of the requested page.|
549
- | `guid` | `string` | Current website guid.|
550
- | `locale` | `string` | Current website locale.|
551
- | `comments` | `string` | Additional comments for a batch request.|
552
-
553
- Returns: An array of ```pageID``` of the requested page.
554
-
555
- ### pageRequestApproval
556
- | Parameter | Type | Description |
557
- | :-------- | :------- | :------------------------- |
558
- | `pageID` | `number` | The pageID of the requested page.|
559
- | `guid` | `string` | Current website guid.|
560
- | `locale` | `string` | Current website locale.|
561
- | `comments` | `string` | Additional comments for a batch request.|
562
-
563
- Returns: An array of ```pageID``` of the requested page.
564
-
565
- ### savePage
566
- | Parameter | Type | Description |
567
- | :-------- | :------- | :------------------------- |
568
- | `pageItem` | `PageItem` | The object of PageItem class for the requested Page.|
569
- | `guid` | `string` | Current website guid.|
570
- | `locale` | `string` | Current website locale.|
571
- | `parentPageID` | `number` | The id of the parent page.|
572
- | `placeBeforePageItemID` | `number` | The id of the page before the page.|
573
-
574
- Returns: An array of ```pageID``` of the requested page.
575
-
576
- ### getPageHistory
577
- | Parameter | Type | Description |
578
- | :-------- | :------- | :------------------------- |
579
- | `locale` | `string` | Current website locale.|
580
- | `guid` | `string` | Current website guid.|
581
- | `pageID` | `number` | The pageID of the requested page.|
582
- | `take` | `number` | The number of items per record set default value 50.|
583
- | `skip` | `number` | The skip level on the record set default value 0.|
584
-
585
- Returns: An object of ```PageHistory``` class of the requested page history.
586
-
587
- ### getPageComments
588
- | Parameter | Type | Description |
589
- | :-------- | :------- | :------------------------- |
590
- | `locale` | `string` | Current website locale.|
591
- | `guid` | `string` | Current website guid.|
592
- | `pageID` | `number` | The pageID of the requested page.|
593
- | `take` | `number` | The number of items per record set default value 50.|
594
- | `skip` | `number` | The skip level on the record set default value 0.|
595
-
596
- Returns: An object of ```ItemComments``` class of the requested page comments.
597
-
598
- ## Class ServerUserMethods
599
- This class is used to perform operations related to Server User. The following are the methods: -
600
-
601
- ### me
602
- | Parameter | Type | Description |
603
- | :-------- | :------- | :------------------------- |
604
- | `guid` | `string` | Current website guid.|
605
-
606
- Returns: An object of ```ServerUser``` class of the requested user.
607
-
608
- ### you
609
- | Parameter | Type | Description |
610
- | :-------- | :------- | :------------------------- |
611
- | `guid` | `string` | Current website guid.|
612
- | `serverUserID` | `number` | Current website guid.|
613
-
614
- Returns: An object of ```ServerUser``` class of the requested user.
615
-
616
- ## Class WebhookMethods
617
- This class is used to perform operations related to Webhooks in the agility instance. The following are the methods: -
618
-
619
- ### webhookList
620
- | Parameter | Type | Description |
621
- | :-------- | :------- | :------------------------- |
622
- | `guid` | `string` | Current website guid.|
623
- | `take` | `number` | The number of items per record set default value 20.|
624
- | `skip` | `number` | The skip level on the record set default value 0.|
625
-
626
- Returns: A list of webhooks configured in the instance.
627
-
628
- ### saveWebhook
629
- | Parameter | Type | Description |
630
- | :-------- | :------- | :------------------------- |
631
- | `guid` | `string` | Current website guid.|
632
- | `webhook` | `Webhook` | An object of Webhook type with the webhook data.|
633
-
634
- Returns: An object with the created Webhook.
635
-
636
- ### getWebhook
637
- | Parameter | Type | Description |
638
- | :-------- | :------- | :------------------------- |
639
- | `guid` | `string` | Current website guid.|
640
- | `webhookID` | `string` | The webhookID of the requested webhook.|
641
-
642
- Returns: An object with the requested Webhook.
643
-
644
- ### deleteWebhook
645
- | Parameter | Type | Description |
646
- | :-------- | :------- | :------------------------- |
647
- | `guid` | `string` | Current website guid.|
648
- | `webhookID` | `string` | The webhookID of the requested webhook.|
649
-
650
-
651
- ## Running the SDK Locally
652
-
653
- - `npm run clean`
654
- - `npm run prepare`
655
- - `npm run build`
656
-
657
- ## How It Works
658
-
659
- - [How Pages Work](https://help.agilitycms.com/hc/en-us/articles/4404222849677)
660
- - [How Page Modules Work](https://help.agilitycms.com/hc/en-us/articles/4404222989453)
661
- - [How Page Templates Work](https://help.agilitycms.com/hc/en-us/articles/4404229108877)
662
-
663
- ## Resources
664
-
665
- ### Agility CMS
666
-
667
- - [Official site](https://agilitycms.com)
668
- - [Documentation](https://help.agilitycms.com/hc/en-us)
669
-
670
- ### Community
671
-
672
- - [Official Slack](https://join.slack.com/t/agilitycommunity/shared_invite/enQtNzI2NDc3MzU4Njc2LWI2OTNjZTI3ZGY1NWRiNTYzNmEyNmI0MGZlZTRkYzI3NmRjNzkxYmI5YTZjNTg2ZTk4NGUzNjg5NzY3OWViZGI)
673
- - [Blog](https://agilitycms.com/resources/posts)
674
- - [GitHub](https://github.com/agility)
675
- - [Forums](https://help.agilitycms.com/hc/en-us/community/topics)
676
- - [Facebook](https://www.facebook.com/AgilityCMS/)
677
- - [Twitter](https://twitter.com/AgilityCMS)
678
-
679
- ## Feedback and Questions
680
-
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
+ 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
+
19
+ ### Making a Request
20
+ ```Javascript
21
+ import * as mgmtApi from "./index";
22
+
23
+ //initialize the Options Class
24
+ let options = new mgmtApi.Options();
25
+
26
+ options.token = "<<Provide Auth Token>>"
27
+ //Initialize the APIClient Class
28
+ let apiClient = new mgmtApi.ApiClient(options);
29
+
30
+ let guid = "<<Provide the Guid of the Website>>";
31
+ let locale = "<<Provide the locale of the Website>>"; //Example: en-us
32
+
33
+
34
+
35
+ //make the request: get a content item with the ID '22'
36
+ var contentItem = await apiClient.contentMethods.getContentItem(22,guid, locale);
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
+ | `guid` | `string` | Current website guid.|
50
+ | `groupingID` | `number` | Path of the folder in Agility where the file(s) needs to be uploaded.|
51
+
52
+ Returns: A collection of ```Media``` class Object.
53
+
54
+ ### createFolder
55
+ | Parameter | Type | Description |
56
+ | :-------- | :------- | :------------------------- |
57
+ | `originKey` | `string` | The origin key of the requested folder. |
58
+ | `guid` | `string` | Current website guid.|
59
+
60
+ Returns: A collection of ```Media``` class Object.
61
+
62
+ ### deleteFolder
63
+ | Parameter | Type | Description |
64
+ | :-------- | :------- | :------------------------- |
65
+ | `originKey` | `string` | The origin key of the requested folder. |
66
+ | `guid` | `string` | Current website guid.|
67
+ | `mediaID` | `number` | The mediaID of the folder that needs to be deleted.|
68
+
69
+ ### renameFolder
70
+ | Parameter | Type | Description |
71
+ | :-------- | :------- | :------------------------- |
72
+ | `folderName` | `string` | The original folder name. |
73
+ | `newFolderName` | `string` | The new folder name. |
74
+ | `guid` | `string` | Current website guid.|
75
+ | `mediaID` | `number` | The mediaID of the folder that needs to be renamed.|
76
+
77
+ ### deleteFile
78
+ | Parameter | Type | Description |
79
+ | :-------- | :------- | :------------------------- |
80
+ | `mediaID` | `number` | The mediaID of the asset which needs to be deleted.|
81
+ | `guid` | `string` | Current website guid.|
82
+ Returns
83
+ A ```string``` response if a file has been deleted.
84
+
85
+ ### moveFile
86
+ | Parameter | Type | Description |
87
+ | :-------- | :------- | :------------------------- |
88
+ | `mediaID` | `number` | The mediaID of the file that needs to be moved.|
89
+ | `newFolder` | `string` | The new location (in Agility) where the file needs to be moved.|
90
+ | `guid` | `string` | Current website guid.|
91
+
92
+ Returns: An object of ```Media``` class with the new location of the file.
93
+
94
+ ### getMediaList
95
+ | Parameter | Type | Description |
96
+ | :-------- | :------- | :------------------------- |
97
+ | `pageSize` | `number` | The page size on which the assets needs to selected.|
98
+ | `recordOffset` | `number` | The record offset value to skip search results.|
99
+ | `guid` | `string` | Current website guid.|
100
+
101
+ Returns: An object of ```AssetMediaList``` class.
102
+
103
+ ### getGalleryById
104
+ | Parameter | Type | Description |
105
+ | :-------- | :------- | :------------------------- |
106
+ | `guid` | `string` | Current website guid.|
107
+ | `id` | `number` | The ID of the requested gallery.|
108
+
109
+ Returns: An object of ```assetMediaGrouping``` class.
110
+
111
+ ### getGalleryByName
112
+ | Parameter | Type | Description |
113
+ | :-------- | :------- | :------------------------- |
114
+ | `guid` | `string` | Current website guid.|
115
+ | `galleryName` | `string` | The name of the requested gallery.|
116
+
117
+ Returns: An object of ```assetMediaGrouping``` class.
118
+
119
+ ### getDefaultContainer
120
+ | Parameter | Type | Description |
121
+ | :-------- | :------- | :------------------------- |
122
+ | `guid` | `string` | Current website guid.|
123
+
124
+ Returns: An object of ```assetContainer``` class.
125
+
126
+ ### getGalleries
127
+ | Parameter | Type | Description |
128
+ | :-------- | :------- | :------------------------- |
129
+ | `guid` | `string` | Current website guid.|
130
+ | `search` | `string` | String to search a specific gallery item.|
131
+ | `pageSize` | `number` | The pageSize on which the galleries needs to be selected.|
132
+ | `rowIndex` | `number` | The rowIndex value for the resultant record set.|
133
+
134
+ Returns: An object of ```assetGalleries``` class.
135
+
136
+ ### saveGallery
137
+ | Parameter | Type | Description |
138
+ | :-------- | :------- | :------------------------- |
139
+ | `guid` | `string` | Current website guid.|
140
+ | `gallery` | `assetMediaGrouping` | Object of AssetMediaGrouping class.|
141
+
142
+ Returns: An object of ```assetMediaGrouping``` class.
143
+
144
+ ### deleteGallery
145
+ | Parameter | Type | Description |
146
+ | :-------- | :------- | :------------------------- |
147
+ | `guid` | `string` | Current website guid.|
148
+ | `id` | `number` | The id of the gallery to be deleted.|
149
+
150
+ A ```string``` response if the gallery has been deleted.
151
+
152
+ ### getAssetByID
153
+ | Parameter | Type | Description |
154
+ | :-------- | :------- | :------------------------- |
155
+ | `mediaID` | `number` | The mediaID of the requested asset.|
156
+ | `guid` | `string` | Current website guid.|
157
+
158
+ Returns: An object of ```Media``` class with the information of the asset.
159
+
160
+ ### getAssetByUrl
161
+ | Parameter | Type | Description |
162
+ | :-------- | :------- | :------------------------- |
163
+ | `url` | `string` | The url of the requested asset.|
164
+ | `guid` | `string` | Current website guid.|
165
+
166
+ Returns: An object of ```Media``` class with the information of the asset.
167
+
168
+ ## Class BatchMethods
169
+ This class is used to perform operations related to Batches. The following are the methods: -
170
+
171
+ ### getBatch
172
+ | Parameter | Type | Description |
173
+ | :-------- | :------- | :------------------------- |
174
+ | `id` | `number` | The batchID of the requested batch.|
175
+ | `guid` | `string` | Current website guid.|
176
+
177
+ Returns: A object of ```Batch``` class.
178
+
179
+ ## Class ContainerMethods
180
+ This class is used to perform operations related to Containers. The following are the methods: -
181
+
182
+ ### getContainerByID
183
+ | Parameter | Type | Description |
184
+ | :-------- | :------- | :------------------------- |
185
+ | `id` | `number` | The container id of the requested container.|
186
+ | `guid` | `string` | Current website guid.|
187
+
188
+ Returns: A object of ```Container``` class.
189
+
190
+ ### getContainersByModel
191
+ | Parameter | Type | Description |
192
+ | :-------- | :------- | :------------------------- |
193
+ | `modelId` | `number` | The model id of the requested container.|
194
+ | `guid` | `string` | Current website guid.|
195
+
196
+ Returns: A object of ```Container``` class.
197
+
198
+ ### getContainerByReferenceName
199
+ | Parameter | Type | Description |
200
+ | :-------- | :------- | :------------------------- |
201
+ | `referenceName` | `string` | The container reference name of the requested container.|
202
+ | `guid` | `string` | Current website guid.|
203
+
204
+ Returns: A object of ```Container``` class.
205
+
206
+ ### getContainerSecurity
207
+ | Parameter | Type | Description |
208
+ | :-------- | :------- | :------------------------- |
209
+ | `id` | `number` | The container id of the requested container.|
210
+ | `guid` | `string` | Current website guid.|
211
+
212
+ Returns: A object of ```Container``` class.
213
+
214
+ ### getContainerList
215
+ | Parameter | Type | Description |
216
+ | :-------- | :------- | :------------------------- |
217
+ | `guid` | `string` | Current website guid.|
218
+ Returns: A collection object of ```Container``` class.
219
+
220
+ ### getNotificationList
221
+ | Parameter | Type | Description |
222
+ | :-------- | :------- | :------------------------- |
223
+ | `id` | `number` | The container id of the requested container.|
224
+ | `guid` | `string` | Current website guid.|
225
+ Returns: A collection object of ```Notification``` class.
226
+
227
+ ### saveContainer
228
+ | Parameter | Type | Description |
229
+ | :-------- | :------- | :------------------------- |
230
+ | `container` | `Container` | A Container type object to create or update a container.|
231
+ | `guid` | `string` | Current website guid.|
232
+
233
+ Returns: An object of ```Container``` class.
234
+
235
+ ### deleteContainer
236
+ | Parameter | Type | Description |
237
+ | :-------- | :------- | :------------------------- |
238
+ | `id` | `number` | The container id of the requested container.|
239
+ | `guid` | `string` | Current website guid.|
240
+ Returns: A ```string``` response if a container has been deleted.
241
+
242
+ ## Class ContentMethods
243
+ This class is used to perform operations related to Content. The following are the methods: -
244
+
245
+ ### getContentItem
246
+ | Parameter | Type | Description |
247
+ | :-------- | :------- | :------------------------- |
248
+ | `contentID` | `number` | The contentid of the requested content.|
249
+ | `guid` | `string` | Current website guid.|
250
+ | `locale` | `string` | Current website locale.|
251
+
252
+ Returns: An object of ```ContentItem``` class.
253
+
254
+ ### publishContent
255
+ | Parameter | Type | Description |
256
+ | :-------- | :------- | :------------------------- |
257
+ | `contentID` | `number` | The contentid of the requested content.|
258
+ | `guid` | `string` | Current website guid.|
259
+ | `locale` | `string` | Current website locale.|
260
+ | `comments` | `string` | Additional comments for a batch request.|
261
+
262
+ Returns: An array of ```contentID``` of the requested content.
263
+
264
+ ### unPublishContent
265
+ | Parameter | Type | Description |
266
+ | :-------- | :------- | :------------------------- |
267
+ | `contentID` | `number` | The contentid of the requested content.|
268
+ | `guid` | `string` | Current website guid.|
269
+ | `locale` | `string` | Current website locale.|
270
+ | `comments` | `string` | Additional comments for a batch request.|
271
+
272
+ Returns: An array of ```contentID``` of the requested content.
273
+
274
+ ### contentRequestApproval
275
+ | Parameter | Type | Description |
276
+ | :-------- | :------- | :------------------------- |
277
+ | `contentID` | `number` | The contentid of the requested content.|
278
+ | `guid` | `string` | Current website guid.|
279
+ | `locale` | `string` | Current website locale.|
280
+ | `comments` | `string` | Additional comments for a batch request.|
281
+
282
+ Returns: An array of ```contentID``` of the requested content.
283
+
284
+ ### approveContent
285
+ | Parameter | Type | Description |
286
+ | :-------- | :------- | :------------------------- |
287
+ | `contentID` | `number` | The contentid of the requested content.|
288
+ | `guid` | `string` | Current website guid.|
289
+ | `locale` | `string` | Current website locale.|
290
+ | `comments` | `string` | Additional comments for a batch request.|
291
+
292
+ Returns: An array of ```contentID``` of the requested content.
293
+
294
+ ### declineContent
295
+ | Parameter | Type | Description |
296
+ | :-------- | :------- | :------------------------- |
297
+ | `contentID` | `number` | The contentid of the requested content.|
298
+ | `guid` | `string` | Current website guid.|
299
+ | `locale` | `string` | Current website locale.|
300
+ | `comments` | `string` | Additional comments for a batch request.|
301
+
302
+ Returns: An array of ```contentID``` of the requested content.
303
+
304
+ ### saveContentItem
305
+ | Parameter | Type | Description |
306
+ | :-------- | :------- | :------------------------- |
307
+ | `contentItem` | `ContentItem` | A contentItem object to create or update a content.|
308
+ | `guid` | `string` | Current website guid.|
309
+ | `locale` | `string` | Current website locale.|
310
+
311
+ Returns: An array of ```contentID``` of the requested content.
312
+
313
+ ### saveContentItems
314
+ | Parameter | Type | Description |
315
+ | :-------- | :------- | :------------------------- |
316
+ | `contentItems` | `ContentItem[]` | A collection of contentItems object to create or update multiple contents.|
317
+ | `guid` | `string` | Current website guid.|
318
+ | `locale` | `string` | Current website locale.|
319
+
320
+ Returns: An array of ```contentID``` of the requested content.
321
+
322
+ ### deleteContent
323
+ | Parameter | Type | Description |
324
+ | :-------- | :------- | :------------------------- |
325
+ | `contentID` | `number` | The contentid of the requested content.|
326
+ | `guid` | `string` | Current website guid.|
327
+ | `locale` | `string` | Current website locale.|
328
+ | `comments` | `string` | Additional comments for a batch request.|
329
+
330
+ Returns: An array of ```contentID``` of the requested content.
331
+
332
+ ### getContentItems
333
+ | Parameter | Type | Description |
334
+ | :-------- | :------- | :------------------------- |
335
+ | `referenceName` | `string` | The reference name of the container for the requested content.|
336
+ | `guid` | `string` | Current website guid.|
337
+ | `locale` | `string` | Current website locale.|
338
+ | `listParams` | `ListParams` | The parameters list to apply filter on the content list.|
339
+
340
+ Returns: An object of ```ContentList``` class of the requested content.
341
+
342
+ ### getContentList
343
+ | Parameter | Type | Description |
344
+ | :-------- | :------- | :------------------------- |
345
+ | `referenceName` | `string` | The reference name of the container for the requested content.|
346
+ | `guid` | `string` | Current website guid.|
347
+ | `locale` | `string` | Current website locale.|
348
+ | `listParams` | `ListParams` | The parameters list to apply filter on the content list.|
349
+ | `filterObject` | `ContentListFilterModel` | To apply filter at the field level.|
350
+
351
+ Returns: An object of ```ContentList``` class of the requested content.
352
+
353
+ ### getContentHistory
354
+ | Parameter | Type | Description |
355
+ | :-------- | :------- | :------------------------- |
356
+ | `locale` | `string` | Current website locale.|
357
+ | `guid` | `string` | Current website guid.|
358
+ | `contentID` | `number` | The contentID of the requested content.|
359
+ | `take` | `number` | The number of items per record set default value 50.|
360
+ | `skip` | `number` | The skip level on the record set default value 0.|
361
+
362
+ Returns: An object of ```ContentItemHistory``` class of the requested content history.
363
+
364
+ ### getContentComments
365
+ | Parameter | Type | Description |
366
+ | :-------- | :------- | :------------------------- |
367
+ | `locale` | `string` | Current website locale.|
368
+ | `guid` | `string` | Current website guid.|
369
+ | `contentID` | `number` | The contentID of the requested content.|
370
+ | `take` | `number` | The number of items per record set default value 50.|
371
+ | `skip` | `number` | The skip level on the record set default value 0.|
372
+
373
+ Returns: An object of ```ItemComments``` class of the requested content comments.
374
+
375
+ ## Class InstanceUserMethods
376
+ This class is used to perform operations related to User. The following are the methods: -
377
+
378
+ ### getUsers
379
+ | Parameter | Type | Description |
380
+ | :-------- | :------- | :------------------------- |
381
+ | `guid` | `string` | Current website guid.|
382
+ Returns: A collection of ```WebsiteUser``` class of the requested content.
383
+
384
+ ### saveUser
385
+ | Parameter | Type | Description |
386
+ | :-------- | :------- | :------------------------- |
387
+ | `emailAddress` | `string` | The email address of the requested user.|
388
+ | `roles` | `InstanceRole[]` | Collection object of InstanceRole class for the requested user.|
389
+ | `guid` | `string` | Current website guid.|
390
+ | `firstName` | `string` | The first name of the requested user.|
391
+ | `lastName` | `string` | The last name of the requested user.|
392
+
393
+ Returns: An object of the ```InstanceUser``` class.
394
+
395
+ ### deleteUser
396
+ | Parameter | Type | Description |
397
+ | :-------- | :------- | :------------------------- |
398
+ | `userID` | `number` | The userID of the requested user.|
399
+ | `guid` | `string` | Current website guid.|
400
+
401
+ Returns: A ```string``` response if a user has been deleted.
402
+
403
+ ## Class ModelMethods
404
+ This class is used to perform operations related to Models. The following are the methods: -
405
+
406
+ ### getContentModel
407
+ | Parameter | Type | Description |
408
+ | :-------- | :------- | :------------------------- |
409
+ | `id` | `number` | The id of the requested model.|
410
+ | `guid` | `string` | Current website guid.|
411
+
412
+ Returns: An object of ```Model``` class.
413
+
414
+ ### GetModelByReferenceName
415
+ | Parameter | Type | Description |
416
+ | :-------- | :------- | :------------------------- |
417
+ | `referenceName` | `string` | The referenceName of the requested model.|
418
+ | `guid` | `string` | The guid of the requested model.|
419
+
420
+ ### getContentModules
421
+ | Parameter | Type | Description |
422
+ | :-------- | :------- | :------------------------- |
423
+ | `includeDefaults` | `bool` | Boolean value to include defaults.|
424
+ | `guid` | `string` | Current website guid.|
425
+ | `includeModules` | `bool` | Boolean value to include modules.|
426
+
427
+ Returns: A collection object of ```Model``` class.
428
+
429
+ ### getPageModules
430
+ | Parameter | Type | Description |
431
+ | :-------- | :------- | :------------------------- |
432
+ | `includeDefault` | `bool` | Boolean value to include defaults.|
433
+ | `guid` | `string` | Current website guid.|
434
+
435
+ Returns: A collection object of ```Model``` class.
436
+
437
+ ### saveModel
438
+ | Parameter | Type | Description |
439
+ | :-------- | :------- | :------------------------- |
440
+ | `model` | `Model` | The object of Model to for the requested model.|
441
+ | `guid` | `string` | Current website guid.|
442
+
443
+ Returns: An object of ```Model``` class.
444
+
445
+ ### deleteModel
446
+ | Parameter | Type | Description |
447
+ | :-------- | :------- | :------------------------- |
448
+ | `id` | `number` | The id for the requested model.|
449
+ | `guid` | `string` | Current website guid.|
450
+
451
+ Returns: A ```string``` response if a model is deleted.
452
+
453
+ ## Class PageMethods
454
+ This class is used to perform operations related to Pages. The following are the methods: -
455
+
456
+ ### getSitemap
457
+ | Parameter | Type | Description |
458
+ | :-------- | :------- | :------------------------- |
459
+ | `guid` | `string` | Current website guid.|
460
+ | `locale` | `string` | Current website locale.|
461
+ Returns: A collection object of ```Sitemap``` class.
462
+
463
+ ### getPageTemplates
464
+ | Parameter | Type | Description |
465
+ | :-------- | :------- | :------------------------- |
466
+ | `guid` | `string` | Current website guid.|
467
+ | `locale` | `string` | Current website locale.|
468
+ | `includeModuleZones` | `boolean` | To include zones in the result set.|
469
+ | `searchFilter` | `string` | To apply search criteria on the requested page template.|
470
+ Returns: A collection object of ```PageModel``` class.
471
+
472
+ ### getPageTemplate
473
+ | Parameter | Type | Description |
474
+ | :-------- | :------- | :------------------------- |
475
+ | `guid` | `string` | Current website guid.|
476
+ | `locale` | `string` | Current website locale.|
477
+ | `pageTemplateId` | `number` | The pageTemplateId of the requested page template.|
478
+ Returns: An object of ```PageModel``` class.
479
+
480
+ ### getPageTemplateName
481
+ | Parameter | Type | Description |
482
+ | :-------- | :------- | :------------------------- |
483
+ | `guid` | `string` | Current website guid.|
484
+ | `locale` | `string` | Current website locale.|
485
+ | `templateName` | `string` | The templateName of the requested page template.|
486
+ Returns: An object of ```PageModel``` class.
487
+
488
+ ### deletePageTemplate
489
+ | Parameter | Type | Description |
490
+ | :-------- | :------- | :------------------------- |
491
+ | `guid` | `string` | Current website guid.|
492
+ | `locale` | `string` | Current website locale.|
493
+ | `pageTemplateId` | `string` | The pageTemplateId of the requested page template.|
494
+
495
+ ### getPageItemTemplates
496
+ | Parameter | Type | Description |
497
+ | :-------- | :------- | :------------------------- |
498
+ | `guid` | `string` | Current website guid.|
499
+ | `locale` | `string` | Current website locale.|
500
+ | `id` | `number` | The id of the requested page template.|
501
+ Returns: A collection of ```ContentSectionDefinition``` class.
502
+
503
+ ### savePageTemplate
504
+ | Parameter | Type | Description |
505
+ | :-------- | :------- | :------------------------- |
506
+ | `guid` | `string` | Current website guid.|
507
+ | `locale` | `string` | Current website locale.|
508
+ | `pageModel` | `PageModel` | The pageModel object of the requested page template.|
509
+ Returns: An object of ```PageModel``` class.
510
+
511
+ ### getPage
512
+ | Parameter | Type | Description |
513
+ | :-------- | :------- | :------------------------- |
514
+ | `pageID` | `number` | The id of the requested page.|
515
+ | `guid` | `string` | Current website guid.|
516
+ | `locale` | `string` | Current website locale.|
517
+
518
+ Returns: An object of ```PageItem``` class.
519
+
520
+ ### publishPage
521
+ | Parameter | Type | Description |
522
+ | :-------- | :------- | :------------------------- |
523
+ | `pageID` | `number` | The pageID of the requested page.|
524
+ | `guid` | `string` | Current website guid.|
525
+ | `locale` | `string` | Current website locale.|
526
+ | `comments` | `string` | Additional comments for a batch request.|
527
+
528
+ Returns: An array of ```pageID``` of the requested page.
529
+
530
+ ### unPublishPage
531
+ | Parameter | Type | Description |
532
+ | :-------- | :------- | :------------------------- |
533
+ | `pageID` | `number` | The pageID of the requested page.|
534
+ | `guid` | `string` | Current website guid.|
535
+ | `locale` | `string` | Current website locale.|
536
+ | `comments` | `string` | Additional comments for a batch request.|
537
+
538
+ Returns: An array of ```pageID``` of the requested page.
539
+
540
+ ### deletePage
541
+ | Parameter | Type | Description |
542
+ | :-------- | :------- | :------------------------- |
543
+ | `pageID` | `number` | The pageID of the requested page.|
544
+ | `guid` | `string` | Current website guid.|
545
+ | `locale` | `string` | Current website locale.|
546
+ | `comments` | `string` | Additional comments for a batch request.|
547
+
548
+ Returns: An array of ```pageID``` of the requested page.
549
+
550
+ ### approvePage
551
+ | Parameter | Type | Description |
552
+ | :-------- | :------- | :------------------------- |
553
+ | `pageID` | `number` | The pageID of the requested page.|
554
+ | `guid` | `string` | Current website guid.|
555
+ | `locale` | `string` | Current website locale.|
556
+ | `comments` | `string` | Additional comments for a batch request.|
557
+
558
+ Returns: An array of ```pageID``` of the requested page.
559
+
560
+ ### declinePage
561
+ | Parameter | Type | Description |
562
+ | :-------- | :------- | :------------------------- |
563
+ | `pageID` | `number` | The pageID of the requested page.|
564
+ | `guid` | `string` | Current website guid.|
565
+ | `locale` | `string` | Current website locale.|
566
+ | `comments` | `string` | Additional comments for a batch request.|
567
+
568
+ Returns: An array of ```pageID``` of the requested page.
569
+
570
+ ### pageRequestApproval
571
+ | Parameter | Type | Description |
572
+ | :-------- | :------- | :------------------------- |
573
+ | `pageID` | `number` | The pageID of the requested page.|
574
+ | `guid` | `string` | Current website guid.|
575
+ | `locale` | `string` | Current website locale.|
576
+ | `comments` | `string` | Additional comments for a batch request.|
577
+
578
+ Returns: An array of ```pageID``` of the requested page.
579
+
580
+ ### savePage
581
+ | Parameter | Type | Description |
582
+ | :-------- | :------- | :------------------------- |
583
+ | `pageItem` | `PageItem` | The object of PageItem class for the requested Page.|
584
+ | `guid` | `string` | Current website guid.|
585
+ | `locale` | `string` | Current website locale.|
586
+ | `parentPageID` | `number` | The id of the parent page.|
587
+ | `placeBeforePageItemID` | `number` | The id of the page before the page.|
588
+
589
+ Returns: An array of ```pageID``` of the requested page.
590
+
591
+ ### getPageHistory
592
+ | Parameter | Type | Description |
593
+ | :-------- | :------- | :------------------------- |
594
+ | `locale` | `string` | Current website locale.|
595
+ | `guid` | `string` | Current website guid.|
596
+ | `pageID` | `number` | The pageID of the requested page.|
597
+ | `take` | `number` | The number of items per record set default value 50.|
598
+ | `skip` | `number` | The skip level on the record set default value 0.|
599
+
600
+ Returns: An object of ```PageHistory``` class of the requested page history.
601
+
602
+ ### getPageComments
603
+ | Parameter | Type | Description |
604
+ | :-------- | :------- | :------------------------- |
605
+ | `locale` | `string` | Current website locale.|
606
+ | `guid` | `string` | Current website guid.|
607
+ | `pageID` | `number` | The pageID of the requested page.|
608
+ | `take` | `number` | The number of items per record set default value 50.|
609
+ | `skip` | `number` | The skip level on the record set default value 0.|
610
+
611
+ Returns: An object of ```ItemComments``` class of the requested page comments.
612
+
613
+ ## Class ServerUserMethods
614
+ This class is used to perform operations related to Server User. The following are the methods: -
615
+
616
+ ### me
617
+ | Parameter | Type | Description |
618
+ | :-------- | :------- | :------------------------- |
619
+ | `guid` | `string` | Current website guid.|
620
+
621
+ Returns: An object of ```ServerUser``` class of the requested user.
622
+
623
+ ### you
624
+ | Parameter | Type | Description |
625
+ | :-------- | :------- | :------------------------- |
626
+ | `guid` | `string` | Current website guid.|
627
+ | `serverUserID` | `number` | Current website guid.|
628
+
629
+ Returns: An object of ```ServerUser``` class of the requested user.
630
+
631
+ ## Class WebhookMethods
632
+ This class is used to perform operations related to Webhooks in the agility instance. The following are the methods: -
633
+
634
+ ### webhookList
635
+ | Parameter | Type | Description |
636
+ | :-------- | :------- | :------------------------- |
637
+ | `guid` | `string` | Current website guid.|
638
+ | `take` | `number` | The number of items per record set default value 20.|
639
+ | `skip` | `number` | The skip level on the record set default value 0.|
640
+
641
+ Returns: A list of webhooks configured in the instance.
642
+
643
+ ### saveWebhook
644
+ | Parameter | Type | Description |
645
+ | :-------- | :------- | :------------------------- |
646
+ | `guid` | `string` | Current website guid.|
647
+ | `webhook` | `Webhook` | An object of Webhook type with the webhook data.|
648
+
649
+ Returns: An object with the created Webhook.
650
+
651
+ ### getWebhook
652
+ | Parameter | Type | Description |
653
+ | :-------- | :------- | :------------------------- |
654
+ | `guid` | `string` | Current website guid.|
655
+ | `webhookID` | `string` | The webhookID of the requested webhook.|
656
+
657
+ Returns: An object with the requested Webhook.
658
+
659
+ ### deleteWebhook
660
+ | Parameter | Type | Description |
661
+ | :-------- | :------- | :------------------------- |
662
+ | `guid` | `string` | Current website guid.|
663
+ | `webhookID` | `string` | The webhookID of the requested webhook.|
664
+
665
+
666
+ ## Running the SDK Locally
667
+
668
+ - `npm run clean`
669
+ - `npm run prepare`
670
+ - `npm run build`
671
+
672
+ ## How It Works
673
+
674
+ - [How Pages Work](https://help.agilitycms.com/hc/en-us/articles/4404222849677)
675
+ - [How Page Modules Work](https://help.agilitycms.com/hc/en-us/articles/4404222989453)
676
+ - [How Page Templates Work](https://help.agilitycms.com/hc/en-us/articles/4404229108877)
677
+
678
+ ## Resources
679
+
680
+ ### Agility CMS
681
+
682
+ - [Official site](https://agilitycms.com)
683
+ - [Documentation](https://help.agilitycms.com/hc/en-us)
684
+
685
+ ### Community
686
+
687
+ - [Official Slack](https://join.slack.com/t/agilitycommunity/shared_invite/enQtNzI2NDc3MzU4Njc2LWI2OTNjZTI3ZGY1NWRiNTYzNmEyNmI0MGZlZTRkYzI3NmRjNzkxYmI5YTZjNTg2ZTk4NGUzNjg5NzY3OWViZGI)
688
+ - [Blog](https://agilitycms.com/resources/posts)
689
+ - [GitHub](https://github.com/agility)
690
+ - [Forums](https://help.agilitycms.com/hc/en-us/community/topics)
691
+ - [Facebook](https://www.facebook.com/AgilityCMS/)
692
+ - [Twitter](https://twitter.com/AgilityCMS)
693
+
694
+ ## Feedback and Questions
695
+
681
696
  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).