@agility/management-sdk 0.1.35 → 0.1.37

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 (261) hide show
  1. package/README.md +371 -317
  2. package/dist/apiMethods/clientInstance.d.ts +2 -0
  3. package/dist/apiMethods/clientInstance.js +11 -2
  4. package/dist/apiMethods/containerMethods.d.ts +3 -0
  5. package/dist/apiMethods/containerMethods.js +43 -9
  6. package/dist/apiMethods/contentMethods.d.ts +12 -0
  7. package/dist/apiMethods/contentMethods.js +119 -48
  8. package/dist/apiMethods/pageMethods.d.ts +12 -0
  9. package/dist/apiMethods/pageMethods.js +88 -34
  10. package/dist/enums/contentViewType.d.ts +6 -0
  11. package/dist/enums/contentViewType.js +10 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +2 -0
  14. package/dist/models/pagedResult.d.ts +4 -0
  15. package/dist/models/pagedResult.js +2 -0
  16. package/dist/util/queryString.d.ts +8 -0
  17. package/dist/util/queryString.js +27 -0
  18. package/docs/asset-methods.md +381 -381
  19. package/docs/auth-component.md +360 -360
  20. package/docs/auth.md +593 -593
  21. package/docs/batch-methods.md +243 -243
  22. package/docs/cicd.md +606 -606
  23. package/docs/container-methods.md +267 -267
  24. package/docs/content-methods.md +491 -422
  25. package/docs/instance-methods.md +104 -104
  26. package/docs/instance-user-methods.md +230 -230
  27. package/docs/model-methods.md +433 -433
  28. package/docs/multi-instance-operations.md +191 -191
  29. package/docs/page-methods.md +737 -670
  30. package/docs/server-user-methods.md +279 -279
  31. package/docs/webhook-methods.md +451 -451
  32. package/license.txt +20 -20
  33. package/package.json +40 -40
  34. package/tsconfig.json +14 -14
  35. package/.cursor/api-coverage.md +0 -217
  36. package/.cursor/api-documentation-manifest.md +0 -275
  37. package/.cursor/api-functions-analysis.md +0 -111
  38. package/.cursor/breakout-manifest.md +0 -278
  39. package/.cursor/docs-final-check.md +0 -269
  40. package/.cursor/github-actions-improvements.md +0 -76
  41. package/.cursor/hardening.md +0 -271
  42. package/.cursor/linting-fix.md +0 -160
  43. package/.cursor/manifest.md +0 -243
  44. package/.cursor/mocks.md +0 -100
  45. package/.cursor/test-coverage.md +0 -841
  46. package/.env +0 -92
  47. package/coverage/base.css +0 -224
  48. package/coverage/block-navigation.js +0 -87
  49. package/coverage/coverage-summary.json +0 -43
  50. package/coverage/favicon.png +0 -0
  51. package/coverage/index.html +0 -161
  52. package/coverage/lcov-report/base.css +0 -224
  53. package/coverage/lcov-report/block-navigation.js +0 -87
  54. package/coverage/lcov-report/favicon.png +0 -0
  55. package/coverage/lcov-report/index.html +0 -161
  56. package/coverage/lcov-report/prettify.css +0 -1
  57. package/coverage/lcov-report/prettify.js +0 -2
  58. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  59. package/coverage/lcov-report/sorter.js +0 -210
  60. package/coverage/lcov-report/src/apiClient.ts.html +0 -199
  61. package/coverage/lcov-report/src/apiMethods/assetMethods.ts.html +0 -682
  62. package/coverage/lcov-report/src/apiMethods/batchMethods.ts.html +0 -736
  63. package/coverage/lcov-report/src/apiMethods/clientInstance.ts.html +0 -403
  64. package/coverage/lcov-report/src/apiMethods/containerMethods.ts.html +0 -460
  65. package/coverage/lcov-report/src/apiMethods/contentMethods.ts.html +0 -1183
  66. package/coverage/lcov-report/src/apiMethods/index.html +0 -266
  67. package/coverage/lcov-report/src/apiMethods/instanceMethods.ts.html +0 -160
  68. package/coverage/lcov-report/src/apiMethods/instanceUserMethods.ts.html +0 -268
  69. package/coverage/lcov-report/src/apiMethods/modelMethods.ts.html +0 -352
  70. package/coverage/lcov-report/src/apiMethods/pageMethods.ts.html +0 -1276
  71. package/coverage/lcov-report/src/apiMethods/serverUserMethods.ts.html +0 -196
  72. package/coverage/lcov-report/src/apiMethods/webhookMethods.ts.html +0 -271
  73. package/coverage/lcov-report/src/enums/batchItemType.ts.html +0 -106
  74. package/coverage/lcov-report/src/enums/batchOperationType.ts.html +0 -142
  75. package/coverage/lcov-report/src/enums/batchState..ts.html +0 -106
  76. package/coverage/lcov-report/src/enums/index.html +0 -161
  77. package/coverage/lcov-report/src/enums/workflowOperationType.ts.html +0 -175
  78. package/coverage/lcov-report/src/index.html +0 -116
  79. package/coverage/lcov-report/src/models/assetContainer.ts.html +0 -106
  80. package/coverage/lcov-report/src/models/assetGalleries.ts.html +0 -103
  81. package/coverage/lcov-report/src/models/assetMediaGrouping.ts.html +0 -136
  82. package/coverage/lcov-report/src/models/assetMediaGroupingMetaData.ts.html +0 -97
  83. package/coverage/lcov-report/src/models/batch.ts.html +0 -178
  84. package/coverage/lcov-report/src/models/batchItem.ts.html +0 -127
  85. package/coverage/lcov-report/src/models/container.ts.html +0 -232
  86. package/coverage/lcov-report/src/models/contentDefinitionTypeID.ts.html +0 -142
  87. package/coverage/lcov-report/src/models/contentItem.ts.html +0 -202
  88. package/coverage/lcov-report/src/models/contentSectionDefaultModule.ts.html +0 -106
  89. package/coverage/lcov-report/src/models/contentSectionDefinition.ts.html +0 -196
  90. package/coverage/lcov-report/src/models/contentViewColumn.ts.html +0 -109
  91. package/coverage/lcov-report/src/models/exception.ts.html +0 -109
  92. package/coverage/lcov-report/src/models/index.html +0 -476
  93. package/coverage/lcov-report/src/models/instanceRole.ts.html +0 -106
  94. package/coverage/lcov-report/src/models/instanceUser.ts.html +0 -130
  95. package/coverage/lcov-report/src/models/locales.ts.html +0 -100
  96. package/coverage/lcov-report/src/models/media.ts.html +0 -178
  97. package/coverage/lcov-report/src/models/model.ts.html +0 -172
  98. package/coverage/lcov-report/src/models/notification.ts.html +0 -124
  99. package/coverage/lcov-report/src/models/options.ts.html +0 -109
  100. package/coverage/lcov-report/src/models/pageItem.ts.html +0 -268
  101. package/coverage/lcov-report/src/models/pageModel.ts.html +0 -130
  102. package/coverage/lcov-report/src/models/sharedModule.ts.html +0 -106
  103. package/coverage/lcov-report/src/models/sitemap.ts.html +0 -148
  104. package/coverage/lcov-report/src/models/websiteUser.ts.html +0 -157
  105. package/coverage/lcov.info +0 -1459
  106. package/coverage/prettify.css +0 -1
  107. package/coverage/prettify.js +0 -2
  108. package/coverage/sort-arrow-sprite.png +0 -0
  109. package/coverage/sorter.js +0 -210
  110. package/coverage/src/apiClient.ts.html +0 -199
  111. package/coverage/src/apiMethods/assetMethods.ts.html +0 -682
  112. package/coverage/src/apiMethods/batchMethods.ts.html +0 -736
  113. package/coverage/src/apiMethods/clientInstance.ts.html +0 -403
  114. package/coverage/src/apiMethods/containerMethods.ts.html +0 -460
  115. package/coverage/src/apiMethods/contentMethods.ts.html +0 -1183
  116. package/coverage/src/apiMethods/index.html +0 -266
  117. package/coverage/src/apiMethods/instanceMethods.ts.html +0 -160
  118. package/coverage/src/apiMethods/instanceUserMethods.ts.html +0 -268
  119. package/coverage/src/apiMethods/modelMethods.ts.html +0 -352
  120. package/coverage/src/apiMethods/pageMethods.ts.html +0 -1276
  121. package/coverage/src/apiMethods/serverUserMethods.ts.html +0 -196
  122. package/coverage/src/apiMethods/webhookMethods.ts.html +0 -271
  123. package/coverage/src/enums/batchItemType.ts.html +0 -106
  124. package/coverage/src/enums/batchOperationType.ts.html +0 -142
  125. package/coverage/src/enums/batchState..ts.html +0 -106
  126. package/coverage/src/enums/index.html +0 -161
  127. package/coverage/src/enums/workflowOperationType.ts.html +0 -175
  128. package/coverage/src/index.html +0 -116
  129. package/coverage/src/models/assetContainer.ts.html +0 -106
  130. package/coverage/src/models/assetGalleries.ts.html +0 -103
  131. package/coverage/src/models/assetMediaGrouping.ts.html +0 -136
  132. package/coverage/src/models/assetMediaGroupingMetaData.ts.html +0 -97
  133. package/coverage/src/models/batch.ts.html +0 -178
  134. package/coverage/src/models/batchItem.ts.html +0 -127
  135. package/coverage/src/models/container.ts.html +0 -232
  136. package/coverage/src/models/contentDefinitionTypeID.ts.html +0 -142
  137. package/coverage/src/models/contentItem.ts.html +0 -202
  138. package/coverage/src/models/contentSectionDefaultModule.ts.html +0 -106
  139. package/coverage/src/models/contentSectionDefinition.ts.html +0 -196
  140. package/coverage/src/models/contentViewColumn.ts.html +0 -109
  141. package/coverage/src/models/exception.ts.html +0 -109
  142. package/coverage/src/models/index.html +0 -476
  143. package/coverage/src/models/instanceRole.ts.html +0 -106
  144. package/coverage/src/models/instanceUser.ts.html +0 -130
  145. package/coverage/src/models/locales.ts.html +0 -100
  146. package/coverage/src/models/media.ts.html +0 -178
  147. package/coverage/src/models/model.ts.html +0 -172
  148. package/coverage/src/models/notification.ts.html +0 -124
  149. package/coverage/src/models/options.ts.html +0 -109
  150. package/coverage/src/models/pageItem.ts.html +0 -268
  151. package/coverage/src/models/pageModel.ts.html +0 -130
  152. package/coverage/src/models/sharedModule.ts.html +0 -106
  153. package/coverage/src/models/sitemap.ts.html +0 -148
  154. package/coverage/src/models/websiteUser.ts.html +0 -157
  155. package/dist/.tsbuildinfo +0 -1
  156. package/dist/apiClient.d.ts.map +0 -1
  157. package/dist/apiClient.js.map +0 -1
  158. package/dist/apiMethods/assetMethods.d.ts.map +0 -1
  159. package/dist/apiMethods/assetMethods.js.map +0 -1
  160. package/dist/apiMethods/batchMethods.d.ts.map +0 -1
  161. package/dist/apiMethods/batchMethods.js.map +0 -1
  162. package/dist/apiMethods/clientInstance.d.ts.map +0 -1
  163. package/dist/apiMethods/clientInstance.js.map +0 -1
  164. package/dist/apiMethods/containerMethods.d.ts.map +0 -1
  165. package/dist/apiMethods/containerMethods.js.map +0 -1
  166. package/dist/apiMethods/contentMethods.d.ts.map +0 -1
  167. package/dist/apiMethods/contentMethods.js.map +0 -1
  168. package/dist/apiMethods/instanceMethods.d.ts.map +0 -1
  169. package/dist/apiMethods/instanceMethods.js.map +0 -1
  170. package/dist/apiMethods/instanceUserMethods.d.ts.map +0 -1
  171. package/dist/apiMethods/instanceUserMethods.js.map +0 -1
  172. package/dist/apiMethods/modelMethods.d.ts.map +0 -1
  173. package/dist/apiMethods/modelMethods.js.map +0 -1
  174. package/dist/apiMethods/pageMethods.d.ts.map +0 -1
  175. package/dist/apiMethods/pageMethods.js.map +0 -1
  176. package/dist/apiMethods/serverUserMethods.d.ts.map +0 -1
  177. package/dist/apiMethods/serverUserMethods.js.map +0 -1
  178. package/dist/apiMethods/webhookMethods.d.ts.map +0 -1
  179. package/dist/apiMethods/webhookMethods.js.map +0 -1
  180. package/dist/enums/assetGroupingType.d.ts.map +0 -1
  181. package/dist/enums/assetGroupingType.js.map +0 -1
  182. package/dist/enums/batchItemType.d.ts.map +0 -1
  183. package/dist/enums/batchItemType.js.map +0 -1
  184. package/dist/enums/batchOperationType.d.ts.map +0 -1
  185. package/dist/enums/batchOperationType.js.map +0 -1
  186. package/dist/enums/batchState..d.ts.map +0 -1
  187. package/dist/enums/batchState..js.map +0 -1
  188. package/dist/enums/pageItemTemplateType.d.ts.map +0 -1
  189. package/dist/enums/pageItemTemplateType.js.map +0 -1
  190. package/dist/enums/workflowOperationType.d.ts.map +0 -1
  191. package/dist/enums/workflowOperationType.js.map +0 -1
  192. package/dist/index.d.ts.map +0 -1
  193. package/dist/index.js.map +0 -1
  194. package/dist/models/assetContainer.d.ts.map +0 -1
  195. package/dist/models/assetContainer.js.map +0 -1
  196. package/dist/models/assetGalleries.d.ts.map +0 -1
  197. package/dist/models/assetGalleries.js.map +0 -1
  198. package/dist/models/assetMediaGrouping.d.ts.map +0 -1
  199. package/dist/models/assetMediaGrouping.js.map +0 -1
  200. package/dist/models/assetMediaGroupingMetaData.d.ts.map +0 -1
  201. package/dist/models/assetMediaGroupingMetaData.js.map +0 -1
  202. package/dist/models/batch.d.ts.map +0 -1
  203. package/dist/models/batch.js.map +0 -1
  204. package/dist/models/batchItem.d.ts.map +0 -1
  205. package/dist/models/batchItem.js.map +0 -1
  206. package/dist/models/batchTypes.d.ts.map +0 -1
  207. package/dist/models/batchTypes.js.map +0 -1
  208. package/dist/models/container.d.ts.map +0 -1
  209. package/dist/models/container.js.map +0 -1
  210. package/dist/models/contentDefinitionTypeID.d.ts.map +0 -1
  211. package/dist/models/contentDefinitionTypeID.js.map +0 -1
  212. package/dist/models/contentItem.d.ts.map +0 -1
  213. package/dist/models/contentItem.js.map +0 -1
  214. package/dist/models/contentItemHistory.d.ts.map +0 -1
  215. package/dist/models/contentItemHistory.js.map +0 -1
  216. package/dist/models/contentListFilterModel.d.ts.map +0 -1
  217. package/dist/models/contentListFilterModel.js.map +0 -1
  218. package/dist/models/contentSectionDefaultModule.d.ts.map +0 -1
  219. package/dist/models/contentSectionDefaultModule.js.map +0 -1
  220. package/dist/models/contentSectionDefinition.d.ts.map +0 -1
  221. package/dist/models/contentSectionDefinition.js.map +0 -1
  222. package/dist/models/contentViewColumn.d.ts.map +0 -1
  223. package/dist/models/contentViewColumn.js.map +0 -1
  224. package/dist/models/exception.d.ts.map +0 -1
  225. package/dist/models/exception.js.map +0 -1
  226. package/dist/models/instanceRole.d.ts.map +0 -1
  227. package/dist/models/instanceRole.js.map +0 -1
  228. package/dist/models/instanceUser.d.ts.map +0 -1
  229. package/dist/models/instanceUser.js.map +0 -1
  230. package/dist/models/itemComments.d.ts.map +0 -1
  231. package/dist/models/itemComments.js.map +0 -1
  232. package/dist/models/listParams.d.ts.map +0 -1
  233. package/dist/models/listParams.js.map +0 -1
  234. package/dist/models/locales.d.ts.map +0 -1
  235. package/dist/models/locales.js.map +0 -1
  236. package/dist/models/media.d.ts.map +0 -1
  237. package/dist/models/media.js.map +0 -1
  238. package/dist/models/model.d.ts.map +0 -1
  239. package/dist/models/model.js.map +0 -1
  240. package/dist/models/notification.d.ts.map +0 -1
  241. package/dist/models/notification.js.map +0 -1
  242. package/dist/models/options.d.ts.map +0 -1
  243. package/dist/models/options.js.map +0 -1
  244. package/dist/models/pageHistory.d.ts.map +0 -1
  245. package/dist/models/pageHistory.js.map +0 -1
  246. package/dist/models/pageItem.d.ts.map +0 -1
  247. package/dist/models/pageItem.js.map +0 -1
  248. package/dist/models/pageModel.d.ts.map +0 -1
  249. package/dist/models/pageModel.js.map +0 -1
  250. package/dist/models/serverUser.d.ts.map +0 -1
  251. package/dist/models/serverUser.js.map +0 -1
  252. package/dist/models/sharedModule.d.ts.map +0 -1
  253. package/dist/models/sharedModule.js.map +0 -1
  254. package/dist/models/sitemap.d.ts.map +0 -1
  255. package/dist/models/sitemap.js.map +0 -1
  256. package/dist/models/webhook.d.ts.map +0 -1
  257. package/dist/models/webhook.js.map +0 -1
  258. package/dist/models/websiteListing.d.ts.map +0 -1
  259. package/dist/models/websiteListing.js.map +0 -1
  260. package/dist/models/websiteUser.d.ts.map +0 -1
  261. package/dist/models/websiteUser.js.map +0 -1
