@agility/management-sdk 0.1.36 → 0.1.38

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 (263) hide show
  1. package/README.md +396 -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 +100 -46
  8. package/dist/apiMethods/instanceMethods.d.ts +13 -0
  9. package/dist/apiMethods/instanceMethods.js +48 -0
  10. package/dist/apiMethods/pageMethods.d.ts +12 -0
  11. package/dist/apiMethods/pageMethods.js +88 -34
  12. package/dist/enums/contentViewType.d.ts +6 -0
  13. package/dist/enums/contentViewType.js +10 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.js +3 -0
  16. package/dist/models/fetchApiStatus.d.ts +38 -0
  17. package/dist/models/fetchApiStatus.js +2 -0
  18. package/dist/models/pagedResult.d.ts +4 -0
  19. package/dist/models/pagedResult.js +2 -0
  20. package/docs/asset-methods.md +381 -381
  21. package/docs/auth-component.md +360 -360
  22. package/docs/auth.md +593 -593
  23. package/docs/batch-methods.md +243 -243
  24. package/docs/cicd.md +606 -606
  25. package/docs/container-methods.md +267 -267
  26. package/docs/content-methods.md +491 -422
  27. package/docs/instance-methods.md +185 -105
  28. package/docs/instance-user-methods.md +230 -230
  29. package/docs/model-methods.md +433 -433
  30. package/docs/multi-instance-operations.md +191 -191
  31. package/docs/page-methods.md +737 -670
  32. package/docs/server-user-methods.md +279 -279
  33. package/docs/webhook-methods.md +451 -451
  34. package/license.txt +20 -20
  35. package/package.json +40 -40
  36. package/tsconfig.json +14 -14
  37. package/.cursor/api-coverage.md +0 -217
  38. package/.cursor/api-documentation-manifest.md +0 -275
  39. package/.cursor/api-functions-analysis.md +0 -111
  40. package/.cursor/breakout-manifest.md +0 -278
  41. package/.cursor/docs-final-check.md +0 -269
  42. package/.cursor/github-actions-improvements.md +0 -76
  43. package/.cursor/hardening.md +0 -271
  44. package/.cursor/linting-fix.md +0 -160
  45. package/.cursor/manifest.md +0 -243
  46. package/.cursor/mocks.md +0 -100
  47. package/.cursor/test-coverage.md +0 -841
  48. package/.env +0 -92
  49. package/coverage/base.css +0 -224
  50. package/coverage/block-navigation.js +0 -87
  51. package/coverage/coverage-summary.json +0 -43
  52. package/coverage/favicon.png +0 -0
  53. package/coverage/index.html +0 -161
  54. package/coverage/lcov-report/base.css +0 -224
  55. package/coverage/lcov-report/block-navigation.js +0 -87
  56. package/coverage/lcov-report/favicon.png +0 -0
  57. package/coverage/lcov-report/index.html +0 -161
  58. package/coverage/lcov-report/prettify.css +0 -1
  59. package/coverage/lcov-report/prettify.js +0 -2
  60. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  61. package/coverage/lcov-report/sorter.js +0 -210
  62. package/coverage/lcov-report/src/apiClient.ts.html +0 -199
  63. package/coverage/lcov-report/src/apiMethods/assetMethods.ts.html +0 -682
  64. package/coverage/lcov-report/src/apiMethods/batchMethods.ts.html +0 -736
  65. package/coverage/lcov-report/src/apiMethods/clientInstance.ts.html +0 -403
  66. package/coverage/lcov-report/src/apiMethods/containerMethods.ts.html +0 -460
  67. package/coverage/lcov-report/src/apiMethods/contentMethods.ts.html +0 -1183
  68. package/coverage/lcov-report/src/apiMethods/index.html +0 -266
  69. package/coverage/lcov-report/src/apiMethods/instanceMethods.ts.html +0 -160
  70. package/coverage/lcov-report/src/apiMethods/instanceUserMethods.ts.html +0 -268
  71. package/coverage/lcov-report/src/apiMethods/modelMethods.ts.html +0 -352
  72. package/coverage/lcov-report/src/apiMethods/pageMethods.ts.html +0 -1276
  73. package/coverage/lcov-report/src/apiMethods/serverUserMethods.ts.html +0 -196
  74. package/coverage/lcov-report/src/apiMethods/webhookMethods.ts.html +0 -271
  75. package/coverage/lcov-report/src/enums/batchItemType.ts.html +0 -106
  76. package/coverage/lcov-report/src/enums/batchOperationType.ts.html +0 -142
  77. package/coverage/lcov-report/src/enums/batchState..ts.html +0 -106
  78. package/coverage/lcov-report/src/enums/index.html +0 -161
  79. package/coverage/lcov-report/src/enums/workflowOperationType.ts.html +0 -175
  80. package/coverage/lcov-report/src/index.html +0 -116
  81. package/coverage/lcov-report/src/models/assetContainer.ts.html +0 -106
  82. package/coverage/lcov-report/src/models/assetGalleries.ts.html +0 -103
  83. package/coverage/lcov-report/src/models/assetMediaGrouping.ts.html +0 -136
  84. package/coverage/lcov-report/src/models/assetMediaGroupingMetaData.ts.html +0 -97
  85. package/coverage/lcov-report/src/models/batch.ts.html +0 -178
  86. package/coverage/lcov-report/src/models/batchItem.ts.html +0 -127
  87. package/coverage/lcov-report/src/models/container.ts.html +0 -232
  88. package/coverage/lcov-report/src/models/contentDefinitionTypeID.ts.html +0 -142
  89. package/coverage/lcov-report/src/models/contentItem.ts.html +0 -202
  90. package/coverage/lcov-report/src/models/contentSectionDefaultModule.ts.html +0 -106
  91. package/coverage/lcov-report/src/models/contentSectionDefinition.ts.html +0 -196
  92. package/coverage/lcov-report/src/models/contentViewColumn.ts.html +0 -109
  93. package/coverage/lcov-report/src/models/exception.ts.html +0 -109
  94. package/coverage/lcov-report/src/models/index.html +0 -476
  95. package/coverage/lcov-report/src/models/instanceRole.ts.html +0 -106
  96. package/coverage/lcov-report/src/models/instanceUser.ts.html +0 -130
  97. package/coverage/lcov-report/src/models/locales.ts.html +0 -100
  98. package/coverage/lcov-report/src/models/media.ts.html +0 -178
  99. package/coverage/lcov-report/src/models/model.ts.html +0 -172
  100. package/coverage/lcov-report/src/models/notification.ts.html +0 -124
  101. package/coverage/lcov-report/src/models/options.ts.html +0 -109
  102. package/coverage/lcov-report/src/models/pageItem.ts.html +0 -268
  103. package/coverage/lcov-report/src/models/pageModel.ts.html +0 -130
  104. package/coverage/lcov-report/src/models/sharedModule.ts.html +0 -106
  105. package/coverage/lcov-report/src/models/sitemap.ts.html +0 -148
  106. package/coverage/lcov-report/src/models/websiteUser.ts.html +0 -157
  107. package/coverage/lcov.info +0 -1459
  108. package/coverage/prettify.css +0 -1
  109. package/coverage/prettify.js +0 -2
  110. package/coverage/sort-arrow-sprite.png +0 -0
  111. package/coverage/sorter.js +0 -210
  112. package/coverage/src/apiClient.ts.html +0 -199
  113. package/coverage/src/apiMethods/assetMethods.ts.html +0 -682
  114. package/coverage/src/apiMethods/batchMethods.ts.html +0 -736
  115. package/coverage/src/apiMethods/clientInstance.ts.html +0 -403
  116. package/coverage/src/apiMethods/containerMethods.ts.html +0 -460
  117. package/coverage/src/apiMethods/contentMethods.ts.html +0 -1183
  118. package/coverage/src/apiMethods/index.html +0 -266
  119. package/coverage/src/apiMethods/instanceMethods.ts.html +0 -160
  120. package/coverage/src/apiMethods/instanceUserMethods.ts.html +0 -268
  121. package/coverage/src/apiMethods/modelMethods.ts.html +0 -352
  122. package/coverage/src/apiMethods/pageMethods.ts.html +0 -1276
  123. package/coverage/src/apiMethods/serverUserMethods.ts.html +0 -196
  124. package/coverage/src/apiMethods/webhookMethods.ts.html +0 -271
  125. package/coverage/src/enums/batchItemType.ts.html +0 -106
  126. package/coverage/src/enums/batchOperationType.ts.html +0 -142
  127. package/coverage/src/enums/batchState..ts.html +0 -106
  128. package/coverage/src/enums/index.html +0 -161
  129. package/coverage/src/enums/workflowOperationType.ts.html +0 -175
  130. package/coverage/src/index.html +0 -116
  131. package/coverage/src/models/assetContainer.ts.html +0 -106
  132. package/coverage/src/models/assetGalleries.ts.html +0 -103
  133. package/coverage/src/models/assetMediaGrouping.ts.html +0 -136
  134. package/coverage/src/models/assetMediaGroupingMetaData.ts.html +0 -97
  135. package/coverage/src/models/batch.ts.html +0 -178
  136. package/coverage/src/models/batchItem.ts.html +0 -127
  137. package/coverage/src/models/container.ts.html +0 -232
  138. package/coverage/src/models/contentDefinitionTypeID.ts.html +0 -142
  139. package/coverage/src/models/contentItem.ts.html +0 -202
  140. package/coverage/src/models/contentSectionDefaultModule.ts.html +0 -106
  141. package/coverage/src/models/contentSectionDefinition.ts.html +0 -196
  142. package/coverage/src/models/contentViewColumn.ts.html +0 -109
  143. package/coverage/src/models/exception.ts.html +0 -109
  144. package/coverage/src/models/index.html +0 -476
  145. package/coverage/src/models/instanceRole.ts.html +0 -106
  146. package/coverage/src/models/instanceUser.ts.html +0 -130
  147. package/coverage/src/models/locales.ts.html +0 -100
  148. package/coverage/src/models/media.ts.html +0 -178
  149. package/coverage/src/models/model.ts.html +0 -172
  150. package/coverage/src/models/notification.ts.html +0 -124
  151. package/coverage/src/models/options.ts.html +0 -109
  152. package/coverage/src/models/pageItem.ts.html +0 -268
  153. package/coverage/src/models/pageModel.ts.html +0 -130
  154. package/coverage/src/models/sharedModule.ts.html +0 -106
  155. package/coverage/src/models/sitemap.ts.html +0 -148
  156. package/coverage/src/models/websiteUser.ts.html +0 -157
  157. package/dist/.tsbuildinfo +0 -1
  158. package/dist/apiClient.d.ts.map +0 -1
  159. package/dist/apiClient.js.map +0 -1
  160. package/dist/apiMethods/assetMethods.d.ts.map +0 -1
  161. package/dist/apiMethods/assetMethods.js.map +0 -1
  162. package/dist/apiMethods/batchMethods.d.ts.map +0 -1
  163. package/dist/apiMethods/batchMethods.js.map +0 -1
  164. package/dist/apiMethods/clientInstance.d.ts.map +0 -1
  165. package/dist/apiMethods/clientInstance.js.map +0 -1
  166. package/dist/apiMethods/containerMethods.d.ts.map +0 -1
  167. package/dist/apiMethods/containerMethods.js.map +0 -1
  168. package/dist/apiMethods/contentMethods.d.ts.map +0 -1
  169. package/dist/apiMethods/contentMethods.js.map +0 -1
  170. package/dist/apiMethods/instanceMethods.d.ts.map +0 -1
  171. package/dist/apiMethods/instanceMethods.js.map +0 -1
  172. package/dist/apiMethods/instanceUserMethods.d.ts.map +0 -1
  173. package/dist/apiMethods/instanceUserMethods.js.map +0 -1
  174. package/dist/apiMethods/modelMethods.d.ts.map +0 -1
  175. package/dist/apiMethods/modelMethods.js.map +0 -1
  176. package/dist/apiMethods/pageMethods.d.ts.map +0 -1
  177. package/dist/apiMethods/pageMethods.js.map +0 -1
  178. package/dist/apiMethods/serverUserMethods.d.ts.map +0 -1
  179. package/dist/apiMethods/serverUserMethods.js.map +0 -1
  180. package/dist/apiMethods/webhookMethods.d.ts.map +0 -1
  181. package/dist/apiMethods/webhookMethods.js.map +0 -1
  182. package/dist/enums/assetGroupingType.d.ts.map +0 -1
  183. package/dist/enums/assetGroupingType.js.map +0 -1
  184. package/dist/enums/batchItemType.d.ts.map +0 -1
  185. package/dist/enums/batchItemType.js.map +0 -1
  186. package/dist/enums/batchOperationType.d.ts.map +0 -1
  187. package/dist/enums/batchOperationType.js.map +0 -1
  188. package/dist/enums/batchState..d.ts.map +0 -1
  189. package/dist/enums/batchState..js.map +0 -1
  190. package/dist/enums/pageItemTemplateType.d.ts.map +0 -1
  191. package/dist/enums/pageItemTemplateType.js.map +0 -1
  192. package/dist/enums/workflowOperationType.d.ts.map +0 -1
  193. package/dist/enums/workflowOperationType.js.map +0 -1
  194. package/dist/index.d.ts.map +0 -1
  195. package/dist/index.js.map +0 -1
  196. package/dist/models/assetContainer.d.ts.map +0 -1
  197. package/dist/models/assetContainer.js.map +0 -1
  198. package/dist/models/assetGalleries.d.ts.map +0 -1
  199. package/dist/models/assetGalleries.js.map +0 -1
  200. package/dist/models/assetMediaGrouping.d.ts.map +0 -1
  201. package/dist/models/assetMediaGrouping.js.map +0 -1
  202. package/dist/models/assetMediaGroupingMetaData.d.ts.map +0 -1
  203. package/dist/models/assetMediaGroupingMetaData.js.map +0 -1
  204. package/dist/models/batch.d.ts.map +0 -1
  205. package/dist/models/batch.js.map +0 -1
  206. package/dist/models/batchItem.d.ts.map +0 -1
  207. package/dist/models/batchItem.js.map +0 -1
  208. package/dist/models/batchTypes.d.ts.map +0 -1
  209. package/dist/models/batchTypes.js.map +0 -1
  210. package/dist/models/container.d.ts.map +0 -1
  211. package/dist/models/container.js.map +0 -1
  212. package/dist/models/contentDefinitionTypeID.d.ts.map +0 -1
  213. package/dist/models/contentDefinitionTypeID.js.map +0 -1
  214. package/dist/models/contentItem.d.ts.map +0 -1
  215. package/dist/models/contentItem.js.map +0 -1
  216. package/dist/models/contentItemHistory.d.ts.map +0 -1
  217. package/dist/models/contentItemHistory.js.map +0 -1
  218. package/dist/models/contentListFilterModel.d.ts.map +0 -1
  219. package/dist/models/contentListFilterModel.js.map +0 -1
  220. package/dist/models/contentSectionDefaultModule.d.ts.map +0 -1
  221. package/dist/models/contentSectionDefaultModule.js.map +0 -1
  222. package/dist/models/contentSectionDefinition.d.ts.map +0 -1
  223. package/dist/models/contentSectionDefinition.js.map +0 -1
  224. package/dist/models/contentViewColumn.d.ts.map +0 -1
  225. package/dist/models/contentViewColumn.js.map +0 -1
  226. package/dist/models/exception.d.ts.map +0 -1
  227. package/dist/models/exception.js.map +0 -1
  228. package/dist/models/instanceRole.d.ts.map +0 -1
  229. package/dist/models/instanceRole.js.map +0 -1
  230. package/dist/models/instanceUser.d.ts.map +0 -1
  231. package/dist/models/instanceUser.js.map +0 -1
  232. package/dist/models/itemComments.d.ts.map +0 -1
  233. package/dist/models/itemComments.js.map +0 -1
  234. package/dist/models/listParams.d.ts.map +0 -1
  235. package/dist/models/listParams.js.map +0 -1
  236. package/dist/models/locales.d.ts.map +0 -1
  237. package/dist/models/locales.js.map +0 -1
  238. package/dist/models/media.d.ts.map +0 -1
  239. package/dist/models/media.js.map +0 -1
  240. package/dist/models/model.d.ts.map +0 -1
  241. package/dist/models/model.js.map +0 -1
  242. package/dist/models/notification.d.ts.map +0 -1
  243. package/dist/models/notification.js.map +0 -1
  244. package/dist/models/options.d.ts.map +0 -1
  245. package/dist/models/options.js.map +0 -1
  246. package/dist/models/pageHistory.d.ts.map +0 -1
  247. package/dist/models/pageHistory.js.map +0 -1
  248. package/dist/models/pageItem.d.ts.map +0 -1
  249. package/dist/models/pageItem.js.map +0 -1
  250. package/dist/models/pageModel.d.ts.map +0 -1
  251. package/dist/models/pageModel.js.map +0 -1
  252. package/dist/models/serverUser.d.ts.map +0 -1
  253. package/dist/models/serverUser.js.map +0 -1
  254. package/dist/models/sharedModule.d.ts.map +0 -1
  255. package/dist/models/sharedModule.js.map +0 -1
  256. package/dist/models/sitemap.d.ts.map +0 -1
  257. package/dist/models/sitemap.js.map +0 -1
  258. package/dist/models/webhook.d.ts.map +0 -1
  259. package/dist/models/webhook.js.map +0 -1
  260. package/dist/models/websiteListing.d.ts.map +0 -1
  261. package/dist/models/websiteListing.js.map +0 -1
  262. package/dist/models/websiteUser.d.ts.map +0 -1
  263. package/dist/models/websiteUser.js.map +0 -1
