@agility/management-sdk 0.1.32 → 0.1.34

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 (265) hide show
  1. package/.cursor/api-coverage.md +217 -0
  2. package/.cursor/api-documentation-manifest.md +275 -0
  3. package/.cursor/api-functions-analysis.md +111 -0
  4. package/.cursor/breakout-manifest.md +278 -0
  5. package/.cursor/docs-final-check.md +269 -0
  6. package/.cursor/github-actions-improvements.md +76 -0
  7. package/.cursor/hardening.md +271 -0
  8. package/.cursor/linting-fix.md +160 -0
  9. package/.cursor/manifest.md +243 -0
  10. package/.cursor/mocks.md +100 -0
  11. package/.cursor/test-coverage.md +841 -0
  12. package/.env +92 -0
  13. package/README.md +87 -315
  14. package/coverage/base.css +224 -0
  15. package/coverage/block-navigation.js +87 -0
  16. package/coverage/coverage-summary.json +43 -0
  17. package/coverage/favicon.png +0 -0
  18. package/coverage/index.html +161 -0
  19. package/coverage/lcov-report/base.css +224 -0
  20. package/coverage/lcov-report/block-navigation.js +87 -0
  21. package/coverage/lcov-report/favicon.png +0 -0
  22. package/coverage/lcov-report/index.html +161 -0
  23. package/coverage/lcov-report/prettify.css +1 -0
  24. package/coverage/lcov-report/prettify.js +2 -0
  25. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  26. package/coverage/lcov-report/sorter.js +210 -0
  27. package/coverage/lcov-report/src/apiClient.ts.html +199 -0
  28. package/coverage/lcov-report/src/apiMethods/assetMethods.ts.html +682 -0
  29. package/coverage/lcov-report/src/apiMethods/batchMethods.ts.html +736 -0
  30. package/coverage/lcov-report/src/apiMethods/clientInstance.ts.html +403 -0
  31. package/coverage/lcov-report/src/apiMethods/containerMethods.ts.html +460 -0
  32. package/coverage/lcov-report/src/apiMethods/contentMethods.ts.html +1183 -0
  33. package/coverage/lcov-report/src/apiMethods/index.html +266 -0
  34. package/coverage/lcov-report/src/apiMethods/instanceMethods.ts.html +160 -0
  35. package/coverage/lcov-report/src/apiMethods/instanceUserMethods.ts.html +268 -0
  36. package/coverage/lcov-report/src/apiMethods/modelMethods.ts.html +352 -0
  37. package/coverage/lcov-report/src/apiMethods/pageMethods.ts.html +1276 -0
  38. package/coverage/lcov-report/src/apiMethods/serverUserMethods.ts.html +196 -0
  39. package/coverage/lcov-report/src/apiMethods/webhookMethods.ts.html +271 -0
  40. package/coverage/lcov-report/src/enums/batchItemType.ts.html +106 -0
  41. package/coverage/lcov-report/src/enums/batchOperationType.ts.html +142 -0
  42. package/coverage/lcov-report/src/enums/batchState..ts.html +106 -0
  43. package/coverage/lcov-report/src/enums/index.html +161 -0
  44. package/coverage/lcov-report/src/enums/workflowOperationType.ts.html +175 -0
  45. package/coverage/lcov-report/src/index.html +116 -0
  46. package/coverage/lcov-report/src/models/assetContainer.ts.html +106 -0
  47. package/coverage/lcov-report/src/models/assetGalleries.ts.html +103 -0
  48. package/coverage/lcov-report/src/models/assetMediaGrouping.ts.html +136 -0
  49. package/coverage/lcov-report/src/models/assetMediaGroupingMetaData.ts.html +97 -0
  50. package/coverage/lcov-report/src/models/batch.ts.html +178 -0
  51. package/coverage/lcov-report/src/models/batchItem.ts.html +127 -0
  52. package/coverage/lcov-report/src/models/container.ts.html +232 -0
  53. package/coverage/lcov-report/src/models/contentDefinitionTypeID.ts.html +142 -0
  54. package/coverage/lcov-report/src/models/contentItem.ts.html +202 -0
  55. package/coverage/lcov-report/src/models/contentSectionDefaultModule.ts.html +106 -0
  56. package/coverage/lcov-report/src/models/contentSectionDefinition.ts.html +196 -0
  57. package/coverage/lcov-report/src/models/contentViewColumn.ts.html +109 -0
  58. package/coverage/lcov-report/src/models/exception.ts.html +109 -0
  59. package/coverage/lcov-report/src/models/index.html +476 -0
  60. package/coverage/lcov-report/src/models/instanceRole.ts.html +106 -0
  61. package/coverage/lcov-report/src/models/instanceUser.ts.html +130 -0
  62. package/coverage/lcov-report/src/models/locales.ts.html +100 -0
  63. package/coverage/lcov-report/src/models/media.ts.html +178 -0
  64. package/coverage/lcov-report/src/models/model.ts.html +172 -0
  65. package/coverage/lcov-report/src/models/notification.ts.html +124 -0
  66. package/coverage/lcov-report/src/models/options.ts.html +109 -0
  67. package/coverage/lcov-report/src/models/pageItem.ts.html +268 -0
  68. package/coverage/lcov-report/src/models/pageModel.ts.html +130 -0
  69. package/coverage/lcov-report/src/models/sharedModule.ts.html +106 -0
  70. package/coverage/lcov-report/src/models/sitemap.ts.html +148 -0
  71. package/coverage/lcov-report/src/models/websiteUser.ts.html +157 -0
  72. package/coverage/lcov.info +1459 -0
  73. package/coverage/prettify.css +1 -0
  74. package/coverage/prettify.js +2 -0
  75. package/coverage/sort-arrow-sprite.png +0 -0
  76. package/coverage/sorter.js +210 -0
  77. package/coverage/src/apiClient.ts.html +199 -0
  78. package/coverage/src/apiMethods/assetMethods.ts.html +682 -0
  79. package/coverage/src/apiMethods/batchMethods.ts.html +736 -0
  80. package/coverage/src/apiMethods/clientInstance.ts.html +403 -0
  81. package/coverage/src/apiMethods/containerMethods.ts.html +460 -0
  82. package/coverage/src/apiMethods/contentMethods.ts.html +1183 -0
  83. package/coverage/src/apiMethods/index.html +266 -0
  84. package/coverage/src/apiMethods/instanceMethods.ts.html +160 -0
  85. package/coverage/src/apiMethods/instanceUserMethods.ts.html +268 -0
  86. package/coverage/src/apiMethods/modelMethods.ts.html +352 -0
  87. package/coverage/src/apiMethods/pageMethods.ts.html +1276 -0
  88. package/coverage/src/apiMethods/serverUserMethods.ts.html +196 -0
  89. package/coverage/src/apiMethods/webhookMethods.ts.html +271 -0
  90. package/coverage/src/enums/batchItemType.ts.html +106 -0
  91. package/coverage/src/enums/batchOperationType.ts.html +142 -0
  92. package/coverage/src/enums/batchState..ts.html +106 -0
  93. package/coverage/src/enums/index.html +161 -0
  94. package/coverage/src/enums/workflowOperationType.ts.html +175 -0
  95. package/coverage/src/index.html +116 -0
  96. package/coverage/src/models/assetContainer.ts.html +106 -0
  97. package/coverage/src/models/assetGalleries.ts.html +103 -0
  98. package/coverage/src/models/assetMediaGrouping.ts.html +136 -0
  99. package/coverage/src/models/assetMediaGroupingMetaData.ts.html +97 -0
  100. package/coverage/src/models/batch.ts.html +178 -0
  101. package/coverage/src/models/batchItem.ts.html +127 -0
  102. package/coverage/src/models/container.ts.html +232 -0
  103. package/coverage/src/models/contentDefinitionTypeID.ts.html +142 -0
  104. package/coverage/src/models/contentItem.ts.html +202 -0
  105. package/coverage/src/models/contentSectionDefaultModule.ts.html +106 -0
  106. package/coverage/src/models/contentSectionDefinition.ts.html +196 -0
  107. package/coverage/src/models/contentViewColumn.ts.html +109 -0
  108. package/coverage/src/models/exception.ts.html +109 -0
  109. package/coverage/src/models/index.html +476 -0
  110. package/coverage/src/models/instanceRole.ts.html +106 -0
  111. package/coverage/src/models/instanceUser.ts.html +130 -0
  112. package/coverage/src/models/locales.ts.html +100 -0
  113. package/coverage/src/models/media.ts.html +178 -0
  114. package/coverage/src/models/model.ts.html +172 -0
  115. package/coverage/src/models/notification.ts.html +124 -0
  116. package/coverage/src/models/options.ts.html +109 -0
  117. package/coverage/src/models/pageItem.ts.html +268 -0
  118. package/coverage/src/models/pageModel.ts.html +130 -0
  119. package/coverage/src/models/sharedModule.ts.html +106 -0
  120. package/coverage/src/models/sitemap.ts.html +148 -0
  121. package/coverage/src/models/websiteUser.ts.html +157 -0
  122. package/dist/.tsbuildinfo +1 -0
  123. package/dist/apiClient.d.ts.map +1 -0
  124. package/dist/apiClient.js.map +1 -0
  125. package/dist/apiMethods/assetMethods.d.ts.map +1 -0
  126. package/dist/apiMethods/assetMethods.js +38 -38
  127. package/dist/apiMethods/assetMethods.js.map +1 -0
  128. package/dist/apiMethods/batchMethods.d.ts.map +1 -0
  129. package/dist/apiMethods/batchMethods.js +33 -33
  130. package/dist/apiMethods/batchMethods.js.map +1 -0
  131. package/dist/apiMethods/clientInstance.d.ts.map +1 -0
  132. package/dist/apiMethods/clientInstance.js +18 -15
  133. package/dist/apiMethods/clientInstance.js.map +1 -0
  134. package/dist/apiMethods/containerMethods.d.ts.map +1 -0
  135. package/dist/apiMethods/containerMethods.js +20 -20
  136. package/dist/apiMethods/containerMethods.js.map +1 -0
  137. package/dist/apiMethods/contentMethods.d.ts.map +1 -0
  138. package/dist/apiMethods/contentMethods.js +68 -68
  139. package/dist/apiMethods/contentMethods.js.map +1 -0
  140. package/dist/apiMethods/instanceMethods.d.ts.map +1 -0
  141. package/dist/apiMethods/instanceMethods.js +3 -3
  142. package/dist/apiMethods/instanceMethods.js.map +1 -0
  143. package/dist/apiMethods/instanceUserMethods.d.ts.map +1 -0
  144. package/dist/apiMethods/instanceUserMethods.js +10 -10
  145. package/dist/apiMethods/instanceUserMethods.js.map +1 -0
  146. package/dist/apiMethods/modelMethods.d.ts.map +1 -0
  147. package/dist/apiMethods/modelMethods.js +13 -13
  148. package/dist/apiMethods/modelMethods.js.map +1 -0
  149. package/dist/apiMethods/pageMethods.d.ts +2 -1
  150. package/dist/apiMethods/pageMethods.d.ts.map +1 -0
  151. package/dist/apiMethods/pageMethods.js +79 -73
  152. package/dist/apiMethods/pageMethods.js.map +1 -0
  153. package/dist/apiMethods/serverUserMethods.d.ts.map +1 -0
  154. package/dist/apiMethods/serverUserMethods.js +4 -4
  155. package/dist/apiMethods/serverUserMethods.js.map +1 -0
  156. package/dist/apiMethods/webhookMethods.d.ts.map +1 -0
  157. package/dist/apiMethods/webhookMethods.js +11 -11
  158. package/dist/apiMethods/webhookMethods.js.map +1 -0
  159. package/dist/enums/assetGroupingType.d.ts.map +1 -0
  160. package/dist/enums/assetGroupingType.js +1 -1
  161. package/dist/enums/assetGroupingType.js.map +1 -0
  162. package/dist/enums/batchItemType.d.ts.map +1 -0
  163. package/dist/enums/batchItemType.js +1 -1
  164. package/dist/enums/batchItemType.js.map +1 -0
  165. package/dist/enums/batchOperationType.d.ts.map +1 -0
  166. package/dist/enums/batchOperationType.js +1 -1
  167. package/dist/enums/batchOperationType.js.map +1 -0
  168. package/dist/enums/batchState..d.ts.map +1 -0
  169. package/dist/enums/batchState..js +1 -1
  170. package/dist/enums/batchState..js.map +1 -0
  171. package/dist/enums/pageItemTemplateType.d.ts.map +1 -0
  172. package/dist/enums/pageItemTemplateType.js +1 -1
  173. package/dist/enums/pageItemTemplateType.js.map +1 -0
  174. package/dist/enums/workflowOperationType.d.ts.map +1 -0
  175. package/dist/enums/workflowOperationType.js +1 -1
  176. package/dist/enums/workflowOperationType.js.map +1 -0
  177. package/dist/index.d.ts.map +1 -0
  178. package/dist/index.js +5 -1
  179. package/dist/index.js.map +1 -0
  180. package/dist/models/assetContainer.d.ts.map +1 -0
  181. package/dist/models/assetContainer.js.map +1 -0
  182. package/dist/models/assetGalleries.d.ts.map +1 -0
  183. package/dist/models/assetGalleries.js.map +1 -0
  184. package/dist/models/assetMediaGrouping.d.ts.map +1 -0
  185. package/dist/models/assetMediaGrouping.js.map +1 -0
  186. package/dist/models/assetMediaGroupingMetaData.d.ts.map +1 -0
  187. package/dist/models/assetMediaGroupingMetaData.js.map +1 -0
  188. package/dist/models/batch.d.ts.map +1 -0
  189. package/dist/models/batch.js.map +1 -0
  190. package/dist/models/batchItem.d.ts.map +1 -0
  191. package/dist/models/batchItem.js.map +1 -0
  192. package/dist/models/batchTypes.d.ts.map +1 -0
  193. package/dist/models/batchTypes.js.map +1 -0
  194. package/dist/models/container.d.ts.map +1 -0
  195. package/dist/models/container.js.map +1 -0
  196. package/dist/models/contentDefinitionTypeID.d.ts.map +1 -0
  197. package/dist/models/contentDefinitionTypeID.js +1 -1
  198. package/dist/models/contentDefinitionTypeID.js.map +1 -0
  199. package/dist/models/contentItem.d.ts.map +1 -0
  200. package/dist/models/contentItem.js.map +1 -0
  201. package/dist/models/contentItemHistory.d.ts.map +1 -0
  202. package/dist/models/contentItemHistory.js.map +1 -0
  203. package/dist/models/contentListFilterModel.d.ts.map +1 -0
  204. package/dist/models/contentListFilterModel.js.map +1 -0
  205. package/dist/models/contentSectionDefaultModule.d.ts.map +1 -0
  206. package/dist/models/contentSectionDefaultModule.js.map +1 -0
  207. package/dist/models/contentSectionDefinition.d.ts.map +1 -0
  208. package/dist/models/contentSectionDefinition.js.map +1 -0
  209. package/dist/models/contentViewColumn.d.ts.map +1 -0
  210. package/dist/models/contentViewColumn.js.map +1 -0
  211. package/dist/models/exception.d.ts.map +1 -0
  212. package/dist/models/exception.js +2 -0
  213. package/dist/models/exception.js.map +1 -0
  214. package/dist/models/instanceRole.d.ts.map +1 -0
  215. package/dist/models/instanceRole.js.map +1 -0
  216. package/dist/models/instanceUser.d.ts.map +1 -0
  217. package/dist/models/instanceUser.js.map +1 -0
  218. package/dist/models/itemComments.d.ts.map +1 -0
  219. package/dist/models/itemComments.js.map +1 -0
  220. package/dist/models/listParams.d.ts.map +1 -0
  221. package/dist/models/listParams.js.map +1 -0
  222. package/dist/models/locales.d.ts.map +1 -0
  223. package/dist/models/locales.js +2 -0
  224. package/dist/models/locales.js.map +1 -0
  225. package/dist/models/media.d.ts.map +1 -0
  226. package/dist/models/media.js.map +1 -0
  227. package/dist/models/model.d.ts.map +1 -0
  228. package/dist/models/model.js.map +1 -0
  229. package/dist/models/notification.d.ts.map +1 -0
  230. package/dist/models/notification.js.map +1 -0
  231. package/dist/models/options.d.ts.map +1 -0
  232. package/dist/models/options.js.map +1 -0
  233. package/dist/models/pageHistory.d.ts.map +1 -0
  234. package/dist/models/pageHistory.js.map +1 -0
  235. package/dist/models/pageItem.d.ts.map +1 -0
  236. package/dist/models/pageItem.js.map +1 -0
  237. package/dist/models/pageModel.d.ts.map +1 -0
  238. package/dist/models/pageModel.js.map +1 -0
  239. package/dist/models/serverUser.d.ts.map +1 -0
  240. package/dist/models/serverUser.js.map +1 -0
  241. package/dist/models/sharedModule.d.ts.map +1 -0
  242. package/dist/models/sharedModule.js.map +1 -0
  243. package/dist/models/sitemap.d.ts.map +1 -0
  244. package/dist/models/sitemap.js.map +1 -0
  245. package/dist/models/webhook.d.ts.map +1 -0
  246. package/dist/models/webhook.js.map +1 -0
  247. package/dist/models/websiteListing.d.ts.map +1 -0
  248. package/dist/models/websiteListing.js.map +1 -0
  249. package/dist/models/websiteUser.d.ts.map +1 -0
  250. package/dist/models/websiteUser.js.map +1 -0
  251. package/docs/asset-methods.md +382 -0
  252. package/docs/auth-component.md +361 -0
  253. package/docs/auth.md +594 -0
  254. package/docs/batch-methods.md +244 -0
  255. package/docs/cicd.md +607 -0
  256. package/docs/container-methods.md +268 -0
  257. package/docs/content-methods.md +423 -0
  258. package/docs/instance-methods.md +105 -0
  259. package/docs/instance-user-methods.md +231 -0
  260. package/docs/model-methods.md +434 -0
  261. package/docs/multi-instance-operations.md +192 -0
  262. package/docs/page-methods.md +671 -0
  263. package/docs/server-user-methods.md +280 -0
  264. package/docs/webhook-methods.md +452 -0
  265. package/package.json +1 -1
