@agility/management-sdk 0.1.33 → 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 (239) hide show
  1. package/.cursor/api-coverage.md +217 -0
  2. package/.cursor/github-actions-improvements.md +76 -0
  3. package/.cursor/hardening.md +271 -0
  4. package/.cursor/linting-fix.md +160 -0
  5. package/.cursor/mocks.md +100 -0
  6. package/.cursor/test-coverage.md +841 -0
  7. package/README.md +87 -315
  8. package/coverage/base.css +224 -0
  9. package/coverage/block-navigation.js +87 -0
  10. package/coverage/coverage-summary.json +43 -0
  11. package/coverage/favicon.png +0 -0
  12. package/coverage/index.html +161 -0
  13. package/coverage/lcov-report/base.css +224 -0
  14. package/coverage/lcov-report/block-navigation.js +87 -0
  15. package/coverage/lcov-report/favicon.png +0 -0
  16. package/coverage/lcov-report/index.html +161 -0
  17. package/coverage/lcov-report/prettify.css +1 -0
  18. package/coverage/lcov-report/prettify.js +2 -0
  19. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  20. package/coverage/lcov-report/sorter.js +210 -0
  21. package/coverage/lcov-report/src/apiClient.ts.html +199 -0
  22. package/coverage/lcov-report/src/apiMethods/assetMethods.ts.html +682 -0
  23. package/coverage/lcov-report/src/apiMethods/batchMethods.ts.html +736 -0
  24. package/coverage/lcov-report/src/apiMethods/clientInstance.ts.html +403 -0
  25. package/coverage/lcov-report/src/apiMethods/containerMethods.ts.html +460 -0
  26. package/coverage/lcov-report/src/apiMethods/contentMethods.ts.html +1183 -0
  27. package/coverage/lcov-report/src/apiMethods/index.html +266 -0
  28. package/coverage/lcov-report/src/apiMethods/instanceMethods.ts.html +160 -0
  29. package/coverage/lcov-report/src/apiMethods/instanceUserMethods.ts.html +268 -0
  30. package/coverage/lcov-report/src/apiMethods/modelMethods.ts.html +352 -0
  31. package/coverage/lcov-report/src/apiMethods/pageMethods.ts.html +1276 -0
  32. package/coverage/lcov-report/src/apiMethods/serverUserMethods.ts.html +196 -0
  33. package/coverage/lcov-report/src/apiMethods/webhookMethods.ts.html +271 -0
  34. package/coverage/lcov-report/src/enums/batchItemType.ts.html +106 -0
  35. package/coverage/lcov-report/src/enums/batchOperationType.ts.html +142 -0
  36. package/coverage/lcov-report/src/enums/batchState..ts.html +106 -0
  37. package/coverage/lcov-report/src/enums/index.html +161 -0
  38. package/coverage/lcov-report/src/enums/workflowOperationType.ts.html +175 -0
  39. package/coverage/lcov-report/src/index.html +116 -0
  40. package/coverage/lcov-report/src/models/assetContainer.ts.html +106 -0
  41. package/coverage/lcov-report/src/models/assetGalleries.ts.html +103 -0
  42. package/coverage/lcov-report/src/models/assetMediaGrouping.ts.html +136 -0
  43. package/coverage/lcov-report/src/models/assetMediaGroupingMetaData.ts.html +97 -0
  44. package/coverage/lcov-report/src/models/batch.ts.html +178 -0
  45. package/coverage/lcov-report/src/models/batchItem.ts.html +127 -0
  46. package/coverage/lcov-report/src/models/container.ts.html +232 -0
  47. package/coverage/lcov-report/src/models/contentDefinitionTypeID.ts.html +142 -0
  48. package/coverage/lcov-report/src/models/contentItem.ts.html +202 -0
  49. package/coverage/lcov-report/src/models/contentSectionDefaultModule.ts.html +106 -0
  50. package/coverage/lcov-report/src/models/contentSectionDefinition.ts.html +196 -0
  51. package/coverage/lcov-report/src/models/contentViewColumn.ts.html +109 -0
  52. package/coverage/lcov-report/src/models/exception.ts.html +109 -0
  53. package/coverage/lcov-report/src/models/index.html +476 -0
  54. package/coverage/lcov-report/src/models/instanceRole.ts.html +106 -0
  55. package/coverage/lcov-report/src/models/instanceUser.ts.html +130 -0
  56. package/coverage/lcov-report/src/models/locales.ts.html +100 -0
  57. package/coverage/lcov-report/src/models/media.ts.html +178 -0
  58. package/coverage/lcov-report/src/models/model.ts.html +172 -0
  59. package/coverage/lcov-report/src/models/notification.ts.html +124 -0
  60. package/coverage/lcov-report/src/models/options.ts.html +109 -0
  61. package/coverage/lcov-report/src/models/pageItem.ts.html +268 -0
  62. package/coverage/lcov-report/src/models/pageModel.ts.html +130 -0
  63. package/coverage/lcov-report/src/models/sharedModule.ts.html +106 -0
  64. package/coverage/lcov-report/src/models/sitemap.ts.html +148 -0
  65. package/coverage/lcov-report/src/models/websiteUser.ts.html +157 -0
  66. package/coverage/lcov.info +1459 -0
  67. package/coverage/prettify.css +1 -0
  68. package/coverage/prettify.js +2 -0
  69. package/coverage/sort-arrow-sprite.png +0 -0
  70. package/coverage/sorter.js +210 -0
  71. package/coverage/src/apiClient.ts.html +199 -0
  72. package/coverage/src/apiMethods/assetMethods.ts.html +682 -0
  73. package/coverage/src/apiMethods/batchMethods.ts.html +736 -0
  74. package/coverage/src/apiMethods/clientInstance.ts.html +403 -0
  75. package/coverage/src/apiMethods/containerMethods.ts.html +460 -0
  76. package/coverage/src/apiMethods/contentMethods.ts.html +1183 -0
  77. package/coverage/src/apiMethods/index.html +266 -0
  78. package/coverage/src/apiMethods/instanceMethods.ts.html +160 -0
  79. package/coverage/src/apiMethods/instanceUserMethods.ts.html +268 -0
  80. package/coverage/src/apiMethods/modelMethods.ts.html +352 -0
  81. package/coverage/src/apiMethods/pageMethods.ts.html +1276 -0
  82. package/coverage/src/apiMethods/serverUserMethods.ts.html +196 -0
  83. package/coverage/src/apiMethods/webhookMethods.ts.html +271 -0
  84. package/coverage/src/enums/batchItemType.ts.html +106 -0
  85. package/coverage/src/enums/batchOperationType.ts.html +142 -0
  86. package/coverage/src/enums/batchState..ts.html +106 -0
  87. package/coverage/src/enums/index.html +161 -0
  88. package/coverage/src/enums/workflowOperationType.ts.html +175 -0
  89. package/coverage/src/index.html +116 -0
  90. package/coverage/src/models/assetContainer.ts.html +106 -0
  91. package/coverage/src/models/assetGalleries.ts.html +103 -0
  92. package/coverage/src/models/assetMediaGrouping.ts.html +136 -0
  93. package/coverage/src/models/assetMediaGroupingMetaData.ts.html +97 -0
  94. package/coverage/src/models/batch.ts.html +178 -0
  95. package/coverage/src/models/batchItem.ts.html +127 -0
  96. package/coverage/src/models/container.ts.html +232 -0
  97. package/coverage/src/models/contentDefinitionTypeID.ts.html +142 -0
  98. package/coverage/src/models/contentItem.ts.html +202 -0
  99. package/coverage/src/models/contentSectionDefaultModule.ts.html +106 -0
  100. package/coverage/src/models/contentSectionDefinition.ts.html +196 -0
  101. package/coverage/src/models/contentViewColumn.ts.html +109 -0
  102. package/coverage/src/models/exception.ts.html +109 -0
  103. package/coverage/src/models/index.html +476 -0
  104. package/coverage/src/models/instanceRole.ts.html +106 -0
  105. package/coverage/src/models/instanceUser.ts.html +130 -0
  106. package/coverage/src/models/locales.ts.html +100 -0
  107. package/coverage/src/models/media.ts.html +178 -0
  108. package/coverage/src/models/model.ts.html +172 -0
  109. package/coverage/src/models/notification.ts.html +124 -0
  110. package/coverage/src/models/options.ts.html +109 -0
  111. package/coverage/src/models/pageItem.ts.html +268 -0
  112. package/coverage/src/models/pageModel.ts.html +130 -0
  113. package/coverage/src/models/sharedModule.ts.html +106 -0
  114. package/coverage/src/models/sitemap.ts.html +148 -0
  115. package/coverage/src/models/websiteUser.ts.html +157 -0
  116. package/dist/.tsbuildinfo +1 -0
  117. package/dist/apiClient.d.ts.map +1 -0
  118. package/dist/apiClient.js.map +1 -0
  119. package/dist/apiMethods/assetMethods.d.ts.map +1 -0
  120. package/dist/apiMethods/assetMethods.js.map +1 -0
  121. package/dist/apiMethods/batchMethods.d.ts.map +1 -0
  122. package/dist/apiMethods/batchMethods.js.map +1 -0
  123. package/dist/apiMethods/clientInstance.d.ts.map +1 -0
  124. package/dist/apiMethods/clientInstance.js.map +1 -0
  125. package/dist/apiMethods/containerMethods.d.ts.map +1 -0
  126. package/dist/apiMethods/containerMethods.js.map +1 -0
  127. package/dist/apiMethods/contentMethods.d.ts.map +1 -0
  128. package/dist/apiMethods/contentMethods.js.map +1 -0
  129. package/dist/apiMethods/instanceMethods.d.ts.map +1 -0
  130. package/dist/apiMethods/instanceMethods.js.map +1 -0
  131. package/dist/apiMethods/instanceUserMethods.d.ts.map +1 -0
  132. package/dist/apiMethods/instanceUserMethods.js.map +1 -0
  133. package/dist/apiMethods/modelMethods.d.ts.map +1 -0
  134. package/dist/apiMethods/modelMethods.js.map +1 -0
  135. package/dist/apiMethods/pageMethods.d.ts +2 -1
  136. package/dist/apiMethods/pageMethods.d.ts.map +1 -0
  137. package/dist/apiMethods/pageMethods.js +7 -1
  138. package/dist/apiMethods/pageMethods.js.map +1 -0
  139. package/dist/apiMethods/serverUserMethods.d.ts.map +1 -0
  140. package/dist/apiMethods/serverUserMethods.js.map +1 -0
  141. package/dist/apiMethods/webhookMethods.d.ts.map +1 -0
  142. package/dist/apiMethods/webhookMethods.js.map +1 -0
  143. package/dist/enums/assetGroupingType.d.ts.map +1 -0
  144. package/dist/enums/assetGroupingType.js.map +1 -0
  145. package/dist/enums/batchItemType.d.ts.map +1 -0
  146. package/dist/enums/batchItemType.js.map +1 -0
  147. package/dist/enums/batchOperationType.d.ts.map +1 -0
  148. package/dist/enums/batchOperationType.js.map +1 -0
  149. package/dist/enums/batchState..d.ts.map +1 -0
  150. package/dist/enums/batchState..js.map +1 -0
  151. package/dist/enums/pageItemTemplateType.d.ts.map +1 -0
  152. package/dist/enums/pageItemTemplateType.js.map +1 -0
  153. package/dist/enums/workflowOperationType.d.ts.map +1 -0
  154. package/dist/enums/workflowOperationType.js.map +1 -0
  155. package/dist/index.d.ts.map +1 -0
  156. package/dist/index.js.map +1 -0
  157. package/dist/models/assetContainer.d.ts.map +1 -0
  158. package/dist/models/assetContainer.js.map +1 -0
  159. package/dist/models/assetGalleries.d.ts.map +1 -0
  160. package/dist/models/assetGalleries.js.map +1 -0
  161. package/dist/models/assetMediaGrouping.d.ts.map +1 -0
  162. package/dist/models/assetMediaGrouping.js.map +1 -0
  163. package/dist/models/assetMediaGroupingMetaData.d.ts.map +1 -0
  164. package/dist/models/assetMediaGroupingMetaData.js.map +1 -0
  165. package/dist/models/batch.d.ts.map +1 -0
  166. package/dist/models/batch.js.map +1 -0
  167. package/dist/models/batchItem.d.ts.map +1 -0
  168. package/dist/models/batchItem.js.map +1 -0
  169. package/dist/models/batchTypes.d.ts.map +1 -0
  170. package/dist/models/batchTypes.js.map +1 -0
  171. package/dist/models/container.d.ts.map +1 -0
  172. package/dist/models/container.js.map +1 -0
  173. package/dist/models/contentDefinitionTypeID.d.ts.map +1 -0
  174. package/dist/models/contentDefinitionTypeID.js.map +1 -0
  175. package/dist/models/contentItem.d.ts.map +1 -0
  176. package/dist/models/contentItem.js.map +1 -0
  177. package/dist/models/contentItemHistory.d.ts.map +1 -0
  178. package/dist/models/contentItemHistory.js.map +1 -0
  179. package/dist/models/contentListFilterModel.d.ts.map +1 -0
  180. package/dist/models/contentListFilterModel.js.map +1 -0
  181. package/dist/models/contentSectionDefaultModule.d.ts.map +1 -0
  182. package/dist/models/contentSectionDefaultModule.js.map +1 -0
  183. package/dist/models/contentSectionDefinition.d.ts.map +1 -0
  184. package/dist/models/contentSectionDefinition.js.map +1 -0
  185. package/dist/models/contentViewColumn.d.ts.map +1 -0
  186. package/dist/models/contentViewColumn.js.map +1 -0
  187. package/dist/models/exception.d.ts.map +1 -0
  188. package/dist/models/exception.js.map +1 -0
  189. package/dist/models/instanceRole.d.ts.map +1 -0
  190. package/dist/models/instanceRole.js.map +1 -0
  191. package/dist/models/instanceUser.d.ts.map +1 -0
  192. package/dist/models/instanceUser.js.map +1 -0
  193. package/dist/models/itemComments.d.ts.map +1 -0
  194. package/dist/models/itemComments.js.map +1 -0
  195. package/dist/models/listParams.d.ts.map +1 -0
  196. package/dist/models/listParams.js.map +1 -0
  197. package/dist/models/locales.d.ts.map +1 -0
  198. package/dist/models/locales.js.map +1 -0
  199. package/dist/models/media.d.ts.map +1 -0
  200. package/dist/models/media.js.map +1 -0
  201. package/dist/models/model.d.ts.map +1 -0
  202. package/dist/models/model.js.map +1 -0
  203. package/dist/models/notification.d.ts.map +1 -0
  204. package/dist/models/notification.js.map +1 -0
  205. package/dist/models/options.d.ts.map +1 -0
  206. package/dist/models/options.js.map +1 -0
  207. package/dist/models/pageHistory.d.ts.map +1 -0
  208. package/dist/models/pageHistory.js.map +1 -0
  209. package/dist/models/pageItem.d.ts.map +1 -0
  210. package/dist/models/pageItem.js.map +1 -0
  211. package/dist/models/pageModel.d.ts.map +1 -0
  212. package/dist/models/pageModel.js.map +1 -0
  213. package/dist/models/serverUser.d.ts.map +1 -0
  214. package/dist/models/serverUser.js.map +1 -0
  215. package/dist/models/sharedModule.d.ts.map +1 -0
  216. package/dist/models/sharedModule.js.map +1 -0
  217. package/dist/models/sitemap.d.ts.map +1 -0
  218. package/dist/models/sitemap.js.map +1 -0
  219. package/dist/models/webhook.d.ts.map +1 -0
  220. package/dist/models/webhook.js.map +1 -0
  221. package/dist/models/websiteListing.d.ts.map +1 -0
  222. package/dist/models/websiteListing.js.map +1 -0
  223. package/dist/models/websiteUser.d.ts.map +1 -0
  224. package/dist/models/websiteUser.js.map +1 -0
  225. package/docs/asset-methods.md +382 -0
  226. package/docs/auth-component.md +361 -0
  227. package/docs/auth.md +594 -0
  228. package/docs/batch-methods.md +244 -0
  229. package/docs/cicd.md +607 -0
  230. package/docs/container-methods.md +268 -0
  231. package/docs/content-methods.md +423 -0
  232. package/docs/instance-methods.md +105 -0
  233. package/docs/instance-user-methods.md +231 -0
  234. package/docs/model-methods.md +434 -0
  235. package/docs/multi-instance-operations.md +192 -0
  236. package/docs/page-methods.md +671 -0
  237. package/docs/server-user-methods.md +280 -0
  238. package/docs/webhook-methods.md +452 -0
  239. package/package.json +1 -1