@@ -1,244 +1,244 @@
1
- # Agility CMS & Management API TypeScript SDK
2
-
3
- ## BatchMethods
4
-
5
- This class provides essential batch workflow operations for managing content and page publishing workflows within Agility CMS. These methods handle workflow operations (publish, unpublish, approve, etc.) on existing batches.
6
-
7
- **Important Notes:**
8
- - To CREATE new content or pages, use `contentMethods.saveContentItem(s)` or `pageMethods.savePage()` instead
9
- - These batch methods are for managing workflow operations on existing batches
10
- - All batch operations support both immediate return and completion polling
11
- - Use `getBatchTypes()` for dynamic UI population and validation
12
-
13
- ### Function List
14
- - [getBatch](#getbatch) - Retrieves details of an existing batch
15
- - [publishBatch](#publishbatch) - Publishes all items in an existing batch
16
- - [unpublishBatch](#unpublishbatch) - Unpublishes all items in an existing batch
17
- - [approveBatch](#approvebatch) - Approves all items in an existing batch
18
- - [declineBatch](#declinebatch) - Declines all items in an existing batch
19
- - [requestApprovalBatch](#requestapprovalbatch) - Requests approval for all items in an existing batch
20
- - [getBatchTypes](#getbatchtypes) - Retrieves all batch-related enum types for developer discovery
21
-
22
- ---
23
-
24
- ### getBatch
25
-
26
- Retrieves details of an existing batch including status, items, and metadata.
27
-
28
- | Parameter | Type | Required | Description |
29
- |-----------|------|----------|-------------|
30
- | `batchID` | `number` | Yes | The batchID of the requested batch |
31
- | `guid` | `string` | Yes | Current website GUID |
32
- | `expandItems` | `boolean` | No | Whether to include full item details *(Optional, default: true)* |
33
-
34
- **Returns:** `Batch` - Complete batch object with items and status information
35
-
36
- **Usage Example:**
37
- ```typescript
38
- // Get batch with full item details (default)
39
- const batch = await apiClient.batchMethods.getBatch(123, guid);
40
- console.log('Batch status:', batch.state);
41
- console.log('Items in batch:', batch.items.length);
42
-
43
- // Get basic batch information only (performance optimization)
44
- const batchBasic = await apiClient.batchMethods.getBatch(123, guid, false);
45
- ```
46
-
47
- **Error Handling:**
48
- - Throws `Exception` when batch not found or access denied
49
-
50
- ### publishBatch
51
-
52
- Publishes all items in an existing batch.
53
-
54
- | Parameter | Type | Required | Description |
55
- |-----------|------|----------|-------------|
56
- | `batchID` | `number` | Yes | The batchID of the batch to publish |
57
- | `guid` | `string` | Yes | Current website GUID |
58
- | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
59
-
60
- **Returns:** `number` - The batch ID
61
-
62
- **Usage Example:**
63
- ```typescript
64
- // Publish batch and wait for completion (default behavior)
65
- const batchId = await apiClient.batchMethods.publishBatch(123, guid);
66
- console.log('Batch published successfully:', batchId);
67
-
68
- // Publish batch and return immediately for custom polling
69
- const batchId = await apiClient.batchMethods.publishBatch(123, guid, true);
70
- // You can then poll the batch status yourself
71
- ```
72
-
73
- **Error Handling:**
74
- - Throws `Exception` when batch not found, publishing fails, or insufficient permissions
75
-
76
- ### unpublishBatch
77
-
78
- Unpublishes all items in an existing batch.
79
-
80
- | Parameter | Type | Required | Description |
81
- |-----------|------|----------|-------------|
82
- | `batchID` | `number` | Yes | The batchID of the batch to unpublish |
83
- | `guid` | `string` | Yes | Current website GUID |
84
- | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
85
-
86
- **Returns:** `number` - The batch ID
87
-
88
- **Usage Example:**
89
- ```typescript
90
- // Unpublish batch and wait for completion
91
- const batchId = await apiClient.batchMethods.unpublishBatch(123, guid);
92
-
93
- // Unpublish batch with immediate return
94
- const batchId = await apiClient.batchMethods.unpublishBatch(123, guid, true);
95
- ```
96
-
97
- **Error Handling:**
98
- - Throws `Exception` when batch not found, unpublishing fails, or insufficient permissions
99
-
100
- ### approveBatch
101
-
102
- Approves all items in an existing batch.
103
-
104
- | Parameter | Type | Required | Description |
105
- |-----------|------|----------|-------------|
106
- | `batchID` | `number` | Yes | The batchID of the batch to approve |
107
- | `guid` | `string` | Yes | Current website GUID |
108
- | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
109
-
110
- **Returns:** `number` - The batch ID
111
-
112
- **Usage Example:**
113
- ```typescript
114
- // Approve batch and wait for completion
115
- const batchId = await apiClient.batchMethods.approveBatch(123, guid);
116
-
117
- // Approve batch with immediate return for custom workflow
118
- const batchId = await apiClient.batchMethods.approveBatch(123, guid, true);
119
- ```
120
-
121
- **Error Handling:**
122
- - Throws `Exception` when batch not found, approval fails, or insufficient permissions
123
-
124
- ### declineBatch
125
-
126
- Declines all items in an existing batch.
127
-
128
- | Parameter | Type | Required | Description |
129
- |-----------|------|----------|-------------|
130
- | `batchID` | `number` | Yes | The batchID of the batch to decline |
131
- | `guid` | `string` | Yes | Current website GUID |
132
- | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
133
-
134
- **Returns:** `number` - The batch ID
135
-
136
- **Usage Example:**
137
- ```typescript
138
- // Decline batch and wait for completion
139
- const batchId = await apiClient.batchMethods.declineBatch(123, guid);
140
-
141
- // Decline batch with immediate return
142
- const batchId = await apiClient.batchMethods.declineBatch(123, guid, true);
143
- ```
144
-
145
- **Error Handling:**
146
- - Throws `Exception` when batch not found, decline fails, or insufficient permissions
147
-
148
- ### requestApprovalBatch
149
-
150
- Requests approval for all items in an existing batch.
151
-
152
- | Parameter | Type | Required | Description |
153
- |-----------|------|----------|-------------|
154
- | `batchID` | `number` | Yes | The batchID of the batch to request approval for |
155
- | `guid` | `string` | Yes | Current website GUID |
156
- | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
157
-
158
- **Returns:** `number` - The batch ID
159
-
160
- **Usage Example:**
161
- ```typescript
162
- // Request approval and wait for completion
163
- const batchId = await apiClient.batchMethods.requestApprovalBatch(123, guid);
164
-
165
- // Request approval with immediate return
166
- const batchId = await apiClient.batchMethods.requestApprovalBatch(123, guid, true);
167
- ```
168
-
169
- **Error Handling:**
170
- - Throws `Exception` when batch not found, request fails, or insufficient permissions
171
-
172
- ### getBatchTypes
173
-
174
- Retrieves all batch-related enum types for developer discovery and dynamic UI population.
175
-
176
- | Parameter | Type | Required | Description |
177
- |-----------|------|----------|-------------|
178
- | `guid` | `string` | Yes | Current website GUID |
179
-
180
- **Returns:** `BatchTypesResponse` - Object containing all batch enum types
181
-
182
- **Usage Example:**
183
- ```typescript
184
- // Get all batch types for dynamic UI population
185
- const types = await apiClient.batchMethods.getBatchTypes(guid);
186
-
187
- // Create dropdown options for item types
188
- const itemTypeOptions = types.itemTypes.map(type => ({
189
- label: type.name,
190
- value: type.value
191
- }));
192
-
193
- // Validate operation type
194
- const isValidWorkflowOperation = (value) =>
195
- types.workflowOperations.some(op => op.value === value);
196
-
197
- // Access specific enum data
198
- console.log('Available item types:', types.itemTypes);
199
- console.log('Available workflow operations:', types.workflowOperations);
200
- console.log('Available batch states:', types.states);
201
- console.log('All operation types:', types.operationTypes);
202
- ```
203
-
204
- **Response Structure:**
205
- ```typescript
206
- interface BatchTypesResponse {
207
- itemTypes: EnumInfo[]; // Page, ContentItem, ContentList, Tag, ModuleDef
208
- operationTypes: EnumInfo[]; // All operation types
209
- workflowOperations: EnumInfo[]; // Publish, Unpublish, Approve, Decline, RequestApproval
210
- states: EnumInfo[]; // None, Pending, InProcess, Processed, Deleted
211
- }
212
-
213
- interface EnumInfo {
214
- value: number; // Numeric enum value
215
- name: string; // String name (e.g., "Publish")
216
- description: string; // Human-readable description
217
- }
218
- ```
219
-
220
- **Benefits:**
221
- - 🎨 **Dynamic UI Population** - Frontend dropdowns populate automatically
222
- - ✅ **Client Validation** - Validate inputs against live API data
223
- - 🔍 **API Discovery** - Explore options without reading docs
224
- - 🚀 **Future-Proof** - New enum values appear automatically
225
-
226
- **Error Handling:**
227
- - Throws `Exception` when retrieval fails or access denied
228
-
229
- ---
230
-
231
- ## Navigation
232
- - [← Back to Main Documentation](../README.md)
233
- - [Authentication & Setup](./auth.md)
234
- - [CI/CD & Automated Environments](./cicd.md)
235
- - [AssetMethods](./asset-methods.md)
236
- - [ContainerMethods](./container-methods.md)
237
- - [ContentMethods](./content-methods.md)
238
- - [InstanceMethods](./instance-methods.md)
239
- - [InstanceUserMethods](./instance-user-methods.md)
240
- - [ModelMethods](./model-methods.md)
241
- - [PageMethods](./page-methods.md)
242
- - [ServerUserMethods](./server-user-methods.md)
243
- - [WebhookMethods](./webhook-methods.md)
1
+ # Agility CMS & Management API TypeScript SDK
2
+
3
+ ## BatchMethods
4
+
5
+ This class provides essential batch workflow operations for managing content and page publishing workflows within Agility CMS. These methods handle workflow operations (publish, unpublish, approve, etc.) on existing batches.
6
+
7
+ **Important Notes:**
8
+ - To CREATE new content or pages, use `contentMethods.saveContentItem(s)` or `pageMethods.savePage()` instead
9
+ - These batch methods are for managing workflow operations on existing batches
10
+ - All batch operations support both immediate return and completion polling
11
+ - Use `getBatchTypes()` for dynamic UI population and validation
12
+
13
+ ### Function List
14
+ - [getBatch](#getbatch) - Retrieves details of an existing batch
15
+ - [publishBatch](#publishbatch) - Publishes all items in an existing batch
16
+ - [unpublishBatch](#unpublishbatch) - Unpublishes all items in an existing batch
17
+ - [approveBatch](#approvebatch) - Approves all items in an existing batch
18
+ - [declineBatch](#declinebatch) - Declines all items in an existing batch
19
+ - [requestApprovalBatch](#requestapprovalbatch) - Requests approval for all items in an existing batch
20
+ - [getBatchTypes](#getbatchtypes) - Retrieves all batch-related enum types for developer discovery
21
+
22
+ ---
23
+
24
+ ### getBatch
25
+
26
+ Retrieves details of an existing batch including status, items, and metadata.
27
+
28
+ | Parameter | Type | Required | Description |
29
+ |-----------|------|----------|-------------|
30
+ | `batchID` | `number` | Yes | The batchID of the requested batch |
31
+ | `guid` | `string` | Yes | Current website GUID |
32
+ | `expandItems` | `boolean` | No | Whether to include full item details *(Optional, default: true)* |
33
+
34
+ **Returns:** `Batch` - Complete batch object with items and status information
35
+
36
+ **Usage Example:**
37
+ ```typescript
38
+ // Get batch with full item details (default)
39
+ const batch = await apiClient.batchMethods.getBatch(123, guid);
40
+ console.log('Batch status:', batch.state);
41
+ console.log('Items in batch:', batch.items.length);
42
+
43
+ // Get basic batch information only (performance optimization)
44
+ const batchBasic = await apiClient.batchMethods.getBatch(123, guid, false);
45
+ ```
46
+
47
+ **Error Handling:**
48
+ - Throws `Exception` when batch not found or access denied
49
+
50
+ ### publishBatch
51
+
52
+ Publishes all items in an existing batch.
53
+
54
+ | Parameter | Type | Required | Description |
55
+ |-----------|------|----------|-------------|
56
+ | `batchID` | `number` | Yes | The batchID of the batch to publish |
57
+ | `guid` | `string` | Yes | Current website GUID |
58
+ | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
59
+
60
+ **Returns:** `number` - The batch ID
61
+
62
+ **Usage Example:**
63
+ ```typescript
64
+ // Publish batch and wait for completion (default behavior)
65
+ const batchId = await apiClient.batchMethods.publishBatch(123, guid);
66
+ console.log('Batch published successfully:', batchId);
67
+
68
+ // Publish batch and return immediately for custom polling
69
+ const batchId = await apiClient.batchMethods.publishBatch(123, guid, true);
70
+ // You can then poll the batch status yourself
71
+ ```
72
+
73
+ **Error Handling:**
74
+ - Throws `Exception` when batch not found, publishing fails, or insufficient permissions
75
+
76
+ ### unpublishBatch
77
+
78
+ Unpublishes all items in an existing batch.
79
+
80
+ | Parameter | Type | Required | Description |
81
+ |-----------|------|----------|-------------|
82
+ | `batchID` | `number` | Yes | The batchID of the batch to unpublish |
83
+ | `guid` | `string` | Yes | Current website GUID |
84
+ | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
85
+
86
+ **Returns:** `number` - The batch ID
87
+
88
+ **Usage Example:**
89
+ ```typescript
90
+ // Unpublish batch and wait for completion
91
+ const batchId = await apiClient.batchMethods.unpublishBatch(123, guid);
92
+
93
+ // Unpublish batch with immediate return
94
+ const batchId = await apiClient.batchMethods.unpublishBatch(123, guid, true);
95
+ ```
96
+
97
+ **Error Handling:**
98
+ - Throws `Exception` when batch not found, unpublishing fails, or insufficient permissions
99
+
100
+ ### approveBatch
101
+
102
+ Approves all items in an existing batch.
103
+
104
+ | Parameter | Type | Required | Description |
105
+ |-----------|------|----------|-------------|
106
+ | `batchID` | `number` | Yes | The batchID of the batch to approve |
107
+ | `guid` | `string` | Yes | Current website GUID |
108
+ | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
109
+
110
+ **Returns:** `number` - The batch ID
111
+
112
+ **Usage Example:**
113
+ ```typescript
114
+ // Approve batch and wait for completion
115
+ const batchId = await apiClient.batchMethods.approveBatch(123, guid);
116
+
117
+ // Approve batch with immediate return for custom workflow
118
+ const batchId = await apiClient.batchMethods.approveBatch(123, guid, true);
119
+ ```
120
+
121
+ **Error Handling:**
122
+ - Throws `Exception` when batch not found, approval fails, or insufficient permissions
123
+
124
+ ### declineBatch
125
+
126
+ Declines all items in an existing batch.
127
+
128
+ | Parameter | Type | Required | Description |
129
+ |-----------|------|----------|-------------|
130
+ | `batchID` | `number` | Yes | The batchID of the batch to decline |
131
+ | `guid` | `string` | Yes | Current website GUID |
132
+ | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
133
+
134
+ **Returns:** `number` - The batch ID
135
+
136
+ **Usage Example:**
137
+ ```typescript
138
+ // Decline batch and wait for completion
139
+ const batchId = await apiClient.batchMethods.declineBatch(123, guid);
140
+
141
+ // Decline batch with immediate return
142
+ const batchId = await apiClient.batchMethods.declineBatch(123, guid, true);
143
+ ```
144
+
145
+ **Error Handling:**
146
+ - Throws `Exception` when batch not found, decline fails, or insufficient permissions
147
+
148
+ ### requestApprovalBatch
149
+
150
+ Requests approval for all items in an existing batch.
151
+
152
+ | Parameter | Type | Required | Description |
153
+ |-----------|------|----------|-------------|
154
+ | `batchID` | `number` | Yes | The batchID of the batch to request approval for |
155
+ | `guid` | `string` | Yes | Current website GUID |
156
+ | `returnBatchId` | `boolean` | No | If `true`, returns batch ID immediately. If `false` (default), waits for completion |
157
+
158
+ **Returns:** `number` - The batch ID
159
+
160
+ **Usage Example:**
161
+ ```typescript
162
+ // Request approval and wait for completion
163
+ const batchId = await apiClient.batchMethods.requestApprovalBatch(123, guid);
164
+
165
+ // Request approval with immediate return
166
+ const batchId = await apiClient.batchMethods.requestApprovalBatch(123, guid, true);
167
+ ```
168
+
169
+ **Error Handling:**
170
+ - Throws `Exception` when batch not found, request fails, or insufficient permissions
171
+
172
+ ### getBatchTypes
173
+
174
+ Retrieves all batch-related enum types for developer discovery and dynamic UI population.
175
+
176
+ | Parameter | Type | Required | Description |
177
+ |-----------|------|----------|-------------|
178
+ | `guid` | `string` | Yes | Current website GUID |
179
+
180
+ **Returns:** `BatchTypesResponse` - Object containing all batch enum types
181
+
182
+ **Usage Example:**
183
+ ```typescript
184
+ // Get all batch types for dynamic UI population
185
+ const types = await apiClient.batchMethods.getBatchTypes(guid);
186
+
187
+ // Create dropdown options for item types
188
+ const itemTypeOptions = types.itemTypes.map(type => ({
189
+ label: type.name,
190
+ value: type.value
191
+ }));
192
+
193
+ // Validate operation type
194
+ const isValidWorkflowOperation = (value) =>
195
+ types.workflowOperations.some(op => op.value === value);
196
+
197
+ // Access specific enum data
198
+ console.log('Available item types:', types.itemTypes);
199
+ console.log('Available workflow operations:', types.workflowOperations);
200
+ console.log('Available batch states:', types.states);
201
+ console.log('All operation types:', types.operationTypes);
202
+ ```
203
+
204
+ **Response Structure:**
205
+ ```typescript
206
+ interface BatchTypesResponse {
207
+ itemTypes: EnumInfo[]; // Page, ContentItem, ContentList, Tag, ModuleDef
208
+ operationTypes: EnumInfo[]; // All operation types
209
+ workflowOperations: EnumInfo[]; // Publish, Unpublish, Approve, Decline, RequestApproval
210
+ states: EnumInfo[]; // None, Pending, InProcess, Processed, Deleted
211
+ }
212
+
213
+ interface EnumInfo {
214
+ value: number; // Numeric enum value
215
+ name: string; // String name (e.g., "Publish")
216
+ description: string; // Human-readable description
217
+ }
218
+ ```
219
+
220
+ **Benefits:**
221
+ - 🎨 **Dynamic UI Population** - Frontend dropdowns populate automatically
222
+ - ✅ **Client Validation** - Validate inputs against live API data
223
+ - 🔍 **API Discovery** - Explore options without reading docs
224
+ - 🚀 **Future-Proof** - New enum values appear automatically
225
+
226
+ **Error Handling:**
227
+ - Throws `Exception` when retrieval fails or access denied
228
+
229
+ ---
230
+
231
+ ## Navigation
232
+ - [← Back to Main Documentation](../README.md)
233
+ - [Authentication & Setup](./auth.md)
234
+ - [CI/CD & Automated Environments](./cicd.md)
235
+ - [AssetMethods](./asset-methods.md)
236
+ - [ContainerMethods](./container-methods.md)
237
+ - [ContentMethods](./content-methods.md)
238
+ - [InstanceMethods](./instance-methods.md)
239
+ - [InstanceUserMethods](./instance-user-methods.md)
240
+ - [ModelMethods](./model-methods.md)
241
+ - [PageMethods](./page-methods.md)
242
+ - [ServerUserMethods](./server-user-methods.md)
243
+ - [WebhookMethods](./webhook-methods.md)
244
244
  - [Multi-Instance Operations](./multi-instance-operations.md)