@@ -0,0 +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)
268
+ - [Multi-Instance Operations](./multi-instance-operations.md)
@@ -0,0 +1,423 @@
1
+ # ContentMethods API Documentation
2
+
3
+ The `ContentMethods` class provides comprehensive functionality for managing content items, including creation, publication, approval workflows, and retrieval operations.
4
+
5
+ ## Function List
6
+
7
+ | Function | Description |
8
+ |----------|-------------|
9
+ | [getContentItem](#getcontentitem) | Retrieves a specific content item by ID |
10
+ | [publishContent](#publishcontent) | Publishes a content item |
11
+ | [unPublishContent](#unpublishcontent) | Unpublishes a content item |
12
+ | [contentRequestApproval](#contentrequestapproval) | Requests approval for a content item |
13
+ | [approveContent](#approvecontent) | Approves a content item |
14
+ | [declineContent](#declinecontent) | Declines a content item |
15
+ | [deleteContent](#deletecontent) | Deletes a content item |
16
+ | [saveContentItem](#savecontentitem) | Saves a single content item |
17
+ | [saveContentItems](#savecontentitems) | Saves multiple content items |
18
+ | [getContentItems](#getcontentitems) | Retrieves content items with filtering (deprecated) |
19
+ | [getContentList](#getcontentlist) | Retrieves content list with advanced filtering |
20
+ | [getContentHistory](#getcontenthistory) | Retrieves content item history |
21
+ | [getContentComments](#getcontentcomments) | Retrieves content item comments |
22
+
23
+ ---
24
+
25
+ ## getContentItem
26
+
27
+ Retrieves a specific content item by ID and locale.
28
+
29
+ ### Parameters
30
+
31
+ | Parameter | Type | Required | Description |
32
+ |-----------|------|----------|-------------|
33
+ | contentID | number | Yes | The ID of the content item to retrieve |
34
+ | guid | string | Yes | The website GUID |
35
+ | locale | string | Yes | The locale code (e.g., 'en-us') |
36
+
37
+ ### Returns
38
+
39
+ `Promise<ContentItem>` - The content item object
40
+
41
+ ### Usage Example
42
+
43
+ ```typescript
44
+ const contentItem = await client.contentMethods.getContentItem(123, 'your-guid', 'en-us');
45
+ console.log(contentItem.fields.title);
46
+ ```
47
+
48
+ ---
49
+
50
+ ## publishContent
51
+
52
+ Publishes a content item through the batch workflow system.
53
+
54
+ ### Parameters
55
+
56
+ | Parameter | Type | Required | Description |
57
+ |-----------|------|----------|-------------|
58
+ | contentID | number | Yes | The ID of the content item to publish |
59
+ | guid | string | Yes | The website GUID |
60
+ | locale | string | Yes | The locale code |
61
+ | comments | string | No | Optional comments for the publish operation |
62
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
63
+
64
+ ### Returns
65
+
66
+ `Promise<number[]>` - Array of content IDs that were published
67
+
68
+ ### Usage Example
69
+
70
+ ```typescript
71
+ // Wait for completion (default)
72
+ const publishedIds = await client.contentMethods.publishContent(123, 'your-guid', 'en-us', 'Publishing update');
73
+
74
+ // Return batch ID immediately for custom polling
75
+ const batchId = await client.contentMethods.publishContent(123, 'your-guid', 'en-us', null, true);
76
+ ```
77
+
78
+ ---
79
+
80
+ ## unPublishContent
81
+
82
+ Unpublishes a content item through the batch workflow system.
83
+
84
+ ### Parameters
85
+
86
+ | Parameter | Type | Required | Description |
87
+ |-----------|------|----------|-------------|
88
+ | contentID | number | Yes | The ID of the content item to unpublish |
89
+ | guid | string | Yes | The website GUID |
90
+ | locale | string | Yes | The locale code |
91
+ | comments | string | No | Optional comments for the unpublish operation |
92
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
93
+
94
+ ### Returns
95
+
96
+ `Promise<number[]>` - Array of content IDs that were unpublished
97
+
98
+ ### Usage Example
99
+
100
+ ```typescript
101
+ const unpublishedIds = await client.contentMethods.unPublishContent(123, 'your-guid', 'en-us', 'Temporary unpublish');
102
+ ```
103
+
104
+ ---
105
+
106
+ ## contentRequestApproval
107
+
108
+ Requests approval for a content item through the workflow system.
109
+
110
+ ### Parameters
111
+
112
+ | Parameter | Type | Required | Description |
113
+ |-----------|------|----------|-------------|
114
+ | contentID | number | Yes | The ID of the content item |
115
+ | guid | string | Yes | The website GUID |
116
+ | locale | string | Yes | The locale code |
117
+ | comments | string | No | Optional comments for the approval request |
118
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
119
+
120
+ ### Returns
121
+
122
+ `Promise<number[]>` - Array of content IDs that had approval requested
123
+
124
+ ### Usage Example
125
+
126
+ ```typescript
127
+ const requestedIds = await client.contentMethods.contentRequestApproval(123, 'your-guid', 'en-us', 'Ready for review');
128
+ ```
129
+
130
+ ---
131
+
132
+ ## approveContent
133
+
134
+ Approves a content item in the workflow system.
135
+
136
+ ### Parameters
137
+
138
+ | Parameter | Type | Required | Description |
139
+ |-----------|------|----------|-------------|
140
+ | contentID | number | Yes | The ID of the content item to approve |
141
+ | guid | string | Yes | The website GUID |
142
+ | locale | string | Yes | The locale code |
143
+ | comments | string | No | Optional comments for the approval |
144
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
145
+
146
+ ### Returns
147
+
148
+ `Promise<number[]>` - Array of content IDs that were approved
149
+
150
+ ### Usage Example
151
+
152
+ ```typescript
153
+ const approvedIds = await client.contentMethods.approveContent(123, 'your-guid', 'en-us', 'Approved for publication');
154
+ ```
155
+
156
+ ---
157
+
158
+ ## declineContent
159
+
160
+ Declines a content item in the workflow system.
161
+
162
+ ### Parameters
163
+
164
+ | Parameter | Type | Required | Description |
165
+ |-----------|------|----------|-------------|
166
+ | contentID | number | Yes | The ID of the content item to decline |
167
+ | guid | string | Yes | The website GUID |
168
+ | locale | string | Yes | The locale code |
169
+ | comments | string | No | Optional comments for the decline |
170
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
171
+
172
+ ### Returns
173
+
174
+ `Promise<number[]>` - Array of content IDs that were declined
175
+
176
+ ### Usage Example
177
+
178
+ ```typescript
179
+ const declinedIds = await client.contentMethods.declineContent(123, 'your-guid', 'en-us', 'Needs revision');
180
+ ```
181
+
182
+ ---
183
+
184
+ ## deleteContent
185
+
186
+ Deletes a content item through the batch workflow system.
187
+
188
+ ### Parameters
189
+
190
+ | Parameter | Type | Required | Description |
191
+ |-----------|------|----------|-------------|
192
+ | contentID | number | Yes | The ID of the content item to delete |
193
+ | guid | string | Yes | The website GUID |
194
+ | locale | string | Yes | The locale code |
195
+ | comments | string | No | Optional comments for the deletion |
196
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
197
+
198
+ ### Returns
199
+
200
+ `Promise<number[]>` - Array of content IDs that were deleted
201
+
202
+ ### Usage Example
203
+
204
+ ```typescript
205
+ const deletedIds = await client.contentMethods.deleteContent(123, 'your-guid', 'en-us', 'Removing outdated content');
206
+ ```
207
+
208
+ ---
209
+
210
+ ## saveContentItem
211
+
212
+ Saves a single content item (create or update) through the batch workflow system.
213
+
214
+ ### Parameters
215
+
216
+ | Parameter | Type | Required | Description |
217
+ |-----------|------|----------|-------------|
218
+ | contentItem | ContentItem | Yes | The content item object to save |
219
+ | guid | string | Yes | The website GUID |
220
+ | locale | string | Yes | The locale code |
221
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
222
+
223
+ ### Returns
224
+
225
+ `Promise<number[]>` - Array of content IDs that were saved
226
+
227
+ ### Usage Example
228
+
229
+ ```typescript
230
+ const contentItem = {
231
+ contentID: 0, // 0 for new items
232
+ fields: {
233
+ title: 'New Article',
234
+ content: 'Article content...'
235
+ }
236
+ };
237
+
238
+ const savedIds = await client.contentMethods.saveContentItem(contentItem, 'your-guid', 'en-us');
239
+ ```
240
+
241
+ ---
242
+
243
+ ## saveContentItems
244
+
245
+ Saves multiple content items in a single batch operation.
246
+
247
+ ### Parameters
248
+
249
+ | Parameter | Type | Required | Description |
250
+ |-----------|------|----------|-------------|
251
+ | contentItems | ContentItem[] | Yes | Array of content item objects to save |
252
+ | guid | string | Yes | The website GUID |
253
+ | locale | string | Yes | The locale code |
254
+ | returnBatchId | boolean | No | If true, returns batch ID immediately without waiting |
255
+
256
+ ### Returns
257
+
258
+ `Promise<number[]>` - Array of content IDs that were saved
259
+
260
+ ### Usage Example
261
+
262
+ ```typescript
263
+ const contentItems = [
264
+ { contentID: 0, fields: { title: 'Article 1' } },
265
+ { contentID: 0, fields: { title: 'Article 2' } }
266
+ ];
267
+
268
+ const savedIds = await client.contentMethods.saveContentItems(contentItems, 'your-guid', 'en-us');
269
+ ```
270
+
271
+ ---
272
+
273
+ ## getContentItems
274
+
275
+ Retrieves content items with basic filtering parameters (deprecated - use getContentList instead).
276
+
277
+ ### Parameters
278
+
279
+ | Parameter | Type | Required | Description |
280
+ |-----------|------|----------|-------------|
281
+ | referenceName | string | Yes | The reference name of the content model |
282
+ | guid | string | Yes | The website GUID |
283
+ | locale | string | Yes | The locale code |
284
+ | listParams | ListParams | Yes | Pagination and filtering parameters |
285
+
286
+ ### Returns
287
+
288
+ `Promise<ContentList>` - The content list with items and pagination info
289
+
290
+ ### Usage Example
291
+
292
+ ```typescript
293
+ const listParams = {
294
+ take: 10,
295
+ skip: 0,
296
+ sortField: 'title',
297
+ sortDirection: 'asc'
298
+ };
299
+
300
+ const contentList = await client.contentMethods.getContentItems('articles', 'your-guid', 'en-us', listParams);
301
+ ```
302
+
303
+ ---
304
+
305
+ ## getContentList
306
+
307
+ Retrieves content items with advanced filtering using POST request with filter object.
308
+
309
+ ### Parameters
310
+
311
+ | Parameter | Type | Required | Description |
312
+ |-----------|------|----------|-------------|
313
+ | referenceName | string | Yes | The reference name of the content model |
314
+ | guid | string | Yes | The website GUID |
315
+ | locale | string | Yes | The locale code |
316
+ | listParams | ListParams | Yes | Pagination and filtering parameters |
317
+ | filterObject | ContentListFilterModel | No | Advanced filter criteria |
318
+
319
+ ### Returns
320
+
321
+ `Promise<ContentList>` - The content list with items and pagination info
322
+
323
+ ### Usage Example
324
+
325
+ ```typescript
326
+ const listParams = {
327
+ take: 20,
328
+ skip: 0,
329
+ sortField: 'dateCreated',
330
+ sortDirection: 'desc',
331
+ showDeleted: false
332
+ };
333
+
334
+ const filterObject = {
335
+ publishedState: 'published',
336
+ searchText: 'important'
337
+ };
338
+
339
+ const contentList = await client.contentMethods.getContentList('articles', 'your-guid', 'en-us', listParams, filterObject);
340
+ ```
341
+
342
+ ---
343
+
344
+ ## getContentHistory
345
+
346
+ Retrieves the history of changes for a specific content item.
347
+
348
+ ### Parameters
349
+
350
+ | Parameter | Type | Required | Description |
351
+ |-----------|------|----------|-------------|
352
+ | locale | string | Yes | The locale code |
353
+ | guid | string | Yes | The website GUID |
354
+ | contentID | number | Yes | The ID of the content item |
355
+ | take | number | No | Number of history entries to retrieve (default: 50) |
356
+ | skip | number | No | Number of history entries to skip (default: 0) |
357
+
358
+ ### Returns
359
+
360
+ `Promise<ContentItemHistory>` - The content item history with pagination
361
+
362
+ ### Usage Example
363
+
364
+ ```typescript
365
+ const history = await client.contentMethods.getContentHistory('en-us', 'your-guid', 123, 25, 0);
366
+ console.log(history.items.length);
367
+ ```
368
+
369
+ ---
370
+
371
+ ## getContentComments
372
+
373
+ Retrieves comments for a specific content item.
374
+
375
+ ### Parameters
376
+
377
+ | Parameter | Type | Required | Description |
378
+ |-----------|------|----------|-------------|
379
+ | locale | string | Yes | The locale code |
380
+ | guid | string | Yes | The website GUID |
381
+ | contentID | number | Yes | The ID of the content item |
382
+ | take | number | No | Number of comments to retrieve (default: 50) |
383
+ | skip | number | No | Number of comments to skip (default: 0) |
384
+
385
+ ### Returns
386
+
387
+ `Promise<ItemComments>` - The content item comments with pagination
388
+
389
+ ### Usage Example
390
+
391
+ ```typescript
392
+ const comments = await client.contentMethods.getContentComments('en-us', 'your-guid', 123, 10, 0);
393
+ console.log(comments.items.length);
394
+ ```
395
+
396
+ ---
397
+
398
+ ## Error Handling
399
+
400
+ All methods throw `Exception` objects on failure:
401
+
402
+ ```typescript
403
+ try {
404
+ const contentItem = await client.contentMethods.getContentItem(123, 'your-guid', 'en-us');
405
+ } catch (error) {
406
+ console.error('Failed to get content item:', error.message);
407
+ }
408
+ ```
409
+
410
+ ---
411
+
412
+ ## Navigation
413
+ - [← Back to Main Documentation](../README.md)
414
+ - [Authentication & Setup](./auth.md)
415
+ - [AssetMethods](./asset-methods.md)
416
+ - [BatchMethods](./batch-methods.md)
417
+ - [ContainerMethods](./container-methods.md)
418
+ - [InstanceMethods](./instance-methods.md)
419
+ - [InstanceUserMethods](./instance-user-methods.md)
420
+ - [ModelMethods](./model-methods.md)
421
+ - [PageMethods](./page-methods.md)
422
+ - [ServerUserMethods](./server-user-methods.md)
423
+ - [WebhookMethods](./webhook-methods.md)