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