@agility/management-sdk 0.1.2 → 0.1.4-beta.1

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 (251) hide show
  1. package/.cursor/api-documentation-manifest.md +275 -0
  2. package/.cursor/api-functions-analysis.md +111 -0
  3. package/.cursor/docs-final-check.md +269 -0
  4. package/.cursor/manifest.md +153 -0
  5. package/.env +92 -0
  6. package/README.md +219 -352
  7. package/dist/apiClient.d.ts +86 -0
  8. package/dist/apiClient.js +229 -0
  9. package/dist/apiClient.js.map +1 -0
  10. package/dist/apiMethods/assetMethods.d.ts +28 -6
  11. package/dist/apiMethods/assetMethods.js +346 -74
  12. package/dist/apiMethods/assetMethods.js.map +1 -0
  13. package/dist/apiMethods/authMethods.d.ts +239 -0
  14. package/dist/apiMethods/authMethods.js +604 -0
  15. package/dist/apiMethods/batchMethods.d.ts +32 -1
  16. package/dist/apiMethods/batchMethods.js +324 -42
  17. package/dist/apiMethods/batchMethods.js.map +1 -0
  18. package/dist/apiMethods/clientInstance.d.ts +58 -4
  19. package/dist/apiMethods/clientInstance.js +383 -56
  20. package/dist/apiMethods/clientInstance.js.map +1 -0
  21. package/dist/apiMethods/containerMethods.d.ts +15 -7
  22. package/dist/apiMethods/containerMethods.js +199 -83
  23. package/dist/apiMethods/containerMethods.js.map +1 -0
  24. package/dist/apiMethods/contentMethods.d.ts +17 -10
  25. package/dist/apiMethods/contentMethods.js +432 -149
  26. package/dist/apiMethods/contentMethods.js.map +1 -0
  27. package/dist/apiMethods/instanceMethods.d.ts +9 -0
  28. package/dist/apiMethods/instanceMethods.js +69 -0
  29. package/dist/apiMethods/instanceMethods.js.map +1 -0
  30. package/dist/apiMethods/instanceUserMethods.d.ts +3 -3
  31. package/dist/apiMethods/instanceUserMethods.js +93 -39
  32. package/dist/apiMethods/instanceUserMethods.js.map +1 -0
  33. package/dist/apiMethods/modelMethods.d.ts +6 -5
  34. package/dist/apiMethods/modelMethods.js +150 -61
  35. package/dist/apiMethods/modelMethods.js.map +1 -0
  36. package/dist/apiMethods/pageMethods.d.ts +21 -9
  37. package/dist/apiMethods/pageMethods.js +500 -134
  38. package/dist/apiMethods/pageMethods.js.map +1 -0
  39. package/dist/apiMethods/serverUserMethods.d.ts +10 -0
  40. package/dist/apiMethods/serverUserMethods.js +89 -0
  41. package/dist/apiMethods/serverUserMethods.js.map +1 -0
  42. package/dist/apiMethods/webhookMethods.d.ts +12 -0
  43. package/dist/apiMethods/webhookMethods.js +131 -0
  44. package/dist/apiMethods/webhookMethods.js.map +1 -0
  45. package/dist/enums/assetGroupingType.d.ts +3 -0
  46. package/dist/enums/assetGroupingType.js +7 -0
  47. package/dist/enums/assetGroupingType.js.map +1 -0
  48. package/dist/enums/batchItemType.d.ts +7 -0
  49. package/dist/enums/batchItemType.js +11 -0
  50. package/dist/enums/batchOperationType.js +1 -1
  51. package/dist/enums/batchOperationType.js.map +1 -0
  52. package/dist/enums/batchState..js +1 -1
  53. package/dist/enums/batchState.d.ts +7 -0
  54. package/dist/enums/batchState.js +12 -0
  55. package/dist/enums/batchState.js.map +1 -0
  56. package/dist/enums/pageItemTemplateType.d.ts +4 -0
  57. package/dist/enums/pageItemTemplateType.js +8 -0
  58. package/dist/enums/pageItemTemplateType.js.map +1 -0
  59. package/dist/enums/workflowOperationType.d.ts +26 -0
  60. package/dist/enums/workflowOperationType.js +30 -0
  61. package/dist/errors/exception.d.ts +4 -0
  62. package/dist/errors/exception.js +11 -0
  63. package/dist/errors/exception.js.map +1 -0
  64. package/dist/index.d.ts +41 -9
  65. package/dist/index.js +48 -10
  66. package/dist/index.js.map +1 -0
  67. package/dist/models/assetContainer.d.ts +7 -0
  68. package/dist/models/assetContainer.js +9 -0
  69. package/dist/models/assetGalleries.d.ts +5 -0
  70. package/dist/models/assetGalleries.js +9 -0
  71. package/dist/models/assetMediaGrouping.d.ts +17 -0
  72. package/dist/models/assetMediaGrouping.js +9 -0
  73. package/dist/models/assetMediaGroupingMetaData.d.ts +4 -0
  74. package/dist/models/assetMediaGroupingMetaData.js +9 -0
  75. package/dist/models/authTokens.d.ts +73 -0
  76. package/dist/models/authTokens.js +2 -0
  77. package/dist/models/batch.js +5 -2
  78. package/dist/models/batchItem.d.ts +1 -0
  79. package/dist/models/batchItem.js +5 -2
  80. package/dist/models/batchRequests.d.ts +67 -0
  81. package/dist/models/batchRequests.js +2 -0
  82. package/dist/models/batchTypes.d.ts +34 -0
  83. package/dist/models/batchTypes.js +2 -0
  84. package/dist/models/container.d.ts +2 -1
  85. package/dist/models/container.js +5 -2
  86. package/dist/models/contentDefinitionTypeID.d.ts +17 -0
  87. package/dist/models/contentDefinitionTypeID.js +21 -0
  88. package/dist/models/contentItem.js +25 -10
  89. package/dist/models/contentItemHistory.d.ts +20 -0
  90. package/dist/models/contentItemHistory.js +15 -0
  91. package/dist/models/contentListFilterModel.d.ts +26 -0
  92. package/dist/models/contentListFilterModel.js +33 -0
  93. package/dist/models/contentSectionDefaultModule.d.ts +7 -0
  94. package/dist/models/contentSectionDefaultModule.js +9 -0
  95. package/dist/models/contentSectionDefinition.d.ts +35 -0
  96. package/dist/models/contentSectionDefinition.js +9 -0
  97. package/dist/models/contentViewColumn.js +5 -2
  98. package/dist/models/exception.js +23 -5
  99. package/dist/models/instanceRole.js +5 -2
  100. package/dist/models/instanceUser.js +5 -2
  101. package/dist/models/itemComments.d.ts +14 -0
  102. package/dist/models/itemComments.js +15 -0
  103. package/dist/models/listParams.d.ts +9 -0
  104. package/dist/models/listParams.js +16 -0
  105. package/dist/models/locales.d.ts +3 -0
  106. package/dist/models/locales.js +30 -0
  107. package/dist/models/media.js +10 -4
  108. package/dist/models/model.js +10 -4
  109. package/dist/models/notification.js +5 -2
  110. package/dist/models/options.d.ts +2 -5
  111. package/dist/models/options.js +4 -20
  112. package/dist/models/pageHistory.d.ts +21 -0
  113. package/dist/models/pageHistory.js +15 -0
  114. package/dist/models/pageItem.js +30 -12
  115. package/dist/models/pageModel.d.ts +14 -0
  116. package/dist/models/pageModel.js +9 -0
  117. package/dist/models/serverUser.d.ts +21 -0
  118. package/dist/models/serverUser.js +9 -0
  119. package/dist/models/sharedModule.d.ts +7 -0
  120. package/dist/models/sharedModule.js +9 -0
  121. package/dist/models/sitemap.js +10 -4
  122. package/dist/models/webhook.d.ts +9 -0
  123. package/dist/models/webhook.js +9 -0
  124. package/dist/models/websiteListing.d.ts +16 -0
  125. package/dist/models/websiteListing.js +9 -0
  126. package/dist/models/websiteUser.js +10 -4
  127. package/dist/tests/authHelper.d.ts +2 -0
  128. package/dist/tests/authHelper.js +14 -0
  129. package/dist/tests/authHelper.js.map +1 -0
  130. package/dist/tests/config/apiClient.config.d.ts +16 -0
  131. package/dist/tests/config/apiClient.config.js +84 -0
  132. package/dist/tests/config/apiClient.config.js.map +1 -0
  133. package/dist/tests/config/test.config.d.ts +24 -0
  134. package/dist/tests/config/test.config.js +47 -0
  135. package/dist/tests/config/test.config.js.map +1 -0
  136. package/dist/tokenStorage.d.ts +72 -0
  137. package/dist/tokenStorage.js +366 -0
  138. package/dist/types/apiResponse.d.ts +13 -0
  139. package/dist/types/apiResponse.js +3 -0
  140. package/dist/types/apiResponse.js.map +1 -0
  141. package/dist/types/assetContainer.d.ts +7 -0
  142. package/dist/types/assetContainer.js +3 -0
  143. package/dist/types/assetContainer.js.map +1 -0
  144. package/dist/types/assetGalleries.d.ts +5 -0
  145. package/dist/types/assetGalleries.js +3 -0
  146. package/dist/types/assetGalleries.js.map +1 -0
  147. package/dist/types/assetMediaGrouping.d.ts +17 -0
  148. package/dist/types/assetMediaGrouping.js +3 -0
  149. package/dist/types/assetMediaGrouping.js.map +1 -0
  150. package/dist/types/assetMediaGroupingMetaData.d.ts +4 -0
  151. package/dist/types/assetMediaGroupingMetaData.js +3 -0
  152. package/dist/types/assetMediaGroupingMetaData.js.map +1 -0
  153. package/dist/types/batch.d.ts +29 -0
  154. package/dist/types/batch.js +3 -0
  155. package/dist/types/batch.js.map +1 -0
  156. package/dist/types/batchItem.d.ts +13 -0
  157. package/dist/types/batchItem.js +3 -0
  158. package/dist/types/batchItem.js.map +1 -0
  159. package/dist/types/container.d.ts +47 -0
  160. package/dist/types/container.js +3 -0
  161. package/dist/types/container.js.map +1 -0
  162. package/dist/types/contentItem.d.ts +37 -0
  163. package/dist/types/contentItem.js +3 -0
  164. package/dist/types/contentItem.js.map +1 -0
  165. package/dist/types/contentItemHistory.d.ts +20 -0
  166. package/dist/types/contentItemHistory.js +3 -0
  167. package/dist/types/contentItemHistory.js.map +1 -0
  168. package/dist/types/contentListFilterModel.d.ts +26 -0
  169. package/dist/types/contentListFilterModel.js +3 -0
  170. package/dist/types/contentListFilterModel.js.map +1 -0
  171. package/dist/types/contentSectionDefaultModule.d.ts +7 -0
  172. package/dist/types/contentSectionDefaultModule.js +3 -0
  173. package/dist/types/contentSectionDefaultModule.js.map +1 -0
  174. package/dist/types/contentSectionDefinition.d.ts +35 -0
  175. package/dist/types/contentSectionDefinition.js +3 -0
  176. package/dist/types/contentSectionDefinition.js.map +1 -0
  177. package/dist/types/contentViewColumn.d.ts +8 -0
  178. package/dist/types/contentViewColumn.js +3 -0
  179. package/dist/types/contentViewColumn.js.map +1 -0
  180. package/dist/types/instanceRole.d.ts +7 -0
  181. package/dist/types/instanceRole.js +3 -0
  182. package/dist/types/instanceRole.js.map +1 -0
  183. package/dist/types/instanceUser.d.ts +14 -0
  184. package/dist/types/instanceUser.js +3 -0
  185. package/dist/types/instanceUser.js.map +1 -0
  186. package/dist/types/itemComments.d.ts +14 -0
  187. package/dist/types/itemComments.js +3 -0
  188. package/dist/types/itemComments.js.map +1 -0
  189. package/dist/types/listParams.d.ts +9 -0
  190. package/dist/types/listParams.js +3 -0
  191. package/dist/types/listParams.js.map +1 -0
  192. package/dist/types/locales.d.ts +1 -0
  193. package/dist/types/locales.js +3 -0
  194. package/dist/types/locales.js.map +1 -0
  195. package/dist/types/media.d.ts +30 -0
  196. package/dist/types/media.js +3 -0
  197. package/dist/types/media.js.map +1 -0
  198. package/dist/types/model.d.ts +30 -0
  199. package/dist/types/model.js +3 -0
  200. package/dist/types/model.js.map +1 -0
  201. package/dist/types/notification.d.ts +13 -0
  202. package/dist/types/notification.js +3 -0
  203. package/dist/types/notification.js.map +1 -0
  204. package/dist/types/options.d.ts +7 -0
  205. package/dist/types/options.js +3 -0
  206. package/dist/types/options.js.map +1 -0
  207. package/dist/types/pageHistory.d.ts +21 -0
  208. package/dist/types/pageHistory.js +3 -0
  209. package/dist/types/pageHistory.js.map +1 -0
  210. package/dist/types/pageItem.d.ts +56 -0
  211. package/dist/types/pageItem.js +3 -0
  212. package/dist/types/pageItem.js.map +1 -0
  213. package/dist/types/pageModel.d.ts +14 -0
  214. package/dist/types/pageModel.js +3 -0
  215. package/dist/types/pageModel.js.map +1 -0
  216. package/dist/types/serverUser.d.ts +21 -0
  217. package/dist/types/serverUser.js +3 -0
  218. package/dist/types/serverUser.js.map +1 -0
  219. package/dist/types/sharedModule.d.ts +7 -0
  220. package/dist/types/sharedModule.js +3 -0
  221. package/dist/types/sharedModule.js.map +1 -0
  222. package/dist/types/sitemap.d.ts +20 -0
  223. package/dist/types/sitemap.js +3 -0
  224. package/dist/types/sitemap.js.map +1 -0
  225. package/dist/types/tokenResponseData.d.ts +10 -0
  226. package/dist/types/tokenResponseData.js +3 -0
  227. package/dist/types/tokenResponseData.js.map +1 -0
  228. package/dist/types/webhook.d.ts +9 -0
  229. package/dist/types/webhook.js +3 -0
  230. package/dist/types/webhook.js.map +1 -0
  231. package/dist/types/websiteListing.d.ts +16 -0
  232. package/dist/types/websiteListing.js +3 -0
  233. package/dist/types/websiteListing.js.map +1 -0
  234. package/dist/types/websiteUser.d.ts +22 -0
  235. package/dist/types/websiteUser.js +3 -0
  236. package/dist/types/websiteUser.js.map +1 -0
  237. package/docs/asset-methods.md +382 -0
  238. package/docs/auth.md +594 -0
  239. package/docs/batch-methods.md +244 -0
  240. package/docs/cicd.md +607 -0
  241. package/docs/container-methods.md +268 -0
  242. package/docs/content-methods.md +423 -0
  243. package/docs/instance-methods.md +105 -0
  244. package/docs/instance-user-methods.md +231 -0
  245. package/docs/model-methods.md +434 -0
  246. package/docs/multi-instance-operations.md +192 -0
  247. package/docs/page-methods.md +671 -0
  248. package/docs/server-user-methods.md +280 -0
  249. package/docs/webhook-methods.md +452 -0
  250. package/package.json +14 -10
  251. package/tsconfig.json +2 -2
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=webhook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/types/webhook.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ export interface WebsiteListing {
2
+ orgCode: string | null;
3
+ orgName: string | null;
4
+ websiteName: string | null;
5
+ websiteNameStripped: string | null;
6
+ displayName: string | null;
7
+ guid: string | null;
8
+ websiteID: number;
9
+ isCurrent: boolean;
10
+ managerUrl: string | null;
11
+ version: string | null;
12
+ isOwner: boolean;
13
+ isDormant: boolean;
14
+ isRestoring: boolean;
15
+ teamID: number | null;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=websiteListing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websiteListing.js","sourceRoot":"","sources":["../../src/types/websiteListing.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import { InstanceRole } from "./instanceRole";
2
+ export interface WebsiteUser {
3
+ userID: number | null;
4
+ userName: string | null;
5
+ firstName: string | null;
6
+ lastName: string | null;
7
+ emailAddress: string | null;
8
+ isDeleted: boolean;
9
+ fullName: string | null;
10
+ isTeamUser: boolean;
11
+ isSuspended: boolean;
12
+ teamID: number | null;
13
+ userRoles: InstanceRole[];
14
+ userPermissions: InstancePermission[];
15
+ loginDate: string | null;
16
+ isOrgAdmin: boolean;
17
+ }
18
+ export interface InstancePermission {
19
+ permissionType: string | null;
20
+ permissionID: number;
21
+ name: string | null;
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=websiteUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websiteUser.js","sourceRoot":"","sources":["../../src/types/websiteUser.ts"],"names":[],"mappings":""}
@@ -0,0 +1,382 @@
1
+ # Agility CMS & Management API TypeScript SDK
2
+
3
+ ## AssetMethods
4
+
5
+ This class provides comprehensive file and media management operations for the Agility CMS platform. It handles file uploads, downloads, folder management, and gallery operations.
6
+
7
+ **Important Notes:**
8
+ - All file operations require proper authentication and valid GUID
9
+ - FormData uploads support multiple file types and formats
10
+ - Gallery operations are used for organizing media assets
11
+
12
+ ### Function List
13
+ - [upload](#upload) - Uploads files to Agility CMS
14
+ - [deleteFile](#deletefile) - Deletes a specific file by media ID
15
+ - [moveFile](#movefile) - Moves a file to a different folder
16
+ - [getMediaList](#getmedialist) - Retrieves paginated list of media assets
17
+ - [getAssetByID](#getassetbyid) - Retrieves a specific media asset by ID
18
+ - [getAssetByUrl](#getassetbyurl) - Retrieves a media asset by URL
19
+ - [createFolder](#createfolder) - Creates a new folder in media library
20
+ - [deleteFolder](#deletefolder) - Deletes a folder from media library
21
+ - [renameFolder](#renamefolder) - Renames an existing folder
22
+ - [getGalleries](#getgalleries) - Retrieves list of media galleries
23
+ - [getGalleryById](#getgallerybyid) - Retrieves a specific gallery by ID
24
+ - [getGalleryByName](#getgallerybyname) - Retrieves a gallery by name
25
+ - [getDefaultContainer](#getdefaultcontainer) - Retrieves the default asset container
26
+ - [saveGallery](#savegallery) - Creates or updates a media gallery
27
+ - [deleteGallery](#deletegallery) - Deletes a gallery by ID
28
+
29
+ ---
30
+
31
+ ### upload
32
+
33
+ Uploads one or more files to a specified folder path in Agility CMS.
34
+
35
+ | Parameter | Type | Required | Description |
36
+ |-----------|------|----------|-------------|
37
+ | `formData` | `FormData` | Yes | FormData object containing files to upload |
38
+ | `agilityFolderPath` | `string` | Yes | Target folder path in Agility CMS |
39
+ | `guid` | `string` | Yes | Current website GUID |
40
+ | `groupingID` | `number` | No | Gallery grouping ID *(Optional, default: -1)* |
41
+
42
+ **Returns:** `Media[]` - Array of uploaded media objects
43
+
44
+ **Usage Example:**
45
+ ```typescript
46
+ const form = new FormData();
47
+ form.append('files', file, 'myFile.jpg');
48
+
49
+ const uploadedFiles = await apiClient.assetMethods.upload(
50
+ form,
51
+ '/images/products',
52
+ guid,
53
+ 123
54
+ );
55
+ ```
56
+
57
+ **Error Handling:**
58
+ - Throws `Exception` when upload fails or folder path is invalid
59
+
60
+ ### deleteFile
61
+
62
+ Deletes a specific file from Agility CMS by its media ID.
63
+
64
+ | Parameter | Type | Required | Description |
65
+ |-----------|------|----------|-------------|
66
+ | `mediaID` | `number` | Yes | The media ID of the file to delete |
67
+ | `guid` | `string` | Yes | Current website GUID |
68
+
69
+ **Returns:** `string` - Confirmation message of successful deletion
70
+
71
+ **Usage Example:**
72
+ ```typescript
73
+ const result = await apiClient.assetMethods.deleteFile(12345, guid);
74
+ console.log(result); // "File deleted successfully"
75
+ ```
76
+
77
+ **Error Handling:**
78
+ - Throws `Exception` when file not found or deletion fails
79
+
80
+ ### moveFile
81
+
82
+ Moves a file to a different folder location within Agility CMS.
83
+
84
+ | Parameter | Type | Required | Description |
85
+ |-----------|------|----------|-------------|
86
+ | `mediaID` | `number` | Yes | The media ID of the file to move |
87
+ | `newFolder` | `string` | Yes | Target folder path |
88
+ | `guid` | `string` | Yes | Current website GUID |
89
+
90
+ **Returns:** `Media` - Updated media object with new location
91
+
92
+ **Usage Example:**
93
+ ```typescript
94
+ const movedFile = await apiClient.assetMethods.moveFile(
95
+ 12345,
96
+ '/images/archived',
97
+ guid
98
+ );
99
+ ```
100
+
101
+ **Error Handling:**
102
+ - Throws `Exception` when file or target folder not found
103
+
104
+ ### getMediaList
105
+
106
+ Retrieves a paginated list of media assets.
107
+
108
+ | Parameter | Type | Required | Description |
109
+ |-----------|------|----------|-------------|
110
+ | `pageSize` | `number` | Yes | Number of items per page |
111
+ | `recordOffset` | `number` | Yes | Number of records to skip |
112
+ | `guid` | `string` | Yes | Current website GUID |
113
+
114
+ **Returns:** `AssetMediaList` - Paginated list of media assets
115
+
116
+ **Usage Example:**
117
+ ```typescript
118
+ const mediaList = await apiClient.assetMethods.getMediaList(50, 0, guid);
119
+ console.log(`Total items: ${mediaList.totalCount}`);
120
+ ```
121
+
122
+ **Error Handling:**
123
+ - Throws `Exception` when retrieval fails
124
+
125
+ ### getAssetByID
126
+
127
+ Retrieves a specific media asset by its ID.
128
+
129
+ | Parameter | Type | Required | Description |
130
+ |-----------|------|----------|-------------|
131
+ | `mediaID` | `number` | Yes | The media ID to retrieve |
132
+ | `guid` | `string` | Yes | Current website GUID |
133
+
134
+ **Returns:** `Media` - Media object with complete asset information
135
+
136
+ **Usage Example:**
137
+ ```typescript
138
+ const asset = await apiClient.assetMethods.getAssetByID(12345, guid);
139
+ console.log(asset.url);
140
+ ```
141
+
142
+ **Error Handling:**
143
+ - Throws `Exception` when asset not found
144
+
145
+ ### getAssetByUrl
146
+
147
+ Retrieves a media asset by its URL.
148
+
149
+ | Parameter | Type | Required | Description |
150
+ |-----------|------|----------|-------------|
151
+ | `url` | `string` | Yes | The URL of the asset to retrieve |
152
+ | `guid` | `string` | Yes | Current website GUID |
153
+
154
+ **Returns:** `Media` - Media object matching the URL
155
+
156
+ **Usage Example:**
157
+ ```typescript
158
+ const asset = await apiClient.assetMethods.getAssetByUrl(
159
+ 'https://cdn.agilitycms.com/myfile.jpg',
160
+ guid
161
+ );
162
+ ```
163
+
164
+ **Error Handling:**
165
+ - Throws `Exception` when asset not found by URL
166
+
167
+ ### createFolder
168
+
169
+ Creates a new folder in the Agility CMS media library.
170
+
171
+ | Parameter | Type | Required | Description |
172
+ |-----------|------|----------|-------------|
173
+ | `originKey` | `string` | Yes | Unique identifier for the folder |
174
+ | `guid` | `string` | Yes | Current website GUID |
175
+
176
+ **Returns:** `Media` - Created folder object
177
+
178
+ **Usage Example:**
179
+ ```typescript
180
+ const newFolder = await apiClient.assetMethods.createFolder(
181
+ '/images/new-category',
182
+ guid
183
+ );
184
+ ```
185
+
186
+ **Error Handling:**
187
+ - Throws `Exception` when folder creation fails or path already exists
188
+
189
+ ### deleteFolder
190
+
191
+ Deletes a folder from the Agility CMS media library.
192
+
193
+ | Parameter | Type | Required | Description |
194
+ |-----------|------|----------|-------------|
195
+ | `originKey` | `string` | Yes | Folder path identifier |
196
+ | `guid` | `string` | Yes | Current website GUID |
197
+ | `mediaID` | `number` | No | Media ID of the folder *(Optional, default: 0)* |
198
+
199
+ **Returns:** `void` - No return value
200
+
201
+ **Usage Example:**
202
+ ```typescript
203
+ await apiClient.assetMethods.deleteFolder('/images/old-category', guid, 456);
204
+ ```
205
+
206
+ **Error Handling:**
207
+ - Throws `Exception` when folder not found or contains files
208
+
209
+ ### renameFolder
210
+
211
+ Renames an existing folder in the media library.
212
+
213
+ | Parameter | Type | Required | Description |
214
+ |-----------|------|----------|-------------|
215
+ | `folderName` | `string` | Yes | Current folder name |
216
+ | `newFolderName` | `string` | Yes | New folder name |
217
+ | `guid` | `string` | Yes | Current website GUID |
218
+ | `mediaID` | `number` | No | Media ID of the folder *(Optional, default: 0)* |
219
+
220
+ **Returns:** `void` - No return value
221
+
222
+ **Usage Example:**
223
+ ```typescript
224
+ await apiClient.assetMethods.renameFolder(
225
+ 'old-name',
226
+ 'new-name',
227
+ guid,
228
+ 456
229
+ );
230
+ ```
231
+
232
+ **Error Handling:**
233
+ - Throws `Exception` when folder not found or name conflict exists
234
+
235
+ ### getGalleries
236
+
237
+ Retrieves a list of media galleries with optional search filtering.
238
+
239
+ | Parameter | Type | Required | Description |
240
+ |-----------|------|----------|-------------|
241
+ | `guid` | `string` | Yes | Current website GUID |
242
+ | `search` | `string` | No | Search term to filter galleries *(Optional)* |
243
+ | `pageSize` | `number` | No | Number of galleries per page *(Optional)* |
244
+ | `rowIndex` | `number` | No | Starting row index *(Optional)* |
245
+
246
+ **Returns:** `assetGalleries` - Collection of gallery objects
247
+
248
+ **Usage Example:**
249
+ ```typescript
250
+ const galleries = await apiClient.assetMethods.getGalleries(
251
+ guid,
252
+ 'product',
253
+ 20,
254
+ 0
255
+ );
256
+ ```
257
+
258
+ **Error Handling:**
259
+ - Throws `Exception` when retrieval fails
260
+
261
+ ### getGalleryById
262
+
263
+ Retrieves a specific gallery by its ID.
264
+
265
+ | Parameter | Type | Required | Description |
266
+ |-----------|------|----------|-------------|
267
+ | `guid` | `string` | Yes | Current website GUID |
268
+ | `id` | `number` | Yes | Gallery ID to retrieve |
269
+
270
+ **Returns:** `assetMediaGrouping` - Gallery object with metadata
271
+
272
+ **Usage Example:**
273
+ ```typescript
274
+ const gallery = await apiClient.assetMethods.getGalleryById(guid, 123);
275
+ console.log(gallery.name);
276
+ ```
277
+
278
+ **Error Handling:**
279
+ - Throws `Exception` when gallery not found
280
+
281
+ ### getGalleryByName
282
+
283
+ Retrieves a gallery by its name.
284
+
285
+ | Parameter | Type | Required | Description |
286
+ |-----------|------|----------|-------------|
287
+ | `guid` | `string` | Yes | Current website GUID |
288
+ | `galleryName` | `string` | Yes | Name of the gallery to retrieve |
289
+
290
+ **Returns:** `assetMediaGrouping` - Gallery object matching the name
291
+
292
+ **Usage Example:**
293
+ ```typescript
294
+ const gallery = await apiClient.assetMethods.getGalleryByName(
295
+ guid,
296
+ 'Product Images'
297
+ );
298
+ ```
299
+
300
+ **Error Handling:**
301
+ - Throws `Exception` when gallery not found by name
302
+
303
+ ### getDefaultContainer
304
+
305
+ Retrieves the default asset container for the website.
306
+
307
+ | Parameter | Type | Required | Description |
308
+ |-----------|------|----------|-------------|
309
+ | `guid` | `string` | Yes | Current website GUID |
310
+
311
+ **Returns:** `assetContainer` - Default container configuration
312
+
313
+ **Usage Example:**
314
+ ```typescript
315
+ const container = await apiClient.assetMethods.getDefaultContainer(guid);
316
+ console.log(container.name);
317
+ ```
318
+
319
+ **Error Handling:**
320
+ - Throws `Exception` when container retrieval fails
321
+
322
+ ### saveGallery
323
+
324
+ Creates or updates a media gallery.
325
+
326
+ | Parameter | Type | Required | Description |
327
+ |-----------|------|----------|-------------|
328
+ | `guid` | `string` | Yes | Current website GUID |
329
+ | `gallery` | `assetMediaGrouping` | Yes | Gallery object to save |
330
+
331
+ **Returns:** `assetMediaGrouping` - Saved gallery object with updated metadata
332
+
333
+ **Usage Example:**
334
+ ```typescript
335
+ const gallery = {
336
+ name: 'New Product Gallery',
337
+ description: 'Images for product showcase'
338
+ };
339
+
340
+ const savedGallery = await apiClient.assetMethods.saveGallery(guid, gallery);
341
+ ```
342
+
343
+ **Error Handling:**
344
+ - Throws `Exception` when save operation fails
345
+
346
+ ### deleteGallery
347
+
348
+ Deletes a gallery by its ID.
349
+
350
+ | Parameter | Type | Required | Description |
351
+ |-----------|------|----------|-------------|
352
+ | `guid` | `string` | Yes | Current website GUID |
353
+ | `id` | `number` | Yes | Gallery ID to delete |
354
+
355
+ **Returns:** `string` - Confirmation message of successful deletion
356
+
357
+ **Usage Example:**
358
+ ```typescript
359
+ const result = await apiClient.assetMethods.deleteGallery(guid, 123);
360
+ console.log(result); // "Gallery deleted successfully"
361
+ ```
362
+
363
+ **Error Handling:**
364
+ - Throws `Exception` when gallery not found or deletion fails
365
+
366
+ ---
367
+
368
+ ## Navigation
369
+ - [← Back to Main Documentation](../README.md)
370
+ - [Authentication & Setup](./auth.md)
371
+ - [CI/CD & Automated Environments](./cicd.md)
372
+ - [BatchMethods](./batch-methods.md)
373
+ - [ContainerMethods](./container-methods.md)
374
+ - [ContentMethods](./content-methods.md)
375
+ - [InstanceMethods](./instance-methods.md)
376
+ - [InstanceUserMethods](./instance-user-methods.md)
377
+ - [ModelMethods](./model-methods.md)
378
+ - [PageMethods](./page-methods.md)
379
+ - [ServerUserMethods](./server-user-methods.md)
380
+ - [WebhookMethods](./webhook-methods.md)
381
+ - [Multi-Instance Operations](./multi-instance-operations.md)
382
+