@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,841 @@
1
+ # Agility CMS Management SDK Test Coverage Plan
2
+
3
+ ## Overview
4
+ This document outlines comprehensive test coverage for all API methods in the Agility CMS Management SDK. Tests will be integration tests that hit real endpoints without mocks to ensure full functionality.
5
+
6
+ ## Test Environment Requirements
7
+
8
+ ### Prerequisites
9
+ - Valid Agility CMS instance with management API access
10
+ - Test environment variables configured in `.env.test`:
11
+ - `AGILITY_PAT`: Valid Personal Access Token (PAT)
12
+ - `AGILITY_GUID`: Test instance GUID
13
+ - `AGILITY_WEBSITE`: Test website ID within the instance
14
+ - `AGILITY_LOCALES`: Comma-separated list of test locales (e.g., 'en-us,fr-ca')
15
+ - `AGILITY_BASE_URL`: API base URL (optional, defaults to production)
16
+
17
+ ### Test Data Requirements
18
+ - Test content models with known reference names
19
+ - Test containers with predictable structures
20
+ - Test content items that can be safely modified/deleted
21
+ - Test assets in known folders
22
+ - Test user accounts with appropriate permissions
23
+ - Test webhooks that can be created/modified/deleted
24
+
25
+ ## API Method Coverage
26
+
27
+ ### 1. AssetMethods (`src/apiMethods/assetMethods.ts`)
28
+
29
+ #### Core Asset Operations
30
+ - [ ] **deleteFile(mediaID, guid)**
31
+ - ✅ Success: Delete existing test asset
32
+ - ❌ Error: Delete non-existent asset (404)
33
+ - ❌ Error: Unauthorized deletion (403)
34
+
35
+ - [ ] **moveFile(mediaID, newFolder, guid)**
36
+ - ✅ Success: Move asset to existing folder
37
+ - ✅ Success: Move asset with special characters in folder name
38
+ - ❌ Error: Move non-existent asset
39
+ - ❌ Error: Move to non-existent folder
40
+
41
+ - [ ] **getMediaList(pageSize, recordOffset, guid)**
42
+ - ✅ Success: Get first page with default page size
43
+ - ✅ Success: Get specific page with custom page size
44
+ - ✅ Success: Handle empty results
45
+ - ❌ Error: Invalid pagination parameters
46
+
47
+ - [ ] **getAssetByID(mediaID, guid)**
48
+ - ✅ Success: Get existing asset details
49
+ - ❌ Error: Get non-existent asset (404)
50
+ - ❌ Error: Unauthorized access (403)
51
+
52
+ - [ ] **getAssetByUrl(url, guid)**
53
+ - ✅ Success: Get asset by valid URL
54
+ - ❌ Error: Get asset by invalid URL
55
+ - ❌ Error: Get asset by non-existent URL
56
+
57
+ #### Gallery Operations
58
+ - [ ] **getGalleries(guid, search?, pageSize?, rowIndex?)**
59
+ - ✅ Success: Get all galleries
60
+ - ✅ Success: Search galleries with filter
61
+ - ✅ Success: Paginated gallery results
62
+ - ✅ Success: Handle empty search results
63
+
64
+ - [ ] **getGalleryById(guid, id)**
65
+ - ✅ Success: Get existing gallery
66
+ - ❌ Error: Get non-existent gallery (404)
67
+
68
+ - [ ] **getGalleryByName(guid, galleryName)**
69
+ - ✅ Success: Get gallery by valid name
70
+ - ❌ Error: Get gallery by non-existent name
71
+
72
+ - [ ] **saveGallery(guid, gallery)**
73
+ - ✅ Success: Create new gallery
74
+ - ✅ Success: Update existing gallery
75
+ - ❌ Error: Invalid gallery data
76
+ - ❌ Error: Duplicate gallery name
77
+
78
+ - [ ] **deleteGallery(guid, id)**
79
+ - ✅ Success: Delete existing gallery
80
+ - ❌ Error: Delete non-existent gallery
81
+ - ❌ Error: Delete gallery with assets
82
+
83
+ #### Container & Upload Operations
84
+ - [ ] **getDefaultContainer(guid)**
85
+ - ✅ Success: Get default asset container
86
+ - ❌ Error: No default container configured
87
+
88
+ - [ ] **upload(formData, agilityFolderPath, guid, groupingID?)**
89
+ - ✅ Success: Upload single file to root
90
+ - ✅ Success: Upload to specific folder
91
+ - ✅ Success: Upload to gallery (with groupingID)
92
+ - ✅ Success: Upload multiple files
93
+ - ❌ Error: Invalid file format
94
+ - ❌ Error: File too large
95
+ - ❌ Error: Invalid folder path
96
+
97
+ #### Folder Operations
98
+ - [ ] **createFolder(originKey, guid)**
99
+ - ✅ Success: Create new folder
100
+ - ❌ Error: Create duplicate folder
101
+ - ❌ Error: Invalid folder name
102
+
103
+ - [ ] **deleteFolder(originKey, guid, mediaID?)**
104
+ - ✅ Success: Delete empty folder
105
+ - ✅ Success: Delete folder with assets
106
+ - ❌ Error: Delete non-existent folder
107
+
108
+ - [ ] **renameFolder(folderName, newFolderName, guid, mediaID?)**
109
+ - ✅ Success: Rename existing folder
110
+ - ❌ Error: Rename to existing folder name
111
+ - ❌ Error: Rename non-existent folder
112
+
113
+ ### 2. BatchMethods (`src/apiMethods/batchMethods.ts`)
114
+
115
+ #### Batch Retrieval & Types
116
+ - [ ] **getBatch(batchID, guid, expandItems?)**
117
+ - ✅ Success: Get batch with expanded items
118
+ - ✅ Success: Get batch without expanded items
119
+ - ❌ Error: Get non-existent batch (404)
120
+
121
+ - [ ] **getBatchTypes(guid)**
122
+ - ✅ Success: Get all batch enum types
123
+ - ✅ Validation: Verify enum structure and values
124
+
125
+ #### Batch Operations
126
+ - [ ] **publishBatch(batchID, guid, returnBatchId?)**
127
+ - ✅ Success: Publish batch and wait for completion
128
+ - ✅ Success: Publish batch and return immediately
129
+ - ❌ Error: Publish non-existent batch
130
+ - ❌ Error: Publish already published batch
131
+
132
+ - [ ] **unpublishBatch(batchID, guid, returnBatchId?)**
133
+ - ✅ Success: Unpublish batch and wait for completion
134
+ - ✅ Success: Unpublish batch and return immediately
135
+ - ❌ Error: Unpublish non-published batch
136
+
137
+ - [ ] **approveBatch(batchID, guid, returnBatchId?)**
138
+ - ✅ Success: Approve pending batch
139
+ - ❌ Error: Approve already approved batch
140
+ - ❌ Error: Approve batch without approval workflow
141
+
142
+ - [ ] **declineBatch(batchID, guid, returnBatchId?)**
143
+ - ✅ Success: Decline pending batch
144
+ - ❌ Error: Decline already processed batch
145
+
146
+ - [ ] **requestApprovalBatch(batchID, guid, returnBatchId?)**
147
+ - ✅ Success: Request approval for batch
148
+ - ❌ Error: Request approval for published batch
149
+
150
+ #### Utility Methods
151
+ - [ ] **Retry(method)** - Internal retry mechanism
152
+ - ✅ Success: Retry until batch completion
153
+ - ❌ Error: Timeout after max retries
154
+ - ❌ Error: Method throws unrecoverable error
155
+
156
+ - [ ] **delay(ms)** - Internal delay utility
157
+ - ✅ Success: Proper delay timing
158
+
159
+ ### 3. ClientInstance (`src/apiMethods/clientInstance.ts`)
160
+
161
+ #### URL Determination
162
+ - [ ] **determineBaseUrl(guid)**
163
+ - ✅ Success: Development environment (guid with 'd')
164
+ - ✅ Success: Production environment (guid with 'u')
165
+ - ✅ Success: US2 environment (guid with 'us2')
166
+ - ✅ Success: Canada environment (guid with 'c')
167
+ - ✅ Success: Europe environment (guid with 'e')
168
+ - ✅ Success: Australia environment (guid with 'a')
169
+ - ✅ Success: Default fallback for unknown pattern
170
+ - ✅ Success: Override with custom baseUrl option
171
+
172
+ #### Axios Instance Creation
173
+ - [ ] **getInstance(guid)**
174
+ - ✅ Success: Create instance with correct base URL
175
+ - ✅ Success: Verify maxContentLength and maxBodyLength settings
176
+
177
+ - [ ] **getAxiosInstance(guid)**
178
+ - ✅ Success: Create server-level axios instance
179
+ - ✅ Success: Verify correct API version path
180
+
181
+ #### HTTP Methods
182
+ - [ ] **executeGet(apiPath, guid, token)**
183
+ - ✅ Success: GET request with valid token
184
+ - ❌ Error: GET request with invalid token (401)
185
+ - ❌ Error: GET request to non-existent endpoint (404)
186
+
187
+ - [ ] **executePost(apiPath, guid, token, data)**
188
+ - ✅ Success: POST request with valid data
189
+ - ❌ Error: POST request with invalid data (400)
190
+ - ❌ Error: POST request with invalid token (401)
191
+
192
+ - [ ] **executeDelete(apiPath, guid, token, data?)**
193
+ - ✅ Success: DELETE request without data
194
+ - ✅ Success: DELETE request with data
195
+ - ❌ Error: DELETE request with invalid token (401)
196
+
197
+ - [ ] **executeServerGet(apiPath, guid, token)**
198
+ - ✅ Success: Server-level GET request
199
+ - ❌ Error: Server-level request with invalid token
200
+
201
+ ### 4. ContainerMethods (`src/apiMethods/containerMethods.ts`)
202
+
203
+ #### Container Retrieval
204
+ - [ ] **getContainerByID(id, guid)**
205
+ - ✅ Success: Get existing container by ID
206
+ - ❌ Error: Get non-existent container (404)
207
+
208
+ - [ ] **getContainersByModel(modelId, guid)**
209
+ - ✅ Success: Get containers for existing model
210
+ - ✅ Success: Handle empty results for model with no containers
211
+ - ❌ Error: Get containers for non-existent model
212
+
213
+ - [ ] **getContainerByReferenceName(referenceName, guid)**
214
+ - ✅ Success: Get existing container by reference name
215
+ - ✅ Success: Return null for non-existent container (404 handling)
216
+ - ❌ Error: Other errors (not 404) should throw
217
+
218
+ - [ ] **getContainerList(guid)**
219
+ - ✅ Success: Get all containers
220
+ - ✅ Success: Verify container structure and required fields
221
+
222
+ #### Container Security & Notifications
223
+ - [ ] **getContainerSecurity(id, guid)**
224
+ - ✅ Success: Get security settings for container
225
+ - ❌ Error: Get security for non-existent container
226
+
227
+ - [ ] **getNotificationList(id, guid)**
228
+ - ✅ Success: Get notifications for container
229
+ - ✅ Success: Handle empty notification list
230
+ - ❌ Error: Get notifications for non-existent container
231
+
232
+ #### Container Modification
233
+ - [ ] **saveContainer(container, guid, forceReferenceName?)**
234
+ - ✅ Success: Create new container
235
+ - ✅ Success: Update existing container
236
+ - ✅ Success: Force reference name update
237
+ - ❌ Error: Invalid container data
238
+ - ❌ Error: Duplicate reference name without force flag
239
+
240
+ - [ ] **deleteContainer(id, guid)**
241
+ - ✅ Success: Delete empty container
242
+ - ❌ Error: Delete container with content
243
+ - ❌ Error: Delete non-existent container
244
+
245
+ ### 5. ContentMethods (`src/apiMethods/contentMethods.ts`)
246
+
247
+ #### Content Item Operations
248
+ - [ ] **getContentItem(contentID, guid, locale)**
249
+ - ✅ Success: Get existing content item
250
+ - ❌ Error: Get non-existent content item (404)
251
+ - ❌ Error: Get content item for invalid locale
252
+
253
+ - [ ] **saveContentItem(contentItem, guid, locale, returnBatchId?)**
254
+ - ✅ Success: Create new content item
255
+ - ✅ Success: Update existing content item
256
+ - ✅ Success: Return batch ID immediately
257
+ - ❌ Error: Invalid content data
258
+ - ❌ Error: Missing required fields
259
+
260
+ - [ ] **saveContentItems(contentItems, guid, locale, returnBatchId?)**
261
+ - ✅ Success: Bulk create content items
262
+ - ✅ Success: Bulk update content items
263
+ - ✅ Success: Mixed create/update operations
264
+ - ❌ Error: Invalid content array
265
+ - ❌ Error: Partial failure handling
266
+
267
+ #### Content Workflow Operations
268
+ - [ ] **publishContent(contentID, guid, locale, comments?, returnBatchId?)**
269
+ - ✅ Success: Publish approved content
270
+ - ✅ Success: Publish with comments
271
+ - ✅ Success: Return batch ID immediately
272
+ - ❌ Error: Publish non-existent content
273
+ - ❌ Error: Publish content without approval (if required)
274
+
275
+ - [ ] **unPublishContent(contentID, guid, locale, comments?, returnBatchId?)**
276
+ - ✅ Success: Unpublish published content
277
+ - ✅ Success: Unpublish with comments
278
+ - ❌ Error: Unpublish non-published content
279
+
280
+ - [ ] **contentRequestApproval(contentID, guid, locale, comments?, returnBatchId?)**
281
+ - ✅ Success: Request approval for content
282
+ - ✅ Success: Request approval with comments
283
+ - ❌ Error: Request approval for published content
284
+
285
+ - [ ] **approveContent(contentID, guid, locale, comments?, returnBatchId?)**
286
+ - ✅ Success: Approve pending content
287
+ - ✅ Success: Approve with comments
288
+ - ❌ Error: Approve already approved content
289
+
290
+ - [ ] **declineContent(contentID, guid, locale, comments?, returnBatchId?)**
291
+ - ✅ Success: Decline pending content
292
+ - ✅ Success: Decline with comments
293
+ - ❌ Error: Decline already processed content
294
+
295
+ - [ ] **deleteContent(contentID, guid, locale, comments?, returnBatchId?)**
296
+ - ✅ Success: Delete existing content
297
+ - ✅ Success: Delete with comments
298
+ - ❌ Error: Delete non-existent content
299
+ - ❌ Error: Delete published content (if restricted)
300
+
301
+ #### Content Listing & Filtering
302
+ - [ ] **getContentItems(referenceName, guid, locale, listParams)**
303
+ - ✅ Success: Get content with basic list params
304
+ - ✅ Success: Get content with sorting
305
+ - ✅ Success: Get content with filtering
306
+ - ✅ Success: Get content with pagination
307
+ - ❌ Error: Get content for non-existent container
308
+
309
+ - [ ] **getContentList(referenceName, guid, locale, listParams, filterObject?)**
310
+ - ✅ Success: Get content list without filter
311
+ - ✅ Success: Get content list with filter object
312
+ - ✅ Success: Get content list with showDeleted flag
313
+ - ✅ Success: Complex filtering scenarios
314
+ - ❌ Error: Invalid filter object
315
+
316
+ #### Content History & Comments
317
+ - [ ] **getContentHistory(locale, guid, contentID, take?, skip?)**
318
+ - ✅ Success: Get content history with default params
319
+ - ✅ Success: Get content history with pagination
320
+ - ✅ Success: Handle empty history
321
+ - ❌ Error: Get history for non-existent content
322
+
323
+ - [ ] **getContentComments(locale, guid, contentID, take?, skip?)**
324
+ - ✅ Success: Get content comments with default params
325
+ - ✅ Success: Get content comments with pagination
326
+ - ✅ Success: Handle empty comments
327
+ - ❌ Error: Get comments for non-existent content
328
+
329
+ ### 6. InstanceMethods (`src/apiMethods/instanceMethods.ts`)
330
+
331
+ #### Locale Operations
332
+ - [ ] **getLocales(guid)**
333
+ - ✅ Success: Get all available locales
334
+ - ✅ Success: Verify locale structure (code, displayName, isActive)
335
+ - ❌ Error: Get locales with invalid credentials
336
+
337
+ ### 7. InstanceUserMethods (`src/apiMethods/instanceUserMethods.ts`)
338
+
339
+ #### User Management
340
+ - [ ] **getUsers(guid)**
341
+ - ✅ Success: Get all instance users
342
+ - ✅ Success: Verify user structure and roles
343
+ - ❌ Error: Get users without proper permissions
344
+
345
+ - [ ] **saveUser(emailAddress, roles, guid, firstName?, lastName?)**
346
+ - ✅ Success: Create new user with required fields
347
+ - ✅ Success: Create user with optional fields
348
+ - ✅ Success: Update existing user roles
349
+ - ❌ Error: Create user with invalid email
350
+ - ❌ Error: Create user with invalid roles
351
+ - ❌ Error: Duplicate user creation
352
+
353
+ - [ ] **deleteUser(userId, guid)**
354
+ - ✅ Success: Delete existing user
355
+ - ❌ Error: Delete non-existent user
356
+ - ❌ Error: Delete user without proper permissions
357
+
358
+ ### 8. ModelMethods (`src/apiMethods/modelMethods.ts`)
359
+
360
+ #### Model Retrieval
361
+ - [ ] **getContentModel(id, guid)**
362
+ - ✅ Success: Get existing content model by ID
363
+ - ❌ Error: Get non-existent model (404)
364
+
365
+ - [ ] **getModelByReferenceName(referenceName, guid)**
366
+ - ✅ Success: Get existing model by reference name
367
+ - ❌ Error: Get model by non-existent reference name
368
+
369
+ - [ ] **getContentModules(includeDefaults, guid, includeModules?)**
370
+ - ✅ Success: Get content modules with defaults
371
+ - ✅ Success: Get content modules without defaults
372
+ - ✅ Success: Get content modules with module details
373
+ - ✅ Success: Verify module structure and properties
374
+
375
+ - [ ] **getPageModules(includeDefault, guid)**
376
+ - ✅ Success: Get page modules with defaults
377
+ - ✅ Success: Get page modules without defaults
378
+ - ✅ Success: Verify page module structure
379
+
380
+ #### Model Modification
381
+ - [ ] **saveModel(model, guid)**
382
+ - ✅ Success: Create new model
383
+ - ✅ Success: Update existing model
384
+ - ❌ Error: Invalid model data
385
+ - ❌ Error: Duplicate model reference name
386
+
387
+ - [ ] **deleteModel(id, guid)**
388
+ - ✅ Success: Delete unused model
389
+ - ❌ Error: Delete model in use
390
+ - ❌ Error: Delete non-existent model
391
+
392
+ ### 9. PageMethods (`src/apiMethods/pageMethods.ts`)
393
+
394
+ #### Sitemap & Templates
395
+ - [ ] **getSitemap(guid, locale)**
396
+ - ✅ Success: Get complete sitemap
397
+ - ✅ Success: Verify sitemap structure and hierarchy
398
+ - ❌ Error: Get sitemap for invalid locale
399
+
400
+ - [ ] **getPageTemplates(guid, locale, includeModuleZones, searchFilter?)**
401
+ - ✅ Success: Get all page templates
402
+ - ✅ Success: Get templates with module zones
403
+ - ✅ Success: Get templates with search filter
404
+ - ✅ Success: Handle empty search results
405
+
406
+ - [ ] **getPageTemplate(guid, locale, pageTemplateId)**
407
+ - ✅ Success: Get existing page template by ID
408
+ - ❌ Error: Get non-existent template (404)
409
+
410
+ - [ ] **getPageTemplateName(guid, locale, templateName)**
411
+ - ✅ Success: Get existing page template by name
412
+ - ❌ Error: Get template by non-existent name
413
+
414
+ - [ ] **getPageItemTemplates(guid, locale, id)**
415
+ - ✅ Success: Get page template items/sections
416
+ - ✅ Success: Verify section definition structure
417
+ - ❌ Error: Get items for non-existent template
418
+
419
+ #### Template Management
420
+ - [ ] **savePageTemplate(guid, locale, pageModel)**
421
+ - ✅ Success: Create new page template
422
+ - ✅ Success: Update existing page template
423
+ - ❌ Error: Invalid page template data
424
+ - ❌ Error: Duplicate template name
425
+
426
+ - [ ] **deletePageTemplate(guid, locale, pageTemplateId)**
427
+ - ✅ Success: Delete unused page template
428
+ - ❌ Error: Delete template in use
429
+ - ❌ Error: Delete non-existent template
430
+
431
+ #### Page Operations
432
+ - [ ] **getPage(pageID, guid, locale)**
433
+ - ✅ Success: Get existing page
434
+ - ❌ Error: Get non-existent page (404)
435
+ - ❌ Error: Get page for invalid locale
436
+
437
+ - [ ] **savePage(pageItem, guid, locale, parentPageID?, placeBeforePageItemID?, returnBatchId?, pageIDInOtherLocale?, otherLocale?)**
438
+ - ✅ Success: Create new page with minimal params
439
+ - ✅ Success: Create page with parent page
440
+ - ✅ Success: Create page with positioning
441
+ - ✅ Success: Create page with locale linking
442
+ - ✅ Success: Update existing page
443
+ - ❌ Error: Invalid page data
444
+ - ❌ Error: Invalid parent page ID
445
+
446
+ #### Page Workflow Operations
447
+ - [ ] **publishPage(pageID, guid, locale, comments?, returnBatchId?)**
448
+ - ✅ Success: Publish approved page
449
+ - ✅ Success: Publish with comments
450
+ - ❌ Error: Publish non-existent page
451
+ - ❌ Error: Publish page without approval (if required)
452
+
453
+ - [ ] **unPublishPage(pageID, guid, locale, comments?, returnBatchId?)**
454
+ - ✅ Success: Unpublish published page
455
+ - ✅ Success: Unpublish with comments
456
+ - ❌ Error: Unpublish non-published page
457
+
458
+ - [ ] **pageRequestApproval(pageID, guid, locale, comments?, returnBatchId?)**
459
+ - ✅ Success: Request approval for page
460
+ - ✅ Success: Request approval with comments
461
+ - ❌ Error: Request approval for published page
462
+
463
+ - [ ] **approvePage(pageID, guid, locale, comments?, returnBatchId?)**
464
+ - ✅ Success: Approve pending page
465
+ - ✅ Success: Approve with comments
466
+ - ❌ Error: Approve already approved page
467
+
468
+ - [ ] **declinePage(pageID, guid, locale, comments?, returnBatchId?)**
469
+ - ✅ Success: Decline pending page
470
+ - ✅ Success: Decline with comments
471
+ - ❌ Error: Decline already processed page
472
+
473
+ - [ ] **deletePage(pageID, guid, locale, comments?, returnBatchId?)**
474
+ - ✅ Success: Delete existing page
475
+ - ✅ Success: Delete with comments
476
+ - ❌ Error: Delete non-existent page
477
+ - ❌ Error: Delete published page (if restricted)
478
+
479
+ #### Page History & Comments
480
+ - [ ] **getPageHistory(locale, guid, pageID, take?, skip?)**
481
+ - ✅ Success: Get page history with default params
482
+ - ✅ Success: Get page history with pagination
483
+ - ✅ Success: Handle empty history
484
+ - ❌ Error: Get history for non-existent page
485
+
486
+ - [ ] **getPageComments(locale, guid, pageID, take?, skip?)**
487
+ - ✅ Success: Get page comments with default params
488
+ - ✅ Success: Get page comments with pagination
489
+ - ✅ Success: Handle empty comments
490
+ - ❌ Error: Get comments for non-existent page
491
+
492
+ ### 10. ServerUserMethods (`src/apiMethods/serverUserMethods.ts`)
493
+
494
+ #### Server User Operations
495
+ - [ ] **me(guid)**
496
+ - ✅ Success: Get current user information
497
+ - ✅ Success: Verify user structure (id, email, permissions)
498
+ - ❌ Error: Get user info with invalid token
499
+
500
+ - [ ] **you(guid, serverUserID)**
501
+ - ✅ Success: Get specific user information
502
+ - ❌ Error: Get non-existent user
503
+ - ❌ Error: Get user without proper permissions
504
+
505
+ ### 11. WebhookMethods (`src/apiMethods/webhookMethods.ts`)
506
+
507
+ #### Webhook Management
508
+ - [ ] **webhookList(guid, take?, token?)**
509
+ - ✅ Success: Get all webhooks with default params
510
+ - ✅ Success: Get webhooks with custom page size
511
+ - ✅ Success: Handle empty webhook list
512
+
513
+ - [ ] **getWebhook(guid, webhookID)**
514
+ - ✅ Success: Get existing webhook
515
+ - ❌ Error: Get non-existent webhook (404)
516
+
517
+ - [ ] **saveWebhook(guid, webhook)**
518
+ - ✅ Success: Create new webhook
519
+ - ✅ Success: Update existing webhook
520
+ - ❌ Error: Invalid webhook data
521
+ - ❌ Error: Duplicate webhook URL
522
+
523
+ - [ ] **deleteWebhook(guid, webhookID)**
524
+ - ✅ Success: Delete existing webhook
525
+ - ❌ Error: Delete non-existent webhook
526
+
527
+ ## Integration Tests Overview
528
+
529
+ Integration tests validate that all Management API methods work correctly with real API endpoints. These tests ensure comprehensive coverage of SDK functionality without mocks.
530
+
531
+ ## Test Organization Structure
532
+
533
+ ### Test File Structure
534
+ ```
535
+ tests/
536
+ ├── integration/
537
+ │ ├── assets/
538
+ │ │ ├── assetMethods.test.ts
539
+ │ │ ├── galleries.test.ts
540
+ │ │ └── folders.test.ts
541
+ │ ├── batch/
542
+ │ │ ├── batchMethods.test.ts
543
+ │ │ └── batchWorkflow.test.ts
544
+ │ ├── content/
545
+ │ │ ├── contentMethods.test.ts
546
+ │ │ ├── contentWorkflow.test.ts
547
+ │ │ └── contentListing.test.ts
548
+ │ ├── pages/
549
+ │ │ ├── pageMethods.test.ts
550
+ │ │ ├── pageTemplates.test.ts
551
+ │ │ └── pageWorkflow.test.ts
552
+ │ ├── models/
553
+ │ │ └── modelMethods.test.ts
554
+ │ ├── containers/
555
+ │ │ └── containerMethods.test.ts
556
+ │ ├── users/
557
+ │ │ ├── instanceUserMethods.test.ts
558
+ │ │ └── serverUserMethods.test.ts
559
+ │ ├── webhooks/
560
+ │ │ └── webhookMethods.test.ts
561
+ │ ├── instance/
562
+ │ │ └── instanceMethods.test.ts
563
+ │ ├── client/
564
+ │ │ └── clientInstance.test.ts
565
+ ├── utils/
566
+ │ ├── fixtures.ts # Test data fixtures
567
+ │ ├── testClient.ts # Test client setup
568
+ │ ├── cleanup.ts # Test cleanup utilities
569
+ │ └── dependencies.ts # Dependency management utilities
570
+ └── setup.ts # Global test setup
571
+ ```
572
+
573
+ ### Test Priority Levels
574
+
575
+ #### Priority 1 (Critical) - Dependency-Ordered Core Operations
576
+ **Creation Order**: Galleries → Assets → Models → Containers → Content → Templates → Pages
577
+ - Gallery CRUD operations
578
+ - Asset upload/delete operations
579
+ - Model CRUD operations
580
+ - Container CRUD operations
581
+ - Content item CRUD operations
582
+ - Page template CRUD operations
583
+ - Page CRUD operations
584
+
585
+ #### Priority 2 (High) - Workflow Operations
586
+ - Content workflow (publish/unpublish/approve/decline)
587
+ - Page workflow operations
588
+ - Batch operations and polling
589
+
590
+ #### Priority 3 (Medium) - Advanced Features & Integration
591
+ - Asset gallery management
592
+ - Folder operations
593
+ - Content filtering and search
594
+ - Page template management
595
+ - User management operations
596
+ - Webhook management
597
+
598
+ #### Priority 4 (Low) - Utility & Edge Cases
599
+ - Client instance URL determination
600
+ - Retry mechanisms
601
+ - Error handling edge cases
602
+ - Pagination edge cases
603
+
604
+ ## Test Data Management
605
+
606
+ ### Test Data Strategy
607
+ 1. **Dedicated Test Content**: Create test-specific content models, containers, and content items
608
+ 2. **Dependency-Aware Creation**: Create test data in dependency order to avoid conflicts
609
+ 3. **Reverse-Order Cleanup**: Clean up test data in reverse dependency order
610
+ 4. **Data Isolation**: Use unique identifiers (timestamps, UUIDs) to avoid conflicts
611
+ 5. **Test Fixtures**: Create reusable test data fixtures for common scenarios
612
+
613
+ ### Test Data Dependencies & Creation Order
614
+
615
+ The following dependency chain must be respected for test data creation:
616
+
617
+ 1. **Galleries** → 2. **Assets** → 3. **Models** → 4. **Containers** → 5. **Content** → 6. **Templates** → 7. **Pages**
618
+
619
+ #### Creation Order Details:
620
+ 1. **Galleries**: Create asset galleries first (no dependencies)
621
+ 2. **Assets**: Upload assets to galleries and folders (depends on galleries)
622
+ 3. **Models**: Create content and page models (no dependencies on assets)
623
+ 4. **Containers**: Create containers using models (depends on models)
624
+ 5. **Content**: Create content items in containers (depends on containers, may reference assets)
625
+ 6. **Templates**: Create page templates using models (depends on models, may reference content)
626
+ 7. **Pages**: Create pages using templates and content (depends on templates, containers, content)
627
+
628
+ #### Cleanup Order (Reverse):
629
+ 7. **Pages** → 6. **Templates** → 5. **Content** → 4. **Containers** → 3. **Models** → 2. **Assets** → 1. **Galleries**
630
+
631
+ ### Required Test Models
632
+ - **TestArticle**: Basic content model for content operations
633
+ - **TestPage**: Basic page model for page operations
634
+ - **TestContainer**: Container for testing container operations
635
+ - **TestGallery**: Asset gallery for testing gallery operations
636
+ - **TestPageTemplate**: Page template for testing page operations
637
+
638
+ ### Environment-Specific Considerations
639
+ - **Development Environment**: Full test suite with create/delete operations
640
+ - **Staging Environment**: Read-only tests for critical operations
641
+ - **Production Environment**: No tests (safety measure)
642
+
643
+ ## Implementation Guidelines
644
+
645
+ ### Test Structure Standards
646
+ 1. **Arrange-Act-Assert**: Clear test structure
647
+ 2. **Descriptive Names**: Test names should clearly describe the scenario
648
+ 3. **Error Testing**: Always test both success and error scenarios
649
+ 4. **Dependency-Aware Cleanup**: Ensure proper cleanup of created test data in reverse dependency order
650
+ 5. **Retry Logic**: Implement retry logic for flaky network operations and CDN propagation
651
+ 6. **CDN Propagation Handling**: Account for CDN propagation delays with appropriate timeouts
652
+
653
+ ### Dependency Management Implementation
654
+
655
+ #### Test Data Creation Strategy
656
+ ```typescript
657
+ class TestDataManager {
658
+ private createdData: {
659
+ galleries: number[];
660
+ assets: number[];
661
+ models: number[];
662
+ containers: number[];
663
+ content: number[];
664
+ templates: number[];
665
+ pages: number[];
666
+ } = {
667
+ galleries: [],
668
+ assets: [],
669
+ models: [],
670
+ containers: [],
671
+ content: [],
672
+ templates: [],
673
+ pages: []
674
+ };
675
+
676
+ // Create test data in dependency order
677
+ async setupTestData(): Promise<void> {
678
+ // 1. Create galleries
679
+ const gallery = await this.createTestGallery();
680
+ this.createdData.galleries.push(gallery.id);
681
+
682
+ // 2. Upload assets (depends on galleries)
683
+ const asset = await this.uploadTestAsset(gallery.id);
684
+ this.createdData.assets.push(asset.mediaID);
685
+
686
+ // 3. Create models (no dependencies)
687
+ const model = await this.createTestModel();
688
+ this.createdData.models.push(model.id);
689
+
690
+ // 4. Create containers (depends on models)
691
+ const container = await this.createTestContainer(model.id);
692
+ this.createdData.containers.push(container.id);
693
+
694
+ // 5. Create content (depends on containers, may reference assets)
695
+ const content = await this.createTestContent(container.id, asset.url);
696
+ this.createdData.content.push(content.id);
697
+
698
+ // 6. Create templates (depends on models)
699
+ const template = await this.createTestTemplate(model.id);
700
+ this.createdData.templates.push(template.id);
701
+
702
+ // 7. Create pages (depends on templates, containers, content)
703
+ const page = await this.createTestPage(template.id, content.id);
704
+ this.createdData.pages.push(page.id);
705
+ }
706
+
707
+ // Clean up test data in reverse dependency order
708
+ async cleanupTestData(): Promise<void> {
709
+ try {
710
+ // 7. Delete pages first
711
+ for (const pageId of this.createdData.pages) {
712
+ await this.deleteTestPage(pageId);
713
+ }
714
+
715
+ // 6. Delete templates
716
+ for (const templateId of this.createdData.templates) {
717
+ await this.deleteTestTemplate(templateId);
718
+ }
719
+
720
+ // 5. Delete content
721
+ for (const contentId of this.createdData.content) {
722
+ await this.deleteTestContent(contentId);
723
+ }
724
+
725
+ // 4. Delete containers
726
+ for (const containerId of this.createdData.containers) {
727
+ await this.deleteTestContainer(containerId);
728
+ }
729
+
730
+ // 3. Delete models
731
+ for (const modelId of this.createdData.models) {
732
+ await this.deleteTestModel(modelId);
733
+ }
734
+
735
+ // 2. Delete assets
736
+ for (const assetId of this.createdData.assets) {
737
+ await this.deleteTestAsset(assetId);
738
+ }
739
+
740
+ // 1. Delete galleries last
741
+ for (const galleryId of this.createdData.galleries) {
742
+ await this.deleteTestGallery(galleryId);
743
+ }
744
+ } catch (error) {
745
+ console.error('Cleanup failed:', error);
746
+ // Continue cleanup even if some items fail
747
+ }
748
+ }
749
+ }
750
+ ```
751
+
752
+ #### CDN Test Implementation
753
+ ```typescript
754
+ class CDNValidator {
755
+ private config: CDNTestConfig;
756
+ private fetchClient: any; // Agility Fetch API client
757
+
758
+ async validateContentOnCDN(contentId: number, locale: string): Promise<boolean> {
759
+ // Wait for CDN propagation with exponential backoff
760
+ const maxAttempts = 10;
761
+ const baseDelay = 2000; // 2 seconds
762
+
763
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
764
+ try {
765
+ const cdnContent = await this.fetchClient.getContentItem({
766
+ contentID: contentId,
767
+ locale: locale
768
+ });
769
+
770
+ if (cdnContent) {
771
+ return await this.validateContentStructure(cdnContent);
772
+ }
773
+ } catch (error) {
774
+ if (attempt === maxAttempts) {
775
+ throw new Error(`Content ${contentId} not available on CDN after ${maxAttempts} attempts`);
776
+ }
777
+
778
+ // Exponential backoff
779
+ const delay = baseDelay * Math.pow(2, attempt - 1);
780
+ await new Promise(resolve => setTimeout(resolve, delay));
781
+ }
782
+ }
783
+
784
+ return false;
785
+ }
786
+
787
+ async validatePageOnCDN(pageId: number, locale: string): Promise<boolean> {
788
+ // Similar implementation for pages
789
+ // Include validation of page structure, modules, and content
790
+ }
791
+
792
+ async validateAssetOnCDN(assetUrl: string): Promise<boolean> {
793
+ try {
794
+ const response = await fetch(assetUrl);
795
+ return response.ok;
796
+ } catch (error) {
797
+ return false;
798
+ }
799
+ }
800
+ }
801
+ ```
802
+
803
+ ### Performance Considerations
804
+ 1. **Rate Limiting**: Implement delays between tests to respect API rate limits
805
+ 2. **Dependency-Aware Parallel Execution**: Group tests by dependency level for safe parallel execution
806
+ 3. **CDN Propagation Timeouts**: Set appropriate timeouts for CDN validation (30-60 seconds)
807
+ 4. **Test Duration**: Account for CDN propagation in test duration estimates
808
+ 5. **Resource Management**: Monitor API usage and CDN requests during test runs
809
+ 6. **Batch Operations**: Use batch operations where possible to reduce API calls
810
+
811
+ ### Coverage Metrics
812
+ - **Method Coverage**: 100% of public methods tested
813
+ - **Scenario Coverage**: Success, error, and edge cases covered
814
+ - **Parameter Coverage**: All parameter combinations tested
815
+ - **Integration Coverage**: End-to-end workflows tested
816
+
817
+ ## Test Execution Strategy
818
+
819
+ ### Test Suites
820
+ 1. **Smoke Tests**: Quick validation of core functionality
821
+ 2. **Regression Tests**: Full test suite for release validation
822
+ 3. **Workflow Tests**: End-to-end business process validation
823
+ 4. **Performance Tests**: API response time and throughput validation
824
+
825
+ ### Continuous Integration
826
+ - Run smoke tests on every commit
827
+ - Run full test suite on pull requests
828
+ - Run regression tests on releases
829
+ - Monitor test performance and API health
830
+
831
+ ## Success Criteria
832
+ - [ ] All 82 identified API methods have comprehensive test coverage
833
+ - [ ] All success scenarios are tested with real API calls
834
+ - [ ] All error scenarios are properly handled and tested
835
+ - [ ] **Dependency Management**: Test data creation and cleanup follows strict dependency order
836
+ - [ ] **End-to-End Flows**: Complete workflow operations are validated
837
+ - [ ] Test suite runs reliably in CI/CD environment with proper cleanup
838
+ - [ ] Test data is properly managed with zero test data leakage
839
+ - [ ] Test execution time is reasonable (< 30 minutes for full suite)
840
+ - [ ] Test results provide clear feedback on SDK functionality
841
+ - [ ] **Self-Cleaning Tests**: No manual intervention required for test data cleanup