@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.
- package/.cursor/api-documentation-manifest.md +275 -0
- package/.cursor/api-functions-analysis.md +111 -0
- package/.cursor/docs-final-check.md +269 -0
- package/.cursor/manifest.md +153 -0
- package/.env +92 -0
- package/README.md +219 -352
- package/dist/apiClient.d.ts +86 -0
- package/dist/apiClient.js +229 -0
- package/dist/apiClient.js.map +1 -0
- package/dist/apiMethods/assetMethods.d.ts +28 -6
- package/dist/apiMethods/assetMethods.js +346 -74
- package/dist/apiMethods/assetMethods.js.map +1 -0
- package/dist/apiMethods/authMethods.d.ts +239 -0
- package/dist/apiMethods/authMethods.js +604 -0
- package/dist/apiMethods/batchMethods.d.ts +32 -1
- package/dist/apiMethods/batchMethods.js +324 -42
- package/dist/apiMethods/batchMethods.js.map +1 -0
- package/dist/apiMethods/clientInstance.d.ts +58 -4
- package/dist/apiMethods/clientInstance.js +383 -56
- package/dist/apiMethods/clientInstance.js.map +1 -0
- package/dist/apiMethods/containerMethods.d.ts +15 -7
- package/dist/apiMethods/containerMethods.js +199 -83
- package/dist/apiMethods/containerMethods.js.map +1 -0
- package/dist/apiMethods/contentMethods.d.ts +17 -10
- package/dist/apiMethods/contentMethods.js +432 -149
- package/dist/apiMethods/contentMethods.js.map +1 -0
- package/dist/apiMethods/instanceMethods.d.ts +9 -0
- package/dist/apiMethods/instanceMethods.js +69 -0
- package/dist/apiMethods/instanceMethods.js.map +1 -0
- package/dist/apiMethods/instanceUserMethods.d.ts +3 -3
- package/dist/apiMethods/instanceUserMethods.js +93 -39
- package/dist/apiMethods/instanceUserMethods.js.map +1 -0
- package/dist/apiMethods/modelMethods.d.ts +6 -5
- package/dist/apiMethods/modelMethods.js +150 -61
- package/dist/apiMethods/modelMethods.js.map +1 -0
- package/dist/apiMethods/pageMethods.d.ts +21 -9
- package/dist/apiMethods/pageMethods.js +500 -134
- package/dist/apiMethods/pageMethods.js.map +1 -0
- package/dist/apiMethods/serverUserMethods.d.ts +10 -0
- package/dist/apiMethods/serverUserMethods.js +89 -0
- package/dist/apiMethods/serverUserMethods.js.map +1 -0
- package/dist/apiMethods/webhookMethods.d.ts +12 -0
- package/dist/apiMethods/webhookMethods.js +131 -0
- package/dist/apiMethods/webhookMethods.js.map +1 -0
- package/dist/enums/assetGroupingType.d.ts +3 -0
- package/dist/enums/assetGroupingType.js +7 -0
- package/dist/enums/assetGroupingType.js.map +1 -0
- package/dist/enums/batchItemType.d.ts +7 -0
- package/dist/enums/batchItemType.js +11 -0
- package/dist/enums/batchOperationType.js +1 -1
- package/dist/enums/batchOperationType.js.map +1 -0
- package/dist/enums/batchState..js +1 -1
- package/dist/enums/batchState.d.ts +7 -0
- package/dist/enums/batchState.js +12 -0
- package/dist/enums/batchState.js.map +1 -0
- package/dist/enums/pageItemTemplateType.d.ts +4 -0
- package/dist/enums/pageItemTemplateType.js +8 -0
- package/dist/enums/pageItemTemplateType.js.map +1 -0
- package/dist/enums/workflowOperationType.d.ts +26 -0
- package/dist/enums/workflowOperationType.js +30 -0
- package/dist/errors/exception.d.ts +4 -0
- package/dist/errors/exception.js +11 -0
- package/dist/errors/exception.js.map +1 -0
- package/dist/index.d.ts +41 -9
- package/dist/index.js +48 -10
- package/dist/index.js.map +1 -0
- package/dist/models/assetContainer.d.ts +7 -0
- package/dist/models/assetContainer.js +9 -0
- package/dist/models/assetGalleries.d.ts +5 -0
- package/dist/models/assetGalleries.js +9 -0
- package/dist/models/assetMediaGrouping.d.ts +17 -0
- package/dist/models/assetMediaGrouping.js +9 -0
- package/dist/models/assetMediaGroupingMetaData.d.ts +4 -0
- package/dist/models/assetMediaGroupingMetaData.js +9 -0
- package/dist/models/authTokens.d.ts +73 -0
- package/dist/models/authTokens.js +2 -0
- package/dist/models/batch.js +5 -2
- package/dist/models/batchItem.d.ts +1 -0
- package/dist/models/batchItem.js +5 -2
- package/dist/models/batchRequests.d.ts +67 -0
- package/dist/models/batchRequests.js +2 -0
- package/dist/models/batchTypes.d.ts +34 -0
- package/dist/models/batchTypes.js +2 -0
- package/dist/models/container.d.ts +2 -1
- package/dist/models/container.js +5 -2
- package/dist/models/contentDefinitionTypeID.d.ts +17 -0
- package/dist/models/contentDefinitionTypeID.js +21 -0
- package/dist/models/contentItem.js +25 -10
- package/dist/models/contentItemHistory.d.ts +20 -0
- package/dist/models/contentItemHistory.js +15 -0
- package/dist/models/contentListFilterModel.d.ts +26 -0
- package/dist/models/contentListFilterModel.js +33 -0
- package/dist/models/contentSectionDefaultModule.d.ts +7 -0
- package/dist/models/contentSectionDefaultModule.js +9 -0
- package/dist/models/contentSectionDefinition.d.ts +35 -0
- package/dist/models/contentSectionDefinition.js +9 -0
- package/dist/models/contentViewColumn.js +5 -2
- package/dist/models/exception.js +23 -5
- package/dist/models/instanceRole.js +5 -2
- package/dist/models/instanceUser.js +5 -2
- package/dist/models/itemComments.d.ts +14 -0
- package/dist/models/itemComments.js +15 -0
- package/dist/models/listParams.d.ts +9 -0
- package/dist/models/listParams.js +16 -0
- package/dist/models/locales.d.ts +3 -0
- package/dist/models/locales.js +30 -0
- package/dist/models/media.js +10 -4
- package/dist/models/model.js +10 -4
- package/dist/models/notification.js +5 -2
- package/dist/models/options.d.ts +2 -5
- package/dist/models/options.js +4 -20
- package/dist/models/pageHistory.d.ts +21 -0
- package/dist/models/pageHistory.js +15 -0
- package/dist/models/pageItem.js +30 -12
- package/dist/models/pageModel.d.ts +14 -0
- package/dist/models/pageModel.js +9 -0
- package/dist/models/serverUser.d.ts +21 -0
- package/dist/models/serverUser.js +9 -0
- package/dist/models/sharedModule.d.ts +7 -0
- package/dist/models/sharedModule.js +9 -0
- package/dist/models/sitemap.js +10 -4
- package/dist/models/webhook.d.ts +9 -0
- package/dist/models/webhook.js +9 -0
- package/dist/models/websiteListing.d.ts +16 -0
- package/dist/models/websiteListing.js +9 -0
- package/dist/models/websiteUser.js +10 -4
- package/dist/tests/authHelper.d.ts +2 -0
- package/dist/tests/authHelper.js +14 -0
- package/dist/tests/authHelper.js.map +1 -0
- package/dist/tests/config/apiClient.config.d.ts +16 -0
- package/dist/tests/config/apiClient.config.js +84 -0
- package/dist/tests/config/apiClient.config.js.map +1 -0
- package/dist/tests/config/test.config.d.ts +24 -0
- package/dist/tests/config/test.config.js +47 -0
- package/dist/tests/config/test.config.js.map +1 -0
- package/dist/tokenStorage.d.ts +72 -0
- package/dist/tokenStorage.js +366 -0
- package/dist/types/apiResponse.d.ts +13 -0
- package/dist/types/apiResponse.js +3 -0
- package/dist/types/apiResponse.js.map +1 -0
- package/dist/types/assetContainer.d.ts +7 -0
- package/dist/types/assetContainer.js +3 -0
- package/dist/types/assetContainer.js.map +1 -0
- package/dist/types/assetGalleries.d.ts +5 -0
- package/dist/types/assetGalleries.js +3 -0
- package/dist/types/assetGalleries.js.map +1 -0
- package/dist/types/assetMediaGrouping.d.ts +17 -0
- package/dist/types/assetMediaGrouping.js +3 -0
- package/dist/types/assetMediaGrouping.js.map +1 -0
- package/dist/types/assetMediaGroupingMetaData.d.ts +4 -0
- package/dist/types/assetMediaGroupingMetaData.js +3 -0
- package/dist/types/assetMediaGroupingMetaData.js.map +1 -0
- package/dist/types/batch.d.ts +29 -0
- package/dist/types/batch.js +3 -0
- package/dist/types/batch.js.map +1 -0
- package/dist/types/batchItem.d.ts +13 -0
- package/dist/types/batchItem.js +3 -0
- package/dist/types/batchItem.js.map +1 -0
- package/dist/types/container.d.ts +47 -0
- package/dist/types/container.js +3 -0
- package/dist/types/container.js.map +1 -0
- package/dist/types/contentItem.d.ts +37 -0
- package/dist/types/contentItem.js +3 -0
- package/dist/types/contentItem.js.map +1 -0
- package/dist/types/contentItemHistory.d.ts +20 -0
- package/dist/types/contentItemHistory.js +3 -0
- package/dist/types/contentItemHistory.js.map +1 -0
- package/dist/types/contentListFilterModel.d.ts +26 -0
- package/dist/types/contentListFilterModel.js +3 -0
- package/dist/types/contentListFilterModel.js.map +1 -0
- package/dist/types/contentSectionDefaultModule.d.ts +7 -0
- package/dist/types/contentSectionDefaultModule.js +3 -0
- package/dist/types/contentSectionDefaultModule.js.map +1 -0
- package/dist/types/contentSectionDefinition.d.ts +35 -0
- package/dist/types/contentSectionDefinition.js +3 -0
- package/dist/types/contentSectionDefinition.js.map +1 -0
- package/dist/types/contentViewColumn.d.ts +8 -0
- package/dist/types/contentViewColumn.js +3 -0
- package/dist/types/contentViewColumn.js.map +1 -0
- package/dist/types/instanceRole.d.ts +7 -0
- package/dist/types/instanceRole.js +3 -0
- package/dist/types/instanceRole.js.map +1 -0
- package/dist/types/instanceUser.d.ts +14 -0
- package/dist/types/instanceUser.js +3 -0
- package/dist/types/instanceUser.js.map +1 -0
- package/dist/types/itemComments.d.ts +14 -0
- package/dist/types/itemComments.js +3 -0
- package/dist/types/itemComments.js.map +1 -0
- package/dist/types/listParams.d.ts +9 -0
- package/dist/types/listParams.js +3 -0
- package/dist/types/listParams.js.map +1 -0
- package/dist/types/locales.d.ts +1 -0
- package/dist/types/locales.js +3 -0
- package/dist/types/locales.js.map +1 -0
- package/dist/types/media.d.ts +30 -0
- package/dist/types/media.js +3 -0
- package/dist/types/media.js.map +1 -0
- package/dist/types/model.d.ts +30 -0
- package/dist/types/model.js +3 -0
- package/dist/types/model.js.map +1 -0
- package/dist/types/notification.d.ts +13 -0
- package/dist/types/notification.js +3 -0
- package/dist/types/notification.js.map +1 -0
- package/dist/types/options.d.ts +7 -0
- package/dist/types/options.js +3 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/pageHistory.d.ts +21 -0
- package/dist/types/pageHistory.js +3 -0
- package/dist/types/pageHistory.js.map +1 -0
- package/dist/types/pageItem.d.ts +56 -0
- package/dist/types/pageItem.js +3 -0
- package/dist/types/pageItem.js.map +1 -0
- package/dist/types/pageModel.d.ts +14 -0
- package/dist/types/pageModel.js +3 -0
- package/dist/types/pageModel.js.map +1 -0
- package/dist/types/serverUser.d.ts +21 -0
- package/dist/types/serverUser.js +3 -0
- package/dist/types/serverUser.js.map +1 -0
- package/dist/types/sharedModule.d.ts +7 -0
- package/dist/types/sharedModule.js +3 -0
- package/dist/types/sharedModule.js.map +1 -0
- package/dist/types/sitemap.d.ts +20 -0
- package/dist/types/sitemap.js +3 -0
- package/dist/types/sitemap.js.map +1 -0
- package/dist/types/tokenResponseData.d.ts +10 -0
- package/dist/types/tokenResponseData.js +3 -0
- package/dist/types/tokenResponseData.js.map +1 -0
- package/dist/types/webhook.d.ts +9 -0
- package/dist/types/webhook.js +3 -0
- package/dist/types/webhook.js.map +1 -0
- package/dist/types/websiteListing.d.ts +16 -0
- package/dist/types/websiteListing.js +3 -0
- package/dist/types/websiteListing.js.map +1 -0
- package/dist/types/websiteUser.d.ts +22 -0
- package/dist/types/websiteUser.js +3 -0
- package/dist/types/websiteUser.js.map +1 -0
- package/docs/asset-methods.md +382 -0
- package/docs/auth.md +594 -0
- package/docs/batch-methods.md +244 -0
- package/docs/cicd.md +607 -0
- package/docs/container-methods.md +268 -0
- package/docs/content-methods.md +423 -0
- package/docs/instance-methods.md +105 -0
- package/docs/instance-user-methods.md +231 -0
- package/docs/model-methods.md +434 -0
- package/docs/multi-instance-operations.md +192 -0
- package/docs/page-methods.md +671 -0
- package/docs/server-user-methods.md +280 -0
- package/docs/webhook-methods.md +452 -0
- package/package.json +14 -10
- package/tsconfig.json +2 -2
package/README.md
CHANGED
|
@@ -1,396 +1,263 @@
|
|
|
1
1
|
# Agility CMS & Management API TypeScript SDK
|
|
2
2
|
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [About the Management API SDK](#about-the-management-api-sdk)
|
|
6
|
+
- [Getting Started](#getting-started)
|
|
7
|
+
- [Authentication & Setup](./docs/auth.md)
|
|
8
|
+
- [API Method Classes](#api-method-classes)
|
|
9
|
+
- [Examples](#examples)
|
|
10
|
+
- [TypeScript Interfaces](#typescript-interfaces)
|
|
11
|
+
- [Available Enums](#available-enums)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
3
15
|
## About the Management API SDK
|
|
4
16
|
|
|
5
17
|
- Provides a facility to developers to use the new Agility Management API more effectively.
|
|
6
18
|
- Provides methods to perform operations on Assets, Batches, Containers, Content, Models, Pages, and Users.
|
|
7
|
-
-
|
|
19
|
+
- **Content and Page Creation** - Create individual or multiple content items and pages (which automatically get added to batches).
|
|
20
|
+
- **Essential batch workflow operations** - Perform publish, unpublish, approve, decline, and request approval operations on existing batches.
|
|
8
21
|
- Ability to generate Content in bulk for a Website.
|
|
22
|
+
- **Strongly typed TypeScript interfaces** for all batch operations with comprehensive error handling.
|
|
9
23
|
|
|
10
24
|
## Getting Started
|
|
11
25
|
|
|
12
26
|
### Prerequisites
|
|
13
27
|
1. Clone the repository agility-cms-management-sdk-typescript.
|
|
14
28
|
2. Import the index file to make use of the Options class.
|
|
15
|
-
3.
|
|
16
|
-
- token -> Bearer token to authenticate a Rest Request to perform an operation.
|
|
17
|
-
- locale -> The locale under which your application is hosted. Example en-us.
|
|
18
|
-
- guid -> The guid under which your application is hosted.
|
|
19
|
-
4. Create an object of Method class(es), which can be used to create and perform operations. Following is the description of Classes and their respective methods -
|
|
29
|
+
3. You will need valid Agility CMS credentials to authenticate and obtain an access token.
|
|
20
30
|
|
|
21
|
-
###
|
|
22
|
-
|
|
23
|
-
import * as index from "./index";
|
|
31
|
+
### Authentication
|
|
32
|
+
For detailed authentication instructions, including OAuth 2.0 setup, token management, and security best practices, see the **[Authentication & Setup Guide](./docs/auth.md)**.
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
let options = new index.Options();
|
|
34
|
+
### Making a Request
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
#### Simple OAuth Authentication (Recommended)
|
|
37
|
+
```typescript
|
|
38
|
+
import * as mgmtApi from "@agility/management-sdk";
|
|
31
39
|
|
|
32
|
-
//
|
|
33
|
-
|
|
40
|
+
// Simple OAuth authentication - tokens managed automatically
|
|
41
|
+
const apiClient = new mgmtApi.ApiClient();
|
|
42
|
+
await apiClient.auth();
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
const guid = "your-website-guid";
|
|
45
|
+
const locale = "en-us";
|
|
37
46
|
|
|
38
|
-
//
|
|
47
|
+
// Make authenticated request - token refresh handled automatically
|
|
48
|
+
const contentItem = await apiClient.contentMethods.getContentItem(22, guid, locale);
|
|
39
49
|
console.log(JSON.stringify(contentItem));
|
|
40
50
|
```
|
|
41
|
-
## Class AssetMethods
|
|
42
|
-
This class is used to perform operations related to Assets. The following are the methods: -
|
|
43
|
-
|
|
44
|
-
### upload
|
|
45
|
-
| Parameter | Type | Description |
|
|
46
|
-
| :-------- | :------- | :------------------------- |
|
|
47
|
-
| `formData` | `FormData` | This is an object of type FormData where files can be posted eg : `const file = fs.readFileSync(<<Local File>>, null);const form = new FormData(); form.append('files',file,'<<File Name>>');`|
|
|
48
|
-
| `agilityFolderPath` | `string` | Path of the folder in Agility where the file(s) needs to be uploaded.|
|
|
49
|
-
| `groupingID` | `number` | Path of the folder in Agility where the file(s) needs to be uploaded.|
|
|
50
|
-
|
|
51
|
-
Returns: A collection of ```Media``` class Object.
|
|
52
|
-
|
|
53
|
-
### deleteFile
|
|
54
|
-
| Parameter | Type | Description |
|
|
55
|
-
| :-------- | :------- | :------------------------- |
|
|
56
|
-
| `mediaID` | `number` | The mediaID of the asset which needs to be deleted.|
|
|
57
|
-
Returns
|
|
58
|
-
A ```string``` response if a file has been deleted.
|
|
59
|
-
|
|
60
|
-
### moveFile
|
|
61
|
-
| Parameter | Type | Description |
|
|
62
|
-
| :-------- | :------- | :------------------------- |
|
|
63
|
-
| `mediaID` | `number` | The mediaID of the file that needs to be moved.|
|
|
64
|
-
| `newFolder` | `string` | The new location (in Agility) where the file needs to be moved.|
|
|
65
|
-
|
|
66
|
-
Returns: An object of ```Media``` class with the new location of the file.
|
|
67
|
-
|
|
68
|
-
### getMediaList
|
|
69
|
-
| Parameter | Type | Description |
|
|
70
|
-
| :-------- | :------- | :------------------------- |
|
|
71
|
-
| `pageSize` | `number` | The page size on which the assets needs to selected.|
|
|
72
|
-
| `recordOffset` | `number` | The record offset value to skip search results.|
|
|
73
|
-
|
|
74
|
-
Returns: An object of ```AssetMediaList``` class.
|
|
75
|
-
|
|
76
|
-
### getAssetByID
|
|
77
|
-
| Parameter | Type | Description |
|
|
78
|
-
| :-------- | :------- | :------------------------- |
|
|
79
|
-
| `mediaID` | `number` | The mediaID of the requested asset.|
|
|
80
|
-
|
|
81
|
-
Returns: An object of ```Media``` class with the information of the asset.
|
|
82
|
-
|
|
83
|
-
### getAssetByUrl
|
|
84
|
-
| Parameter | Type | Description |
|
|
85
|
-
| :-------- | :------- | :------------------------- |
|
|
86
|
-
| `url` | `string` | The url of the requested asset.|
|
|
87
|
-
|
|
88
|
-
Returns: An object of ```Media``` class with the information of the asset.
|
|
89
|
-
|
|
90
|
-
## Class BatchMethods
|
|
91
|
-
This class is used to perform operations related to Batches. The following are the methods: -
|
|
92
|
-
|
|
93
|
-
### getBatch
|
|
94
|
-
| Parameter | Type | Description |
|
|
95
|
-
| :-------- | :------- | :------------------------- |
|
|
96
|
-
| `id` | `number` | The batchID of the requested batch.|
|
|
97
|
-
|
|
98
|
-
Returns: A object of ```Batch``` class.
|
|
99
|
-
|
|
100
|
-
## Class ContainerMethods
|
|
101
|
-
This class is used to perform operations related to Containers. The following are the methods: -
|
|
102
|
-
|
|
103
|
-
### getContainerByID
|
|
104
|
-
| Parameter | Type | Description |
|
|
105
|
-
| :-------- | :------- | :------------------------- |
|
|
106
|
-
| `id` | `number` | The container id of the requested container.|
|
|
107
|
-
|
|
108
|
-
Returns: A object of ```Container``` class.
|
|
109
|
-
|
|
110
|
-
### getContainerByReferenceName
|
|
111
|
-
| Parameter | Type | Description |
|
|
112
|
-
| :-------- | :------- | :------------------------- |
|
|
113
|
-
| `referenceName` | `string` | The container reference name of the requested container.|
|
|
114
|
-
|
|
115
|
-
Returns: A object of ```Container``` class.
|
|
116
|
-
|
|
117
|
-
### getContainerSecurity
|
|
118
|
-
| Parameter | Type | Description |
|
|
119
|
-
| :-------- | :------- | :------------------------- |
|
|
120
|
-
| `id` | `number` | The container id of the requested container.|
|
|
121
|
-
|
|
122
|
-
Returns: A object of ```Container``` class.
|
|
123
|
-
|
|
124
|
-
### getContainerList
|
|
125
|
-
Returns: A collection object of ```Container``` class.
|
|
126
|
-
|
|
127
|
-
### getNotificationList
|
|
128
|
-
| Parameter | Type | Description |
|
|
129
|
-
| :-------- | :------- | :------------------------- |
|
|
130
|
-
| `id` | `number` | The container id of the requested container.|
|
|
131
|
-
|
|
132
|
-
Returns: A collection object of ```Notification``` class.
|
|
133
|
-
|
|
134
|
-
### saveContainer
|
|
135
|
-
| Parameter | Type | Description |
|
|
136
|
-
| :-------- | :------- | :------------------------- |
|
|
137
|
-
| `container` | `Container` | A Container type object to create or update a container.|
|
|
138
|
-
|
|
139
|
-
Returns: An object of ```Container``` class.
|
|
140
|
-
|
|
141
|
-
### deleteContainer
|
|
142
|
-
| Parameter | Type | Description |
|
|
143
|
-
| :-------- | :------- | :------------------------- |
|
|
144
|
-
| `id` | `number` | The container id of the requested container.|
|
|
145
|
-
|
|
146
|
-
Returns: A ```string``` response if a container has been deleted.
|
|
147
|
-
|
|
148
|
-
## Class ContentMethods
|
|
149
|
-
This class is used to perform operations related to Content. The following are the methods: -
|
|
150
|
-
|
|
151
|
-
### getContentItem
|
|
152
|
-
| Parameter | Type | Description |
|
|
153
|
-
| :-------- | :------- | :------------------------- |
|
|
154
|
-
| `contentID` | `number` | The contentid of the requested content.|
|
|
155
|
-
|
|
156
|
-
Returns: An object of ```ContentItem``` class.
|
|
157
|
-
|
|
158
|
-
### publishContent
|
|
159
|
-
| Parameter | Type | Description |
|
|
160
|
-
| :-------- | :------- | :------------------------- |
|
|
161
|
-
| `contentID` | `number` | The contentid of the requested content.|
|
|
162
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
163
|
-
|
|
164
|
-
Returns: An array of ```contentID``` of the requested content.
|
|
165
|
-
|
|
166
|
-
### unPublishContent
|
|
167
|
-
| Parameter | Type | Description |
|
|
168
|
-
| :-------- | :------- | :------------------------- |
|
|
169
|
-
| `contentID` | `number` | The contentid of the requested content.|
|
|
170
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
171
|
-
|
|
172
|
-
Returns: An array of ```contentID``` of the requested content.
|
|
173
|
-
|
|
174
|
-
### contentRequestApproval
|
|
175
|
-
| Parameter | Type | Description |
|
|
176
|
-
| :-------- | :------- | :------------------------- |
|
|
177
|
-
| `contentID` | `number` | The contentid of the requested content.|
|
|
178
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
179
51
|
|
|
180
|
-
|
|
52
|
+
#### Manual Token Authentication (For CI/CD)
|
|
53
|
+
```typescript
|
|
54
|
+
import * as mgmtApi from "@agility/management-sdk";
|
|
181
55
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
56
|
+
// Token-based approach for CI/CD and automated environments
|
|
57
|
+
const options = new mgmtApi.Options();
|
|
58
|
+
options.token = process.env.AGILITY_API_TOKEN;
|
|
59
|
+
const apiClient = new mgmtApi.ApiClient(options);
|
|
187
60
|
|
|
188
|
-
|
|
61
|
+
const guid = process.env.AGILITY_GUID;
|
|
62
|
+
const locale = "en-us";
|
|
189
63
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
| `contentID` | `number` | The contentid of the requested content.|
|
|
194
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
195
|
-
|
|
196
|
-
Returns: An array of ```contentID``` of the requested content.
|
|
197
|
-
|
|
198
|
-
### saveContentItem
|
|
199
|
-
| Parameter | Type | Description |
|
|
200
|
-
| :-------- | :------- | :------------------------- |
|
|
201
|
-
| `contentItem` | `ContentItem` | A contentItem object to create or update a content.|
|
|
202
|
-
|
|
203
|
-
Returns: An array of ```contentID``` of the requested content.
|
|
204
|
-
|
|
205
|
-
### saveContentItems
|
|
206
|
-
| Parameter | Type | Description |
|
|
207
|
-
| :-------- | :------- | :------------------------- |
|
|
208
|
-
| `contentItems` | `ContentItem[]` | A collection of contentItems object to create or update multiple contents.|
|
|
209
|
-
|
|
210
|
-
Returns: An array of ```contentID``` of the requested content.
|
|
211
|
-
|
|
212
|
-
### deleteContent
|
|
213
|
-
| Parameter | Type | Description |
|
|
214
|
-
| :-------- | :------- | :------------------------- |
|
|
215
|
-
| `contentID` | `number` | The contentid of the requested content.|
|
|
216
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
217
|
-
|
|
218
|
-
Returns: An array of ```contentID``` of the requested content.
|
|
219
|
-
|
|
220
|
-
### getContentItems
|
|
221
|
-
| Parameter | Type | Description |
|
|
222
|
-
| :-------- | :------- | :------------------------- |
|
|
223
|
-
| `referenceName` | `string` | The reference name of the container for the requested content.|
|
|
224
|
-
| `filter` | `string` | The filter condition for the requested content.|
|
|
225
|
-
| `fields` | `string` | The fields mapped to the container.|
|
|
226
|
-
| `sortDirection` | `string` | The direction to sort the result.|
|
|
227
|
-
| `sortField` | `string` | The field on which the sort needs to be performed.|
|
|
228
|
-
| `take` | `number` | The page size for the result.|
|
|
229
|
-
| `skip` | `number` | The record offset for the result.|
|
|
230
|
-
|
|
231
|
-
Returns: An object of ```ContentList``` class of the requested content.
|
|
232
|
-
|
|
233
|
-
## Class InstanceUserMethods
|
|
234
|
-
This class is used to perform operations related to User. The following are the methods: -
|
|
235
|
-
|
|
236
|
-
### getUsers
|
|
237
|
-
Returns: A collection of ```WebsiteUser``` class of the requested content.
|
|
238
|
-
|
|
239
|
-
### saveUser
|
|
240
|
-
| Parameter | Type | Description |
|
|
241
|
-
| :-------- | :------- | :------------------------- |
|
|
242
|
-
| `emailAddress` | `string` | The email address of the requested user.|
|
|
243
|
-
| `roles` | `InstanceRole[]` | Collection object of InstanceRole class for the requested user.|
|
|
244
|
-
| `firstName` | `string` | The first name of the requested user.|
|
|
245
|
-
| `lastName` | `string` | The last name of the requested user.|
|
|
246
|
-
|
|
247
|
-
Returns: An object of the ```InstanceUser``` class.
|
|
248
|
-
|
|
249
|
-
### deleteUser
|
|
250
|
-
| Parameter | Type | Description |
|
|
251
|
-
| :-------- | :------- | :------------------------- |
|
|
252
|
-
| `userID` | `number` | The userID of the requested user.|
|
|
253
|
-
|
|
254
|
-
Returns: A ```string``` response if a user has been deleted.
|
|
255
|
-
|
|
256
|
-
## Class ModelMethods
|
|
257
|
-
This class is used to perform operations related to Models. The following are the methods: -
|
|
258
|
-
|
|
259
|
-
### getContentModel
|
|
260
|
-
| Parameter | Type | Description |
|
|
261
|
-
| :-------- | :------- | :------------------------- |
|
|
262
|
-
| `id` | `number` | The id of the requested model.|
|
|
263
|
-
|
|
264
|
-
Returns: An object of ```Model``` class.
|
|
265
|
-
|
|
266
|
-
### getContentModules
|
|
267
|
-
| Parameter | Type | Description |
|
|
268
|
-
| :-------- | :------- | :------------------------- |
|
|
269
|
-
| `includeDefaults` | `bool` | Boolean value to include defaults.|
|
|
270
|
-
| `includeModules` | `bool` | Boolean value to include modules.|
|
|
271
|
-
|
|
272
|
-
Returns: A collection object of ```Model``` class.
|
|
273
|
-
|
|
274
|
-
### getPageModules
|
|
275
|
-
| Parameter | Type | Description |
|
|
276
|
-
| :-------- | :------- | :------------------------- |
|
|
277
|
-
| `includeDefault` | `bool` | Boolean value to include defaults.|
|
|
278
|
-
|
|
279
|
-
Returns: A collection object of ```Model``` class.
|
|
280
|
-
|
|
281
|
-
### saveModel
|
|
282
|
-
| Parameter | Type | Description |
|
|
283
|
-
| :-------- | :------- | :------------------------- |
|
|
284
|
-
| `model` | `Model` | The object of Model to for the requested model.|
|
|
285
|
-
|
|
286
|
-
Returns: An object of ```Model``` class.
|
|
287
|
-
|
|
288
|
-
### deleteModel
|
|
289
|
-
| Parameter | Type | Description |
|
|
290
|
-
| :-------- | :------- | :------------------------- |
|
|
291
|
-
| `id` | `number` | The id for the requested model.|
|
|
292
|
-
|
|
293
|
-
Returns: A ```string``` response if a model is deleted.
|
|
294
|
-
|
|
295
|
-
## Class PageMethods
|
|
296
|
-
This class is used to perform operations related to Pages. The following are the methods: -
|
|
297
|
-
|
|
298
|
-
### getSitemap
|
|
299
|
-
Returns: A collection object of ```Sitemap``` class.
|
|
300
|
-
|
|
301
|
-
### getPage
|
|
302
|
-
| Parameter | Type | Description |
|
|
303
|
-
| :-------- | :------- | :------------------------- |
|
|
304
|
-
| `pageID` | `number` | The id of the requested page.|
|
|
305
|
-
|
|
306
|
-
Returns: An object of ```PageItem``` class.
|
|
307
|
-
|
|
308
|
-
### publishPage
|
|
309
|
-
| Parameter | Type | Description |
|
|
310
|
-
| :-------- | :------- | :------------------------- |
|
|
311
|
-
| `pageID` | `number` | The pageID of the requested page.|
|
|
312
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
313
|
-
|
|
314
|
-
Returns: An array of ```pageID``` of the requested page.
|
|
315
|
-
|
|
316
|
-
### unPublishPage
|
|
317
|
-
| Parameter | Type | Description |
|
|
318
|
-
| :-------- | :------- | :------------------------- |
|
|
319
|
-
| `pageID` | `number` | The pageID of the requested page.|
|
|
320
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
321
|
-
|
|
322
|
-
Returns: An array of ```pageID``` of the requested page.
|
|
323
|
-
|
|
324
|
-
### deletePage
|
|
325
|
-
| Parameter | Type | Description |
|
|
326
|
-
| :-------- | :------- | :------------------------- |
|
|
327
|
-
| `pageID` | `number` | The pageID of the requested page.|
|
|
328
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
329
|
-
|
|
330
|
-
Returns: An array of ```pageID``` of the requested page.
|
|
331
|
-
|
|
332
|
-
### approvePage
|
|
333
|
-
| Parameter | Type | Description |
|
|
334
|
-
| :-------- | :------- | :------------------------- |
|
|
335
|
-
| `pageID` | `number` | The pageID of the requested page.|
|
|
336
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
64
|
+
const contentItem = await apiClient.contentMethods.getContentItem(22, guid, locale);
|
|
65
|
+
console.log('Content retrieved:', contentItem.fields.title);
|
|
66
|
+
```
|
|
337
67
|
|
|
338
|
-
|
|
68
|
+
> 💡 **Note**: The new OAuth authentication requires `keytar` for secure token storage. See the [Authentication & Setup Guide](./docs/auth.md) for OAuth setup or [CI/CD & Automated Environments](./docs/cicd.md) for token-based authentication.
|
|
339
69
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
70
|
+
## API Method Classes
|
|
71
|
+
|
|
72
|
+
### File and Media Management
|
|
73
|
+
- **[AssetMethods](./docs/asset-methods.md)** - File and media management operations (15 functions)
|
|
74
|
+
- [deleteFile](./docs/asset-methods.md#deletefile), [moveFile](./docs/asset-methods.md#movefile), [getMediaList](./docs/asset-methods.md#getmedialist), [getGalleries](./docs/asset-methods.md#getgalleries), [getGalleryById](./docs/asset-methods.md#getgallerybyid), [getGalleryByName](./docs/asset-methods.md#getgallerybyname), [getDefaultContainer](./docs/asset-methods.md#getdefaultcontainer), [saveGallery](./docs/asset-methods.md#savegallery), [deleteGallery](./docs/asset-methods.md#deletegallery), [getAssetByID](./docs/asset-methods.md#getassetbyid), [getAssetByUrl](./docs/asset-methods.md#getassetbyurl), [upload](./docs/asset-methods.md#upload), [createFolder](./docs/asset-methods.md#createfolder), [deleteFolder](./docs/asset-methods.md#deletefolder), [renameFolder](./docs/asset-methods.md#renamefolder)
|
|
75
|
+
|
|
76
|
+
### Workflow Operations
|
|
77
|
+
- **[BatchMethods](./docs/batch-methods.md)** - Batch workflow operations (7 functions)
|
|
78
|
+
- [getBatch](./docs/batch-methods.md#getbatch), [publishBatch](./docs/batch-methods.md#publishbatch), [unpublishBatch](./docs/batch-methods.md#unpublishbatch), [approveBatch](./docs/batch-methods.md#approvebatch), [declineBatch](./docs/batch-methods.md#declinebatch), [requestApprovalBatch](./docs/batch-methods.md#requestapprovalbatch), [getBatchTypes](./docs/batch-methods.md#getbatchtypes)
|
|
79
|
+
|
|
80
|
+
### Content Management
|
|
81
|
+
- **[ContainerMethods](./docs/container-methods.md)** - Container management operations (8 functions)
|
|
82
|
+
- [getContainerByID](./docs/container-methods.md#getcontainerbyid), [getContainersByModel](./docs/container-methods.md#getcontainersbymodel), [getContainerByReferenceName](./docs/container-methods.md#getcontainerbyreferencename), [getContainerSecurity](./docs/container-methods.md#getcontainersecurity), [getContainerList](./docs/container-methods.md#getcontainerlist), [getNotificationList](./docs/container-methods.md#getnotificationlist), [saveContainer](./docs/container-methods.md#savecontainer), [deleteContainer](./docs/container-methods.md#deletecontainer)
|
|
83
|
+
|
|
84
|
+
- **[ContentMethods](./docs/content-methods.md)** - Content item operations (13 functions)
|
|
85
|
+
- [getContentItem](./docs/content-methods.md#getcontentitem), [publishContent](./docs/content-methods.md#publishcontent), [unPublishContent](./docs/content-methods.md#unpublishcontent), [contentRequestApproval](./docs/content-methods.md#contentrequestapproval), [approveContent](./docs/content-methods.md#approvecontent), [declineContent](./docs/content-methods.md#declinecontent), [deleteContent](./docs/content-methods.md#deletecontent), [saveContentItem](./docs/content-methods.md#savecontentitem), [saveContentItems](./docs/content-methods.md#savecontentitems), [getContentItems](./docs/content-methods.md#getcontentitems), [getContentList](./docs/content-methods.md#getcontentlist), [getContentHistory](./docs/content-methods.md#getcontenthistory), [getContentComments](./docs/content-methods.md#getcontentcomments)
|
|
86
|
+
|
|
87
|
+
- **[ModelMethods](./docs/model-methods.md)** - Content model operations (6 functions)
|
|
88
|
+
- [getContentModel](./docs/model-methods.md#getcontentmodel), [getModelByReferenceName](./docs/model-methods.md#getmodelbyreferencename), [getContentModules](./docs/model-methods.md#getcontentmodules), [getPageModules](./docs/model-methods.md#getpagemodules), [saveModel](./docs/model-methods.md#savemodel), [deleteModel](./docs/model-methods.md#deletemodel)
|
|
89
|
+
|
|
90
|
+
### Page Management
|
|
91
|
+
- **[PageMethods](./docs/page-methods.md)** - Page management operations (17 functions)
|
|
92
|
+
- [getPage](./docs/page-methods.md#getpage), [getPageByPath](./docs/page-methods.md#getpagebypath), [getPageHistory](./docs/page-methods.md#getpagehistory), [getPageComments](./docs/page-methods.md#getpagecomments), [getPageList](./docs/page-methods.md#getpagelist), [getPageListByPageTemplateID](./docs/page-methods.md#getpagelistbypagetemplateid), [getPageListByPage](./docs/page-methods.md#getpagelistbypage), [getPageListByPageAndPageTemplateID](./docs/page-methods.md#getpagelistbypageandpagetemplateid), [getPageTree](./docs/page-methods.md#getpagetree), [getPageTemplateList](./docs/page-methods.md#getpagetemplatelist), [getPageSecurity](./docs/page-methods.md#getpagesecurity), [getPageItemTemplateList](./docs/page-methods.md#getpageitemtemplatelist), [getPageContentZones](./docs/page-methods.md#getpagecontentzones), [savePage](./docs/page-methods.md#savepage), [savePageSecurity](./docs/page-methods.md#savepagesecurity), [movePageItem](./docs/page-methods.md#movepageitem), [deletePage](./docs/page-methods.md#deletepage)
|
|
93
|
+
|
|
94
|
+
### User Management
|
|
95
|
+
- **[InstanceMethods](./docs/instance-methods.md)** - Instance-level operations (1 function)
|
|
96
|
+
- [getLocales](./docs/instance-methods.md#getlocales)
|
|
97
|
+
|
|
98
|
+
- **[InstanceUserMethods](./docs/instance-user-methods.md)** - Instance user management (3 functions)
|
|
99
|
+
- [getUsers](./docs/instance-user-methods.md#getusers), [saveUser](./docs/instance-user-methods.md#saveuser), [deleteUser](./docs/instance-user-methods.md#deleteuser)
|
|
100
|
+
|
|
101
|
+
- **[ServerUserMethods](./docs/server-user-methods.md)** - Server user operations (2 functions)
|
|
102
|
+
- [me](./docs/server-user-methods.md#me), [you](./docs/server-user-methods.md#you)
|
|
103
|
+
|
|
104
|
+
### Integration
|
|
105
|
+
- **[WebhookMethods](./docs/webhook-methods.md)** - Webhook management (4 functions)
|
|
106
|
+
- [getWebhook](./docs/webhook-methods.md#getwebhook), [webhookList](./docs/webhook-methods.md#webhooklist), [saveWebhook](./docs/webhook-methods.md#savewebhook), [deleteWebhook](./docs/webhook-methods.md#deletewebhook)
|
|
107
|
+
|
|
108
|
+
### Multi-Instance Operations
|
|
109
|
+
- **[Multi-Instance Operations](./docs/multi-instance-operations.md)** - Advanced workflows for managing content across multiple instances and locales
|
|
110
|
+
- Configuration-driven content creation across multiple environments
|
|
111
|
+
- Parallel processing and batch operations
|
|
112
|
+
- Performance optimization and error handling
|
|
113
|
+
- Cross-instance synchronization and reporting
|
|
114
|
+
|
|
115
|
+
### CI/CD & Automation
|
|
116
|
+
- **[CI/CD & Automated Environments](./docs/cicd.md)** - Token-based authentication for automated environments
|
|
117
|
+
- CI/CD pipeline examples (GitHub Actions, GitLab CI, Jenkins)
|
|
118
|
+
- Serverless functions (AWS Lambda, Vercel)
|
|
119
|
+
- Environment configuration and security best practices
|
|
120
|
+
- Token management and rotation
|
|
121
|
+
|
|
122
|
+
## Examples
|
|
123
|
+
|
|
124
|
+
### Understanding Agility CMS Batch Architecture
|
|
125
|
+
|
|
126
|
+
Agility CMS uses a simple approach for working with content and batches:
|
|
127
|
+
|
|
128
|
+
#### Content/Page Creation (Handled by Respective Controllers)
|
|
129
|
+
- **contentMethods.saveContentItem()** - Creates a single new content item and adds it to a batch
|
|
130
|
+
- **contentMethods.saveContentItems()** - Creates multiple new content items and adds them to a batch
|
|
131
|
+
- **pageMethods.savePage()** - Creates a new page and adds it to a batch
|
|
132
|
+
- These methods create the content AND automatically handle batch creation/management
|
|
133
|
+
|
|
134
|
+
#### Batch Workflow Operations (Handled by Batch Controller)
|
|
135
|
+
- **batchMethods.publishBatch()** - Publishes all items in an existing batch
|
|
136
|
+
- **batchMethods.unpublishBatch()** - Unpublishes all items in an existing batch
|
|
137
|
+
- **batchMethods.approveBatch()** - Approves all items in an existing batch
|
|
138
|
+
- **batchMethods.declineBatch()** - Declines all items in an existing batch
|
|
139
|
+
- **batchMethods.requestApprovalBatch()** - Requests approval for all items in an existing batch
|
|
140
|
+
- **batchMethods.getBatch()** - Retrieves details of an existing batch
|
|
141
|
+
- **batchMethods.getBatchTypes()** - Retrieves all batch-related enum types for developer discovery
|
|
142
|
+
|
|
143
|
+
### Complete Workflow Example
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
import * as mgmtApi from '@agility/management-sdk';
|
|
147
|
+
|
|
148
|
+
// Authenticate with simple OAuth flow
|
|
149
|
+
const client = new mgmtApi.ApiClient();
|
|
150
|
+
await client.auth();
|
|
151
|
+
|
|
152
|
+
const guid = 'your-instance-guid';
|
|
153
|
+
const locale = 'en-us';
|
|
154
|
+
|
|
155
|
+
// Get batch types for dynamic UI and validation
|
|
156
|
+
const batchTypes = await client.batchMethods.getBatchTypes(guid);
|
|
157
|
+
console.log('Available batch types loaded:', batchTypes);
|
|
158
|
+
|
|
159
|
+
// Create NEW content items (handled by content controller)
|
|
160
|
+
// This automatically creates and manages batches
|
|
161
|
+
const newContentBatchID = await client.contentMethods.saveContentItem(locale, {
|
|
162
|
+
properties: {
|
|
163
|
+
referenceName: 'blog-post',
|
|
164
|
+
definitionName: 'BlogPost',
|
|
165
|
+
state: 2
|
|
166
|
+
},
|
|
167
|
+
fields: {
|
|
168
|
+
title: 'My New Blog Post',
|
|
169
|
+
content: 'This is the blog post content...'
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// Create NEW page (handled by page controller)
|
|
174
|
+
// This automatically creates and manages batches
|
|
175
|
+
const newPageBatchID = await client.pageMethods.savePage(locale, {
|
|
176
|
+
name: 'new-product-page',
|
|
177
|
+
title: 'New Product Page',
|
|
178
|
+
menuText: 'New Product',
|
|
179
|
+
pageType: 'static',
|
|
180
|
+
templateName: 'Product Template',
|
|
181
|
+
parentPageID: -1
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// Retrieve details of an existing batch
|
|
185
|
+
const batchDetails = await client.batchMethods.getBatch(newContentBatchID, guid);
|
|
186
|
+
console.log('Batch details:', batchDetails);
|
|
187
|
+
|
|
188
|
+
// Perform workflow operations on existing batches
|
|
189
|
+
await client.batchMethods.publishBatch(newContentBatchID, guid);
|
|
190
|
+
await client.batchMethods.approveBatch(newPageBatchID, guid);
|
|
191
|
+
|
|
192
|
+
// Or use immediate return for custom polling
|
|
193
|
+
const batchId = await client.batchMethods.publishBatch(newContentBatchID, guid, true);
|
|
194
|
+
console.log('Batch submitted for publishing:', batchId);
|
|
195
|
+
|
|
196
|
+
console.log('All operations completed successfully!');
|
|
197
|
+
```
|
|
345
198
|
|
|
346
|
-
|
|
199
|
+
## TypeScript Interfaces
|
|
347
200
|
|
|
348
|
-
###
|
|
349
|
-
| Parameter | Type | Description |
|
|
350
|
-
| :-------- | :------- | :------------------------- |
|
|
351
|
-
| `pageID` | `number` | The pageID of the requested page.|
|
|
352
|
-
| `comments` | `string` | Additional comments for a batch request.|
|
|
201
|
+
### Batch Response Interfaces
|
|
353
202
|
|
|
354
|
-
|
|
203
|
+
```typescript
|
|
204
|
+
interface BatchTypesResponse {
|
|
205
|
+
itemTypes: EnumInfo[]; // Page, ContentItem, ContentList, Tag, ModuleDef
|
|
206
|
+
operationTypes: EnumInfo[]; // All operation types
|
|
207
|
+
workflowOperations: EnumInfo[]; // Publish, Unpublish, Approve, Decline, RequestApproval
|
|
208
|
+
states: EnumInfo[]; // None, Pending, InProcess, Processed, Deleted
|
|
209
|
+
}
|
|
355
210
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
211
|
+
interface EnumInfo {
|
|
212
|
+
value: number; // Numeric enum value
|
|
213
|
+
name: string; // String name (e.g., "Publish")
|
|
214
|
+
description: string; // Human-readable description
|
|
215
|
+
}
|
|
216
|
+
```
|
|
362
217
|
|
|
363
|
-
|
|
218
|
+
## Available Enums
|
|
364
219
|
|
|
220
|
+
### WorkflowOperationType (for batch processing)
|
|
221
|
+
> **Note**: In the API documentation (Swagger UI), these operations appear as descriptive dropdown options (Publish, Unpublish, Approve, Decline, RequestApproval) instead of numbers.
|
|
365
222
|
|
|
366
|
-
|
|
223
|
+
- `Publish = 1`
|
|
224
|
+
- `Unpublish = 2`
|
|
225
|
+
- `Approve = 3`
|
|
226
|
+
- `Decline = 4`
|
|
227
|
+
- `RequestApproval = 5`
|
|
367
228
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
- `npm run build`
|
|
229
|
+
### BatchItemType
|
|
230
|
+
> **Note**: In the API documentation (Swagger UI), these appear as descriptive dropdown options (Page, ContentItem, ContentList, Tag, ModuleDef) instead of numbers.
|
|
371
231
|
|
|
372
|
-
|
|
232
|
+
- `Page = 1`
|
|
233
|
+
- `ContentItem = 2`
|
|
234
|
+
- `ContentList = 3`
|
|
235
|
+
- `Tag = 4`
|
|
236
|
+
- `ModuleDef = 5`
|
|
373
237
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
- [How Page Templates Work](https://help.agilitycms.com/hc/en-us/articles/4404229108877)
|
|
238
|
+
### BatchState
|
|
239
|
+
> **Note**: In the API documentation (Swagger UI), these appear as descriptive names (None, Pending, InProcess, Processed, Deleted) instead of numbers.
|
|
377
240
|
|
|
378
|
-
|
|
241
|
+
- `None = 0` - Batch created but not submitted for processing
|
|
242
|
+
- `Pending = 1` - Batch is pending processing
|
|
243
|
+
- `InProcess = 2` - Batch is currently being processed
|
|
244
|
+
- `Processed = 3` - Batch has been processed successfully
|
|
245
|
+
- `Deleted = 4` - Batch has been deleted
|
|
379
246
|
|
|
380
|
-
|
|
247
|
+
## Error Handling
|
|
381
248
|
|
|
382
|
-
|
|
383
|
-
- [Documentation](https://help.agilitycms.com/hc/en-us)
|
|
249
|
+
All methods throw exceptions on failure:
|
|
384
250
|
|
|
385
|
-
|
|
251
|
+
```typescript
|
|
252
|
+
try {
|
|
253
|
+
const batch = await client.batchMethods.getBatch(123, 'instance-guid');
|
|
254
|
+
} catch (error) {
|
|
255
|
+
console.error('Failed to get batch:', error.message);
|
|
256
|
+
}
|
|
257
|
+
```
|
|
386
258
|
|
|
387
|
-
|
|
388
|
-
- [Blog](https://agilitycms.com/resources/posts)
|
|
389
|
-
- [GitHub](https://github.com/agility)
|
|
390
|
-
- [Forums](https://help.agilitycms.com/hc/en-us/community/topics)
|
|
391
|
-
- [Facebook](https://www.facebook.com/AgilityCMS/)
|
|
392
|
-
- [Twitter](https://twitter.com/AgilityCMS)
|
|
259
|
+
## License
|
|
393
260
|
|
|
394
|
-
|
|
261
|
+
MIT
|
|
395
262
|
|
|
396
|
-
If you have feedback or questions about this starter, please use the [Github Issues](https://github.com/agility/agility-cms-management-sdk-typescript/issues) on this repo, join our [Community Slack Channel](https://join.slack.com/t/agilitycommunity/shared_invite/enQtNzI2NDc3MzU4Njc2LWI2OTNjZTI3ZGY1NWRiNTYzNmEyNmI0MGZlZTRkYzI3NmRjNzkxYmI5YTZjNTg2ZTk4NGUzNjg5NzY3OWViZGI) or create a post on the [Agility Developer Community](https://help.agilitycms.com/hc/en-us/community/topics).
|
|
263
|
+
If you have feedback or questions about this starter, please use the [Github Issues](https://github.com/agility/agility-cms-management-sdk-typescript/issues) on this repo, join our [Community Slack Channel](https://join.slack.com/t/agilitycommunity/shared_invite/enQtNzI2NDc3MzU4Njc2LWI2OTNjZTI3ZGY1NWRiNTYzNmEyNmI0MGZlZTRkYzI3NmRjNzkxYmI5YTZjNTg2ZTk4NGUzNjg5NzY3OWViZGI) or create a post on the [Agility Developer Community](https://help.agilitycms.com/hc/en-us/community/topics).
|