@@ -1,268 +1,268 @@
1
- # Agility CMS & Management API TypeScript SDK
2
-
3
- ## ContainerMethods
4
-
5
- This class provides comprehensive container management operations for organizing and managing content within Agility CMS. Containers are used to group related content items and control access permissions.
6
-
7
- **Important Notes:**
8
- - Containers organize content items by their definition types
9
- - Each container has security settings that control user access
10
- - Containers can have notification settings for workflow events
11
- - Reference names must be unique within the instance
12
- - Containers cannot be deleted if they contain content items
13
-
14
- ### Function List
15
- - [getContainerByID](#getcontainerbyid) - Retrieves a specific container by ID
16
- - [getContainersByModel](#getcontainersbymodel) - Retrieves containers associated with a content model
17
- - [getContainerByReferenceName](#getcontainerbyreferencename) - Retrieves a container by reference name
18
- - [getContainerSecurity](#getcontainersecurity) - Retrieves security settings for a container
19
- - [getContainerList](#getcontainerlist) - Retrieves list of all containers
20
- - [getNotificationList](#getnotificationlist) - Retrieves notification settings for a container
21
- - [saveContainer](#savecontainer) - Creates or updates a container
22
- - [deleteContainer](#deletecontainer) - Deletes a container by ID
23
-
24
- ---
25
-
26
- ### getContainerByID
27
-
28
- Retrieves a specific container by its unique ID.
29
-
30
- | Parameter | Type | Required | Description |
31
- |-----------|------|----------|-------------|
32
- | `id` | `number` | Yes | The container ID to retrieve |
33
- | `guid` | `string` | Yes | Current website GUID |
34
-
35
- **Returns:** `Container` - Container object with complete configuration
36
-
37
- **Usage Example:**
38
- ```typescript
39
- const container = await apiClient.containerMethods.getContainerByID(123, guid);
40
- console.log('Container name:', container.displayName);
41
- console.log('Reference name:', container.referenceName);
42
- console.log('Model ID:', container.modelId);
43
- ```
44
-
45
- **Error Handling:**
46
- - Throws `Exception` when container not found
47
-
48
- ### getContainersByModel
49
-
50
- Retrieves all containers associated with a specific content model.
51
-
52
- | Parameter | Type | Required | Description |
53
- |-----------|------|----------|-------------|
54
- | `modelId` | `number` | Yes | The content model ID |
55
- | `guid` | `string` | Yes | Current website GUID |
56
-
57
- **Returns:** `Container[]` - Array of containers using the specified model
58
-
59
- **Usage Example:**
60
- ```typescript
61
- const containers = await apiClient.containerMethods.getContainersByModel(456, guid);
62
- console.log(`Found ${containers.length} containers for this model`);
63
-
64
- // Process each container
65
- containers.forEach(container => {
66
- console.log(`Container: ${container.displayName} (${container.referenceName})`);
67
- });
68
- ```
69
-
70
- **Error Handling:**
71
- - Throws `Exception` when model not found or retrieval fails
72
-
73
- ### getContainerByReferenceName
74
-
75
- Retrieves a container by its reference name. Returns null if the container doesn't exist.
76
-
77
- | Parameter | Type | Required | Description |
78
- |-----------|------|----------|-------------|
79
- | `referenceName` | `string` | Yes | The reference name of the container |
80
- | `guid` | `string` | Yes | Current website GUID |
81
-
82
- **Returns:** `Container | null` - Container object or null if not found
83
-
84
- **Usage Example:**
85
- ```typescript
86
- const container = await apiClient.containerMethods.getContainerByReferenceName('blog-posts', guid);
87
- if (container) {
88
- console.log('Container found:', container.displayName);
89
- console.log('Container ID:', container.id);
90
- } else {
91
- console.log('Container not found');
92
- }
93
- ```
94
-
95
- **Error Handling:**
96
- - Returns `null` for 404 errors (container not found)
97
- - Throws `Exception` for other errors
98
-
99
- ### getContainerSecurity
100
-
101
- Retrieves the security settings for a specific container.
102
-
103
- | Parameter | Type | Required | Description |
104
- |-----------|------|----------|-------------|
105
- | `id` | `number` | Yes | The container ID |
106
- | `guid` | `string` | Yes | Current website GUID |
107
-
108
- **Returns:** `Container` - Container object with security information
109
-
110
- **Usage Example:**
111
- ```typescript
112
- const security = await apiClient.containerMethods.getContainerSecurity(123, guid);
113
- console.log('Security settings:', security.securitySettings);
114
-
115
- // Check if container has specific permissions
116
- if (security.securitySettings) {
117
- console.log('Container has custom security settings');
118
- } else {
119
- console.log('Container uses default security settings');
120
- }
121
- ```
122
-
123
- **Error Handling:**
124
- - Throws `Exception` when container not found or access denied
125
-
126
- ### getContainerList
127
-
128
- Retrieves a list of all containers in the current website.
129
-
130
- | Parameter | Type | Required | Description |
131
- |-----------|------|----------|-------------|
132
- | `guid` | `string` | Yes | Current website GUID |
133
-
134
- **Returns:** `Container[]` - Array of all containers
135
-
136
- **Usage Example:**
137
- ```typescript
138
- const containers = await apiClient.containerMethods.getContainerList(guid);
139
- console.log(`Total containers: ${containers.length}`);
140
-
141
- // Filter by content type
142
- const blogContainers = containers.filter(c => c.referenceName.includes('blog'));
143
- console.log(`Blog-related containers: ${blogContainers.length}`);
144
-
145
- // Group by model
146
- const containersByModel = containers.reduce((acc, container) => {
147
- const modelId = container.modelId;
148
- if (!acc[modelId]) acc[modelId] = [];
149
- acc[modelId].push(container);
150
- return acc;
151
- }, {});
152
- ```
153
-
154
- **Error Handling:**
155
- - Throws `Exception` when retrieval fails
156
-
157
- ### getNotificationList
158
-
159
- Retrieves the notification settings for a specific container.
160
-
161
- | Parameter | Type | Required | Description |
162
- |-----------|------|----------|-------------|
163
- | `id` | `number` | Yes | The container ID |
164
- | `guid` | `string` | Yes | Current website GUID |
165
-
166
- **Returns:** `Notification[]` - Array of notification configurations
167
-
168
- **Usage Example:**
169
- ```typescript
170
- const notifications = await apiClient.containerMethods.getNotificationList(123, guid);
171
- console.log(`Container has ${notifications.length} notification rules`);
172
-
173
- notifications.forEach(notification => {
174
- console.log(`Notification: ${notification.name}`);
175
- console.log(`Type: ${notification.type}`);
176
- console.log(`Recipients: ${notification.recipients}`);
177
- });
178
- ```
179
-
180
- **Error Handling:**
181
- - Throws `Exception` when container not found or access denied
182
-
183
- ### saveContainer
184
-
185
- Creates a new container or updates an existing one.
186
-
187
- | Parameter | Type | Required | Description |
188
- |-----------|------|----------|-------------|
189
- | `container` | `Container` | Yes | Container object to save |
190
- | `guid` | `string` | Yes | Current website GUID |
191
- | `forceReferenceName` | `boolean` | No | Force reference name validation *(Optional, default: false)* |
192
-
193
- **Returns:** `Container` - Saved container object with updated metadata
194
-
195
- **Usage Example:**
196
- ```typescript
197
- // Create a new container
198
- const newContainer = {
199
- referenceName: 'product-reviews',
200
- displayName: 'Product Reviews',
201
- modelId: 789,
202
- isPublicListing: true,
203
- description: 'Container for product review content items'
204
- };
205
-
206
- const savedContainer = await apiClient.containerMethods.saveContainer(
207
- newContainer,
208
- guid,
209
- true
210
- );
211
- console.log('Container saved with ID:', savedContainer.id);
212
-
213
- // Update existing container
214
- const existingContainer = await apiClient.containerMethods.getContainerByID(123, guid);
215
- existingContainer.displayName = 'Updated Display Name';
216
- const updatedContainer = await apiClient.containerMethods.saveContainer(existingContainer, guid);
217
- ```
218
-
219
- **Error Handling:**
220
- - Throws `Exception` when validation fails or save operation fails
221
-
222
- ### deleteContainer
223
-
224
- Deletes a container by its ID.
225
-
226
- | Parameter | Type | Required | Description |
227
- |-----------|------|----------|-------------|
228
- | `id` | `number` | Yes | The container ID to delete |
229
- | `guid` | `string` | Yes | Current website GUID |
230
-
231
- **Returns:** `string` - Confirmation message of successful deletion
232
-
233
- **Usage Example:**
234
- ```typescript
235
- try {
236
- const result = await apiClient.containerMethods.deleteContainer(123, guid);
237
- console.log(result); // "Container deleted successfully"
238
- } catch (error) {
239
- if (error.message.includes('contains content')) {
240
- console.log('Cannot delete container: still contains content items');
241
- // Handle by moving or deleting content first
242
- } else {
243
- console.error('Failed to delete container:', error.message);
244
- }
245
- }
246
- ```
247
-
248
- **Error Handling:**
249
- - Throws `Exception` when container not found, has content, or deletion fails
250
-
251
- **Note:** Containers cannot be deleted if they contain content items. Remove all content first.
252
-
253
- ---
254
-
255
- ## Navigation
256
- - [← Back to Main Documentation](../README.md)
257
- - [Authentication & Setup](./auth.md)
258
- - [CI/CD & Automated Environments](./cicd.md)
259
- - [AssetMethods](./asset-methods.md)
260
- - [BatchMethods](./batch-methods.md)
261
- - [ContentMethods](./content-methods.md)
262
- - [InstanceMethods](./instance-methods.md)
263
- - [InstanceUserMethods](./instance-user-methods.md)
264
- - [ModelMethods](./model-methods.md)
265
- - [PageMethods](./page-methods.md)
266
- - [ServerUserMethods](./server-user-methods.md)
267
- - [WebhookMethods](./webhook-methods.md)
1
+ # Agility CMS & Management API TypeScript SDK
2
+
3
+ ## ContainerMethods
4
+
5
+ This class provides comprehensive container management operations for organizing and managing content within Agility CMS. Containers are used to group related content items and control access permissions.
6
+
7
+ **Important Notes:**
8
+ - Containers organize content items by their definition types
9
+ - Each container has security settings that control user access
10
+ - Containers can have notification settings for workflow events
11
+ - Reference names must be unique within the instance
12
+ - Containers cannot be deleted if they contain content items
13
+
14
+ ### Function List
15
+ - [getContainerByID](#getcontainerbyid) - Retrieves a specific container by ID
16
+ - [getContainersByModel](#getcontainersbymodel) - Retrieves containers associated with a content model
17
+ - [getContainerByReferenceName](#getcontainerbyreferencename) - Retrieves a container by reference name
18
+ - [getContainerSecurity](#getcontainersecurity) - Retrieves security settings for a container
19
+ - [getContainerList](#getcontainerlist) - Retrieves list of all containers
20
+ - [getNotificationList](#getnotificationlist) - Retrieves notification settings for a container
21
+ - [saveContainer](#savecontainer) - Creates or updates a container
22
+ - [deleteContainer](#deletecontainer) - Deletes a container by ID
23
+
24
+ ---
25
+
26
+ ### getContainerByID
27
+
28
+ Retrieves a specific container by its unique ID.
29
+
30
+ | Parameter | Type | Required | Description |
31
+ |-----------|------|----------|-------------|
32
+ | `id` | `number` | Yes | The container ID to retrieve |
33
+ | `guid` | `string` | Yes | Current website GUID |
34
+
35
+ **Returns:** `Container` - Container object with complete configuration
36
+
37
+ **Usage Example:**
38
+ ```typescript
39
+ const container = await apiClient.containerMethods.getContainerByID(123, guid);
40
+ console.log('Container name:', container.displayName);
41
+ console.log('Reference name:', container.referenceName);
42
+ console.log('Model ID:', container.modelId);
43
+ ```
44
+
45
+ **Error Handling:**
46
+ - Throws `Exception` when container not found
47
+
48
+ ### getContainersByModel
49
+
50
+ Retrieves all containers associated with a specific content model.
51
+
52
+ | Parameter | Type | Required | Description |
53
+ |-----------|------|----------|-------------|
54
+ | `modelId` | `number` | Yes | The content model ID |
55
+ | `guid` | `string` | Yes | Current website GUID |
56
+
57
+ **Returns:** `Container[]` - Array of containers using the specified model
58
+
59
+ **Usage Example:**
60
+ ```typescript
61
+ const containers = await apiClient.containerMethods.getContainersByModel(456, guid);
62
+ console.log(`Found ${containers.length} containers for this model`);
63
+
64
+ // Process each container
65
+ containers.forEach(container => {
66
+ console.log(`Container: ${container.displayName} (${container.referenceName})`);
67
+ });
68
+ ```
69
+
70
+ **Error Handling:**
71
+ - Throws `Exception` when model not found or retrieval fails
72
+
73
+ ### getContainerByReferenceName
74
+
75
+ Retrieves a container by its reference name. Returns null if the container doesn't exist.
76
+
77
+ | Parameter | Type | Required | Description |
78
+ |-----------|------|----------|-------------|
79
+ | `referenceName` | `string` | Yes | The reference name of the container |
80
+ | `guid` | `string` | Yes | Current website GUID |
81
+
82
+ **Returns:** `Container | null` - Container object or null if not found
83
+
84
+ **Usage Example:**
85
+ ```typescript
86
+ const container = await apiClient.containerMethods.getContainerByReferenceName('blog-posts', guid);
87
+ if (container) {
88
+ console.log('Container found:', container.displayName);
89
+ console.log('Container ID:', container.id);
90
+ } else {
91
+ console.log('Container not found');
92
+ }
93
+ ```
94
+
95
+ **Error Handling:**
96
+ - Returns `null` for 404 errors (container not found)
97
+ - Throws `Exception` for other errors
98
+
99
+ ### getContainerSecurity
100
+
101
+ Retrieves the security settings for a specific container.
102
+
103
+ | Parameter | Type | Required | Description |
104
+ |-----------|------|----------|-------------|
105
+ | `id` | `number` | Yes | The container ID |
106
+ | `guid` | `string` | Yes | Current website GUID |
107
+
108
+ **Returns:** `Container` - Container object with security information
109
+
110
+ **Usage Example:**
111
+ ```typescript
112
+ const security = await apiClient.containerMethods.getContainerSecurity(123, guid);
113
+ console.log('Security settings:', security.securitySettings);
114
+
115
+ // Check if container has specific permissions
116
+ if (security.securitySettings) {
117
+ console.log('Container has custom security settings');
118
+ } else {
119
+ console.log('Container uses default security settings');
120
+ }
121
+ ```
122
+
123
+ **Error Handling:**
124
+ - Throws `Exception` when container not found or access denied
125
+
126
+ ### getContainerList
127
+
128
+ Retrieves a list of all containers in the current website.
129
+
130
+ | Parameter | Type | Required | Description |
131
+ |-----------|------|----------|-------------|
132
+ | `guid` | `string` | Yes | Current website GUID |
133
+
134
+ **Returns:** `Container[]` - Array of all containers
135
+
136
+ **Usage Example:**
137
+ ```typescript
138
+ const containers = await apiClient.containerMethods.getContainerList(guid);
139
+ console.log(`Total containers: ${containers.length}`);
140
+
141
+ // Filter by content type
142
+ const blogContainers = containers.filter(c => c.referenceName.includes('blog'));
143
+ console.log(`Blog-related containers: ${blogContainers.length}`);
144
+
145
+ // Group by model
146
+ const containersByModel = containers.reduce((acc, container) => {
147
+ const modelId = container.modelId;
148
+ if (!acc[modelId]) acc[modelId] = [];
149
+ acc[modelId].push(container);
150
+ return acc;
151
+ }, {});
152
+ ```
153
+
154
+ **Error Handling:**
155
+ - Throws `Exception` when retrieval fails
156
+
157
+ ### getNotificationList
158
+
159
+ Retrieves the notification settings for a specific container.
160
+
161
+ | Parameter | Type | Required | Description |
162
+ |-----------|------|----------|-------------|
163
+ | `id` | `number` | Yes | The container ID |
164
+ | `guid` | `string` | Yes | Current website GUID |
165
+
166
+ **Returns:** `Notification[]` - Array of notification configurations
167
+
168
+ **Usage Example:**
169
+ ```typescript
170
+ const notifications = await apiClient.containerMethods.getNotificationList(123, guid);
171
+ console.log(`Container has ${notifications.length} notification rules`);
172
+
173
+ notifications.forEach(notification => {
174
+ console.log(`Notification: ${notification.name}`);
175
+ console.log(`Type: ${notification.type}`);
176
+ console.log(`Recipients: ${notification.recipients}`);
177
+ });
178
+ ```
179
+
180
+ **Error Handling:**
181
+ - Throws `Exception` when container not found or access denied
182
+
183
+ ### saveContainer
184
+
185
+ Creates a new container or updates an existing one.
186
+
187
+ | Parameter | Type | Required | Description |
188
+ |-----------|------|----------|-------------|
189
+ | `container` | `Container` | Yes | Container object to save |
190
+ | `guid` | `string` | Yes | Current website GUID |
191
+ | `forceReferenceName` | `boolean` | No | Force reference name validation *(Optional, default: false)* |
192
+
193
+ **Returns:** `Container` - Saved container object with updated metadata
194
+
195
+ **Usage Example:**
196
+ ```typescript
197
+ // Create a new container
198
+ const newContainer = {
199
+ referenceName: 'product-reviews',
200
+ displayName: 'Product Reviews',
201
+ modelId: 789,
202
+ isPublicListing: true,
203
+ description: 'Container for product review content items'
204
+ };
205
+
206
+ const savedContainer = await apiClient.containerMethods.saveContainer(
207
+ newContainer,
208
+ guid,
209
+ true
210
+ );
211
+ console.log('Container saved with ID:', savedContainer.id);
212
+
213
+ // Update existing container
214
+ const existingContainer = await apiClient.containerMethods.getContainerByID(123, guid);
215
+ existingContainer.displayName = 'Updated Display Name';
216
+ const updatedContainer = await apiClient.containerMethods.saveContainer(existingContainer, guid);
217
+ ```
218
+
219
+ **Error Handling:**
220
+ - Throws `Exception` when validation fails or save operation fails
221
+
222
+ ### deleteContainer
223
+
224
+ Deletes a container by its ID.
225
+
226
+ | Parameter | Type | Required | Description |
227
+ |-----------|------|----------|-------------|
228
+ | `id` | `number` | Yes | The container ID to delete |
229
+ | `guid` | `string` | Yes | Current website GUID |
230
+
231
+ **Returns:** `string` - Confirmation message of successful deletion
232
+
233
+ **Usage Example:**
234
+ ```typescript
235
+ try {
236
+ const result = await apiClient.containerMethods.deleteContainer(123, guid);
237
+ console.log(result); // "Container deleted successfully"
238
+ } catch (error) {
239
+ if (error.message.includes('contains content')) {
240
+ console.log('Cannot delete container: still contains content items');
241
+ // Handle by moving or deleting content first
242
+ } else {
243
+ console.error('Failed to delete container:', error.message);
244
+ }
245
+ }
246
+ ```
247
+
248
+ **Error Handling:**
249
+ - Throws `Exception` when container not found, has content, or deletion fails
250
+
251
+ **Note:** Containers cannot be deleted if they contain content items. Remove all content first.
252
+
253
+ ---
254
+
255
+ ## Navigation
256
+ - [← Back to Main Documentation](../README.md)
257
+ - [Authentication & Setup](./auth.md)
258
+ - [CI/CD & Automated Environments](./cicd.md)
259
+ - [AssetMethods](./asset-methods.md)
260
+ - [BatchMethods](./batch-methods.md)
261
+ - [ContentMethods](./content-methods.md)
262
+ - [InstanceMethods](./instance-methods.md)
263
+ - [InstanceUserMethods](./instance-user-methods.md)
264
+ - [ModelMethods](./model-methods.md)
265
+ - [PageMethods](./page-methods.md)
266
+ - [ServerUserMethods](./server-user-methods.md)
267
+ - [WebhookMethods](./webhook-methods.md)
268
268
  - [Multi-Instance Operations](./multi-instance-operations.md)