@@ -0,0 +1,217 @@
1
+ # API Methods Test Coverage Report
2
+
3
+ ## 🎯 **Current Status: 146/146 Tests Passing (100%) 🎉**
4
+
5
+ ### 📊 **Coverage Summary**
6
+
7
+ | API Method Class | Unit Tests | Integration Tests | Status | Methods Covered |
8
+ |------------------|------------|-------------------|--------|-----------------|
9
+ | **ModelMethods** | ✅ 16/16 | ✅ Diagnostic | **COMPLETE** | 6/6 methods |
10
+ | **AssetMethods** | ✅ 24/24 | ✅ Gallery Tests | **COMPLETE** | 15/15 methods |
11
+ | **ContainerMethods** | ✅ 16/16 | ✅ Diagnostic | **COMPLETE** | 8/8 methods |
12
+ | **WebhookMethods** | ✅ 14/14 | ❌ None | **UNIT ONLY** | 4/4 methods |
13
+ | **BatchMethods** | ✅ 19/19 | ❌ None | **UNIT ONLY** | 7/7 methods |
14
+ | **InstanceUserMethods** | ✅ 12/12 | ❌ None | **UNIT ONLY** | 3/3 methods |
15
+ | **ServerUserMethods** | ✅ 12/12 | ❌ None | **UNIT ONLY** | 2/2 methods |
16
+ | **InstanceMethods** | ❌ None | ✅ Basic Auth | **INTEGRATION ONLY** | 1/1 methods |
17
+ | **ContentMethods** | 🔄 Disabled | ✅ Basic Tests | **PARTIAL** | ~15 methods |
18
+ | **PageMethods** | 🔄 Disabled | ❌ None | **PARTIAL** | ~20 methods |
19
+
20
+ ---
21
+
22
+ ## ✅ **FULLY COVERED (3/10 classes)**
23
+
24
+ ### 🏆 **ModelMethods** - Content Model Operations
25
+ **Unit Tests: 16/16 ✅ | Integration: Diagnostic ✅**
26
+ - `getContentModel(id, guid)` - Retrieve model by ID
27
+ - `getModelByReferenceName(name, guid)` - Retrieve by reference name
28
+ - `getContentModules(includeDefaults, guid, includeModules)` - Get content modules
29
+ - `getPageModules(includeDefault, guid)` - Get page modules
30
+ - `saveModel(model, guid)` - Create/update model
31
+ - `deleteModel(id, guid)` - Delete model
32
+
33
+ ### 🏆 **AssetMethods** - Asset & Gallery Management
34
+ **Unit Tests: 24/24 ✅ | Integration: Gallery Tests ✅**
35
+ - **Gallery Operations:**
36
+ - `getGalleries(guid, search?, pageSize?, rowIndex?)` - List galleries
37
+ - `getGalleryById(guid, id)` - Get gallery by ID
38
+ - `getGalleryByName(guid, name)` - Get gallery by name
39
+ - `saveGallery(guid, gallery)` - Create/update gallery
40
+ - `deleteGallery(guid, id)` - Delete gallery
41
+ - **Asset Operations:**
42
+ - `getMediaList(pageSize, recordOffset, guid)` - List assets
43
+ - `getAssetByID(mediaID, guid)` - Get asset by ID
44
+ - `getAssetByUrl(url, guid)` - Get asset by URL
45
+ - `deleteFile(mediaID, guid)` - Delete asset
46
+ - `moveFile(mediaID, newFolder, guid)` - Move asset
47
+ - **Folder Operations:**
48
+ - `createFolder(originKey, guid)` - Create folder
49
+ - `renameFolder(folderName, newFolderName, guid, mediaID)` - Rename folder
50
+ - `deleteFolder(originKey, guid, mediaID)` - Delete folder
51
+ - **File Operations:**
52
+ - `upload(formData, agilityFolderPath, guid, groupingID)` - Upload files
53
+ - **Container Operations:**
54
+ - `getDefaultContainer(guid)` - Get default container
55
+
56
+ ### 🏆 **ContainerMethods** - Container Management
57
+ **Unit Tests: 16/16 ✅ | Integration: Diagnostic ✅**
58
+ - `getContainerList(guid)` - List all containers
59
+ - `getContainerByID(id, guid)` - Get container by ID
60
+ - `getContainerByReferenceName(name, guid)` - Get by reference name (returns null for 404)
61
+ - `getContainersByModel(modelId, guid)` - Get containers by model
62
+ - `getContainerSecurity(id, guid)` - Get container security
63
+ - `getNotificationList(id, guid)` - Get container notifications
64
+ - `saveContainer(container, guid, forceReferenceName?)` - Create/update container
65
+ - `deleteContainer(id, guid)` - Delete container
66
+
67
+ ### 🏆 **WebhookMethods** - Webhook Operations
68
+ **Unit Tests: 14/14 ✅ | Integration: None**
69
+ - `webhookList(guid, take?, token?)` - List webhooks
70
+ - `getWebhook(guid, webhookID)` - Get webhook by ID
71
+ - `saveWebhook(guid, webhook)` - Create/update webhook
72
+ - `deleteWebhook(guid, webhookID)` - Delete webhook
73
+
74
+ ---
75
+
76
+ ## 🔄 **UNIT ONLY COVERED (4/10 classes)**
77
+
78
+ ### ⚡ **BatchMethods** - Batch Processing
79
+ **Unit Tests: 19/19 ✅ | Integration: None**
80
+ - `getBatch(batchID, guid, expandItems?)` - Get batch by ID
81
+ - `publishBatch(batchID, guid, returnBatchId?)` - Publish batch
82
+ - `unpublishBatch(batchID, guid, returnBatchId?)` - Unpublish batch
83
+ - `approveBatch(batchID, guid, returnBatchId?)` - Approve batch
84
+ - `declineBatch(batchID, guid, returnBatchId?)` - Decline batch
85
+ - `requestApprovalBatch(batchID, guid, returnBatchId?)` - Request approval
86
+ - `getBatchTypes(guid)` - Get batch enum types
87
+
88
+ ### ⚡ **InstanceUserMethods** - User Management
89
+ **Unit Tests: 12/12 ✅ | Integration: None**
90
+ - `getUsers(guid)` - Get instance users
91
+ - `saveUser(emailAddress, roles, guid, firstName?, lastName?)` - Create/update user
92
+ - `deleteUser(userId, guid)` - Delete user
93
+
94
+ ### ⚡ **ServerUserMethods** - Server User Operations
95
+ **Unit Tests: 12/12 ✅ | Integration: None**
96
+ - `me(guid)` - Get current user info
97
+ - `you(guid, serverUserID)` - Get specific user info
98
+
99
+ ---
100
+
101
+ ## 🔄 **PARTIALLY COVERED (2/10 classes)**
102
+
103
+ ### ⚠️ **ContentMethods** - Content Item Operations
104
+ **Unit Tests: Disabled 🔄 | Integration: Basic ✅**
105
+
106
+ **Available Methods (~15 methods):**
107
+ - `getContentItem(contentID, guid, locale)` - Get content item
108
+ - `getContentItems(referenceName, guid, locale, listParams)` - Get content list
109
+ - `getContentList(referenceName, guid, locale, listParams, filter?)` - Get filtered content
110
+ - `saveContentItem(contentItem, guid, locale, returnBatchId?)` - Create/update content
111
+ - `saveContentItems(contentItems, guid, locale, returnBatchId?)` - Bulk save
112
+ - `publishContent(contentID, guid, locale, comments?, returnBatchId?)` - Publish content
113
+ - `unPublishContent(contentID, guid, locale, comments?, returnBatchId?)` - Unpublish
114
+ - `approveContent(contentID, guid, locale, comments?, returnBatchId?)` - Approve
115
+ - `declineContent(contentID, guid, locale, comments?, returnBatchId?)` - Decline
116
+ - `contentRequestApproval(contentID, guid, locale, comments?, returnBatchId?)` - Request approval
117
+ - `deleteContent(contentID, guid, locale, comments?, returnBatchId?)` - Delete
118
+ - `getContentHistory(locale, guid, contentID, take?, skip?)` - Get history
119
+ - `getContentComments(locale, guid, contentID, take?, skip?)` - Get comments
120
+
121
+ **Issues:** Most methods require `locale` parameter, complex batch operations with async polling
122
+
123
+ ### ⚠️ **PageMethods** - Page Operations
124
+ **Unit Tests: Disabled 🔄 | Integration: None**
125
+
126
+ **Available Methods (~20 methods):**
127
+ - **Page Operations:**
128
+ - `getPage(pageID, guid, locale)` - Get page by ID
129
+ - `savePage(pageItem, guid, locale, parentPageID?, placeBeforePageItemID?, returnBatchId?, pageIDInOtherLocale?, otherLocale?)` - Create/update page
130
+ - `deletePage(pageID, guid, locale, comments?, returnBatchId?)` - Delete page
131
+ - **Page Workflow:**
132
+ - `publishPage(pageID, guid, locale, comments?, returnBatchId?)` - Publish page
133
+ - `unPublishPage(pageID, guid, locale, comments?, returnBatchId?)` - Unpublish
134
+ - `approvePage(pageID, guid, locale, comments?, returnBatchId?)` - Approve
135
+ - `declinePage(pageID, guid, locale, comments?, returnBatchId?)` - Decline
136
+ - `pageRequestApproval(pageID, guid, locale, comments?, returnBatchId?)` - Request approval
137
+ - **Page Templates:**
138
+ - `getPageTemplates(guid, locale, includeModuleZones, searchFilter?)` - List templates
139
+ - `getPageTemplate(guid, locale, pageTemplateId)` - Get template by ID
140
+ - `getPageTemplateName(guid, locale, templateName)` - Get template by name
141
+ - `savePageTemplate(guid, locale, pageModel)` - Create/update template
142
+ - `deletePageTemplate(guid, locale, pageTemplateId)` - Delete template
143
+ - `getPageItemTemplates(guid, locale, id)` - Get page item templates
144
+ - **Other Operations:**
145
+ - `getSitemap(guid, locale)` - Get sitemap
146
+ - `getPageHistory(locale, guid, pageID, take?, skip?)` - Get page history
147
+ - `getPageComments(locale, guid, pageID, take?, skip?)` - Get page comments
148
+
149
+ **Issues:** All methods require `locale` parameter, complex batch operations
150
+
151
+ ### ⚠️ **BatchMethods** - Batch Processing
152
+ **Unit Tests: Disabled 🔄 | Integration: None**
153
+
154
+ **Available Methods (~7 methods):**
155
+ - `getBatch(batchID, guid, expandItems?)` - Get batch by ID
156
+ - `publishBatch(batchID, guid, returnBatchId?)` - Publish batch
157
+ - `unpublishBatch(batchID, guid, returnBatchId?)` - Unpublish batch
158
+ - `approveBatch(batchID, guid, returnBatchId?)` - Approve batch
159
+ - `declineBatch(batchID, guid, returnBatchId?)` - Decline batch
160
+ - `requestApprovalBatch(batchID, guid, returnBatchId?)` - Request approval
161
+ - `getBatchTypes(guid)` - Get batch enum types
162
+
163
+ ---
164
+
165
+ ## ❌ **NO COVERAGE (3/10 classes)**
166
+
167
+ ### 🔴 **InstanceMethods** - Instance Configuration
168
+ **Unit Tests: None | Integration: Basic Auth Only ✅**
169
+ - `getLocales(guid)` - Get available locales *(covered in integration)*
170
+
171
+ ### 🔴 **InstanceUserMethods** - User Management
172
+ **Unit Tests: None | Integration: None**
173
+ - `getUsers(guid)` - Get instance users
174
+ - `saveUser(emailAddress, roles, guid, firstName?, lastName?)` - Create/update user
175
+ - `deleteUser(userId, guid)` - Delete user
176
+
177
+ ### 🔴 **ServerUserMethods** - Server User Operations
178
+ **Unit Tests: None | Integration: None**
179
+ - `me(guid)` - Get current user info
180
+ - `you(guid, serverUserID)` - Get specific user info
181
+
182
+ ---
183
+
184
+ ## 🎯 **RECOMMENDATIONS**
185
+
186
+ ### **Priority 1: Complete Existing Coverage**
187
+ 1. **Fix ContentMethods Unit Tests** - Add `locale` parameters, fix method signatures
188
+ 2. **Fix PageMethods Unit Tests** - Add `locale` parameters, remove non-existent methods
189
+ 3. **Fix BatchMethods Unit Tests** - Simple fixes, only a few real methods
190
+
191
+ ### **Priority 2: Add Missing Coverage**
192
+ 1. **InstanceUserMethods** - User management operations
193
+ 2. **ServerUserMethods** - Server user operations
194
+ 3. **InstanceMethods** - Add unit tests (currently only integration)
195
+
196
+ ### **Priority 3: Enhance Integration Coverage**
197
+ 1. **WebhookMethods** - Add integration tests
198
+ 2. **ContentMethods** - Expand integration tests
199
+ 3. **PageMethods** - Add integration tests
200
+ 4. **BatchMethods** - Add integration tests
201
+
202
+ ---
203
+
204
+ ## 📈 **CURRENT METRICS**
205
+
206
+ - **Total API Classes**: 10
207
+ - **Fully Covered Classes**: 3 (30%) - Both unit + integration
208
+ - **Unit Only Covered Classes**: 4 (40%) - Comprehensive unit coverage
209
+ - **Partially Covered Classes**: 2 (20%) - ContentMethods, PageMethods
210
+ - **Integration Only Classes**: 1 (10%) - InstanceMethods
211
+ - **Total Unit Tests**: 113 (100% passing) ⬆️ +43 tests!
212
+ - **Total Integration Tests**: 33 (100% passing)
213
+ - **Overall Test Success Rate**: 146/146 (100%) 🎉 ⬆️ +43 tests!
214
+
215
+ **🚀 Major Achievement**: Added 43 new unit tests covering BatchMethods, InstanceUserMethods, and ServerUserMethods!
216
+
217
+ **Next Goal**: Fix ContentMethods and PageMethods disabled unit test suites to reach 9/10 classes with unit coverage!
@@ -0,0 +1,76 @@
1
+ # GitHub Actions Workflow Improvements
2
+
3
+ ## Summary
4
+ Updated the CI/CD pipeline to be more efficient, modern, and clearly labeled based on your requirements.
5
+
6
+ ## Key Changes Made
7
+
8
+ ### ✅ **Node.js Version Updates**
9
+ - **Before**: Testing on Node.js 16, 18, 20
10
+ - **After**: Testing on Node.js 20, 22 (focus on current LTS and latest)
11
+ - **Reasoning**: Node.js 16 is EOL, focus on supported versions
12
+
13
+ ### ✅ **Improved Job Names & Structure**
14
+ - **Before**: `quality`, `security`, `build`, `integration-test`, `performance-test`
15
+ - **After**:
16
+ - `code-quality-and-unit-tests` (clear separation)
17
+ - `integration-tests` (separate job for visibility)
18
+ - `security-audit` (clearer naming)
19
+ - `build-package` (descriptive naming)
20
+
21
+ ### ✅ **Streamlined Workflow**
22
+ - **Removed redundant jobs**: Eliminated duplicate integration test jobs and performance testing
23
+ - **Better step naming**: More descriptive step names like "ESLint code quality check" vs "Lint code"
24
+ - **Cleaner dependencies**: Simplified job dependency chain
25
+
26
+ ### ✅ **Enhanced Visibility**
27
+ - **Unit tests**: Run as part of code quality checks with matrix strategy
28
+ - **Integration tests**: Separate job that only runs on push to main/dev branches
29
+ - **Clear separation**: Each job has a distinct purpose and clear naming
30
+
31
+ ## New Workflow Structure
32
+
33
+ ```
34
+ CI/CD Pipeline
35
+ ├── Code Quality & Unit Tests (Node 20, 22)
36
+ │ ├── TypeScript type checking
37
+ │ ├── ESLint code quality check
38
+ │ ├── Prettier format check
39
+ │ └── Run unit tests
40
+ ├── Integration Tests (Node 20, only on push)
41
+ │ └── Run integration tests with secrets
42
+ ├── Security Audit (Node 20)
43
+ │ ├── Run security audit
44
+ │ └── Check for vulnerabilities
45
+ └── Build Package (Node 20)
46
+ ├── Clean build
47
+ ├── Build package
48
+ └── Upload artifacts
49
+ ```
50
+
51
+ ## Benefits
52
+
53
+ 1. **Faster feedback**: Unit tests and quality checks run in parallel on multiple Node versions
54
+ 2. **Resource efficiency**: Only test on supported Node.js versions (20, 22)
55
+ 3. **Clear separation**: Integration tests only run when needed (push to main/dev)
56
+ 4. **Better naming**: Job names clearly indicate what they do
57
+ 5. **Reduced complexity**: Removed redundant and overly complex jobs
58
+
59
+ ## GitHub Actions Display
60
+
61
+ The workflow will now show in GitHub as:
62
+ - ✅ **Code Quality & Unit Tests** (Node 20)
63
+ - ✅ **Code Quality & Unit Tests** (Node 22)
64
+ - ✅ **Integration Tests**
65
+ - ✅ **Security Audit**
66
+ - ✅ **Build Package**
67
+
68
+ This matches your desired pattern of clear, descriptive job names that indicate their purpose.
69
+
70
+ ## Next Steps
71
+
72
+ The workflow is now optimized and should resolve the failing checks you were seeing. The jobs will:
73
+ - Run faster (fewer Node versions, streamlined steps)
74
+ - Provide clearer feedback (better naming)
75
+ - Focus on what matters (current Node.js versions)
76
+ - Separate concerns properly (unit vs integration tests)
@@ -0,0 +1,271 @@
1
+ # Agility CMS Management SDK - Platform Hardening Plan
2
+
3
+ ## Current State Analysis
4
+
5
+ ### Codebase Overview
6
+ - **Project**: Agility CMS TypeScript SDK for Management API
7
+ - **Version**: 0.1.33
8
+ - **Architecture**: Class-based SDK with method modules
9
+ - **Build**: TypeScript → CommonJS (ES5 target)
10
+ - **Dependencies**: Minimal (axios, @types/node)
11
+
12
+ ### Current Gaps Identified
13
+ - ❌ No testing framework or tests
14
+ - ❌ No linting configuration (ESLint/Prettier)
15
+ - ❌ No CI/CD pipeline
16
+ - ❌ No commit validation
17
+ - ❌ No automated releases
18
+ - ❌ No pre-commit hooks
19
+ - ❌ Outdated TypeScript configuration
20
+ - ❌ No code quality enforcement
21
+ - ❌ No Slack integration
22
+
23
+ ## Hardening Phases
24
+
25
+ ### Phase 1: Foundation Setup
26
+ **Goal**: Establish code quality and development workflow foundations
27
+
28
+ #### Tasks:
29
+ 1. **Modern TypeScript Configuration**
30
+ - Upgrade to strict TypeScript settings
31
+ - Enable modern ES targets
32
+ - Add path mapping and module resolution
33
+
34
+ 2. **Linting & Formatting**
35
+ - ESLint with TypeScript support
36
+ - Prettier for code formatting
37
+ - Import sorting and organization
38
+ - Consistent code style enforcement
39
+
40
+ 3. **Pre-commit Hooks (Husky)**
41
+ - Lint staged files
42
+ - Format code automatically
43
+ - Validate commit messages
44
+ - Run type checking
45
+
46
+ ### Phase 2: Testing Infrastructure
47
+ **Goal**: Implement comprehensive testing with real API integration
48
+
49
+ #### Tasks:
50
+ 1. **Test Framework Setup**
51
+ - Jest with TypeScript support
52
+ - Test environment configuration
53
+ - API test utilities and helpers
54
+
55
+ 2. **Real API Integration Tests**
56
+ - Authentication flow testing
57
+ - Content CRUD operations
58
+ - Asset management operations
59
+ - Batch operations
60
+ - Error handling scenarios
61
+ - Rate limiting and retry logic
62
+
63
+ 3. **Test Configuration**
64
+ - Environment-based test configs
65
+ - Test data management
66
+ - Coverage reporting
67
+ - Parallel test execution
68
+
69
+ ### Phase 3: CI/CD Pipeline
70
+ **Goal**: Automated quality checks, testing, and deployment
71
+
72
+ #### Tasks:
73
+ 1. **GitHub Actions Workflow**
74
+ - Multi-node version testing (16, 18, 20)
75
+ - Parallel job execution
76
+ - Dependency caching
77
+ - Artifact management
78
+
79
+ 2. **Quality Gates**
80
+ - Linting checks
81
+ - Type checking
82
+ - Unit and integration tests
83
+ - Coverage thresholds
84
+ - Security scanning
85
+
86
+ 3. **Build & Package**
87
+ - Clean builds
88
+ - Declaration file generation
89
+ - Bundle size monitoring
90
+ - Dependency vulnerability checks
91
+
92
+ ### Phase 4: Release Automation
93
+ **Goal**: Semantic versioning and automated releases
94
+
95
+ #### Tasks:
96
+ 1. **Conventional Commits**
97
+ - Commit message validation
98
+ - Semantic release configuration
99
+ - Changelog generation
100
+ - Version bumping
101
+
102
+ 2. **Automated Releases**
103
+ - Dev branch → Canary releases
104
+ - Main branch → Stable releases
105
+ - NPM package publishing
106
+ - GitHub release creation
107
+ - Tag management
108
+
109
+ 3. **Release Notes**
110
+ - Automated changelog
111
+ - Breaking change detection
112
+ - Migration guides
113
+ - Release announcements
114
+
115
+ ### Phase 5: Monitoring & Notifications
116
+ **Goal**: Visibility and communication for deployments
117
+
118
+ #### Tasks:
119
+ 1. **Slack Integration**
120
+ - Deployment notifications
121
+ - Test failure alerts
122
+ - Release announcements
123
+ - Build status updates
124
+
125
+ 2. **Monitoring**
126
+ - Build metrics
127
+ - Test coverage trends
128
+ - Performance monitoring
129
+ - Dependency updates
130
+
131
+ ## Implementation Strategy
132
+
133
+ ### Parallel Execution Groups
134
+
135
+ **Group A: Foundation (Can run in parallel)**
136
+ - TypeScript configuration updates
137
+ - ESLint/Prettier setup
138
+ - Husky configuration
139
+
140
+ **Group B: Testing (Depends on Group A)**
141
+ - Jest setup and configuration
142
+ - Test utilities and helpers
143
+ - Initial test suite implementation
144
+
145
+ **Group C: CI/CD (Depends on Groups A & B)**
146
+ - GitHub Actions workflow
147
+ - Release automation
148
+ - Slack integration
149
+
150
+ ### File Structure Plan
151
+
152
+ ```
153
+ .github/
154
+ workflows/
155
+ ci.yml # Main CI/CD pipeline
156
+ release.yml # Release automation
157
+ PULL_REQUEST_TEMPLATE.md
158
+
159
+ .husky/
160
+ pre-commit # Lint and format
161
+ commit-msg # Validate commit format
162
+
163
+ tests/
164
+ integration/
165
+ content.test.ts # Content methods tests
166
+ assets.test.ts # Asset methods tests
167
+ batch.test.ts # Batch operations tests
168
+ utils/
169
+ testClient.ts # Test API client setup
170
+ fixtures.ts # Test data fixtures
171
+ jest.config.js # Jest configuration
172
+
173
+ .eslintrc.js # ESLint configuration
174
+ .prettierrc # Prettier configuration
175
+ commitlint.config.js # Commit validation
176
+ release.config.js # Semantic release config
177
+ ```
178
+
179
+ ## Environment Requirements
180
+
181
+ ### Development Environment
182
+ - Node.js 16+ (LTS recommended)
183
+ - Yarn package manager
184
+ - Git hooks enabled
185
+
186
+ ### CI/CD Environment Variables
187
+ - `NPM_TOKEN`: For package publishing
188
+ - `GITHUB_TOKEN`: For releases and tags
189
+ - `SLACK_WEBHOOK_URL`: For notifications
190
+ - `AGILITY_API_TOKEN`: For integration tests
191
+ - `AGILITY_INSTANCE_GUID`: For test instance
192
+
193
+ ### Test Environment
194
+ - Dedicated Agility CMS test instance
195
+ - Test content and assets
196
+ - Rate limiting considerations
197
+ - Cleanup procedures
198
+
199
+ ## Quality Standards
200
+
201
+ ### Code Quality
202
+ - 90%+ test coverage
203
+ - Zero linting errors
204
+ - Strict TypeScript compliance
205
+ - Consistent formatting
206
+
207
+ ### Performance
208
+ - Build time < 2 minutes
209
+ - Test suite < 5 minutes
210
+ - Bundle size monitoring
211
+ - Memory usage tracking
212
+
213
+ ### Security
214
+ - Dependency vulnerability scanning
215
+ - Secret detection
216
+ - Token rotation policies
217
+ - Access control reviews
218
+
219
+ ## Success Metrics
220
+
221
+ ### Development Experience
222
+ - Reduced manual testing time
223
+ - Faster feedback loops
224
+ - Consistent code quality
225
+ - Automated release process
226
+
227
+ ### Reliability
228
+ - Zero production breaks from releases
229
+ - Comprehensive error handling
230
+ - Robust retry mechanisms
231
+ - Graceful degradation
232
+
233
+ ### Visibility
234
+ - Clear build status
235
+ - Automated notifications
236
+ - Comprehensive logging
237
+ - Performance insights
238
+
239
+ ## Risk Mitigation
240
+
241
+ ### API Rate Limits
242
+ - Test throttling and delays
243
+ - Dedicated test instances
244
+ - Parallel test optimization
245
+ - Fallback mechanisms
246
+
247
+ ### Breaking Changes
248
+ - Semantic versioning enforcement
249
+ - Migration guide automation
250
+ - Backward compatibility testing
251
+ - Deprecation warnings
252
+
253
+ ### Security
254
+ - Token management
255
+ - Secret scanning
256
+ - Dependency updates
257
+ - Access reviews
258
+
259
+ ## Next Steps
260
+
261
+ 1. ✅ **Phase 1 Foundation** - Start with TypeScript, linting, and Husky setup
262
+ 2. 🔄 **Phase 2 Testing** - Implement comprehensive test suite
263
+ 3. ⏳ **Phase 3 CI/CD** - Build GitHub Actions pipeline
264
+ 4. ⏳ **Phase 4 Releases** - Configure automated releases
265
+ 5. ⏳ **Phase 5 Monitoring** - Add Slack integration and monitoring
266
+
267
+ ---
268
+
269
+ **Last Updated**: $(date)
270
+ **Status**: Planning Phase
271
+ **Next Review**: After Phase 1 completion