@agility/management-sdk 0.1.32 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/api-coverage.md +217 -0
- package/.cursor/api-documentation-manifest.md +275 -0
- package/.cursor/api-functions-analysis.md +111 -0
- package/.cursor/breakout-manifest.md +278 -0
- package/.cursor/docs-final-check.md +269 -0
- package/.cursor/github-actions-improvements.md +76 -0
- package/.cursor/hardening.md +271 -0
- package/.cursor/linting-fix.md +160 -0
- package/.cursor/manifest.md +243 -0
- package/.cursor/mocks.md +100 -0
- package/.cursor/test-coverage.md +841 -0
- package/.env +92 -0
- package/README.md +87 -315
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/coverage-summary.json +43 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +161 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +161 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/apiClient.ts.html +199 -0
- package/coverage/lcov-report/src/apiMethods/assetMethods.ts.html +682 -0
- package/coverage/lcov-report/src/apiMethods/batchMethods.ts.html +736 -0
- package/coverage/lcov-report/src/apiMethods/clientInstance.ts.html +403 -0
- package/coverage/lcov-report/src/apiMethods/containerMethods.ts.html +460 -0
- package/coverage/lcov-report/src/apiMethods/contentMethods.ts.html +1183 -0
- package/coverage/lcov-report/src/apiMethods/index.html +266 -0
- package/coverage/lcov-report/src/apiMethods/instanceMethods.ts.html +160 -0
- package/coverage/lcov-report/src/apiMethods/instanceUserMethods.ts.html +268 -0
- package/coverage/lcov-report/src/apiMethods/modelMethods.ts.html +352 -0
- package/coverage/lcov-report/src/apiMethods/pageMethods.ts.html +1276 -0
- package/coverage/lcov-report/src/apiMethods/serverUserMethods.ts.html +196 -0
- package/coverage/lcov-report/src/apiMethods/webhookMethods.ts.html +271 -0
- package/coverage/lcov-report/src/enums/batchItemType.ts.html +106 -0
- package/coverage/lcov-report/src/enums/batchOperationType.ts.html +142 -0
- package/coverage/lcov-report/src/enums/batchState..ts.html +106 -0
- package/coverage/lcov-report/src/enums/index.html +161 -0
- package/coverage/lcov-report/src/enums/workflowOperationType.ts.html +175 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/models/assetContainer.ts.html +106 -0
- package/coverage/lcov-report/src/models/assetGalleries.ts.html +103 -0
- package/coverage/lcov-report/src/models/assetMediaGrouping.ts.html +136 -0
- package/coverage/lcov-report/src/models/assetMediaGroupingMetaData.ts.html +97 -0
- package/coverage/lcov-report/src/models/batch.ts.html +178 -0
- package/coverage/lcov-report/src/models/batchItem.ts.html +127 -0
- package/coverage/lcov-report/src/models/container.ts.html +232 -0
- package/coverage/lcov-report/src/models/contentDefinitionTypeID.ts.html +142 -0
- package/coverage/lcov-report/src/models/contentItem.ts.html +202 -0
- package/coverage/lcov-report/src/models/contentSectionDefaultModule.ts.html +106 -0
- package/coverage/lcov-report/src/models/contentSectionDefinition.ts.html +196 -0
- package/coverage/lcov-report/src/models/contentViewColumn.ts.html +109 -0
- package/coverage/lcov-report/src/models/exception.ts.html +109 -0
- package/coverage/lcov-report/src/models/index.html +476 -0
- package/coverage/lcov-report/src/models/instanceRole.ts.html +106 -0
- package/coverage/lcov-report/src/models/instanceUser.ts.html +130 -0
- package/coverage/lcov-report/src/models/locales.ts.html +100 -0
- package/coverage/lcov-report/src/models/media.ts.html +178 -0
- package/coverage/lcov-report/src/models/model.ts.html +172 -0
- package/coverage/lcov-report/src/models/notification.ts.html +124 -0
- package/coverage/lcov-report/src/models/options.ts.html +109 -0
- package/coverage/lcov-report/src/models/pageItem.ts.html +268 -0
- package/coverage/lcov-report/src/models/pageModel.ts.html +130 -0
- package/coverage/lcov-report/src/models/sharedModule.ts.html +106 -0
- package/coverage/lcov-report/src/models/sitemap.ts.html +148 -0
- package/coverage/lcov-report/src/models/websiteUser.ts.html +157 -0
- package/coverage/lcov.info +1459 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/apiClient.ts.html +199 -0
- package/coverage/src/apiMethods/assetMethods.ts.html +682 -0
- package/coverage/src/apiMethods/batchMethods.ts.html +736 -0
- package/coverage/src/apiMethods/clientInstance.ts.html +403 -0
- package/coverage/src/apiMethods/containerMethods.ts.html +460 -0
- package/coverage/src/apiMethods/contentMethods.ts.html +1183 -0
- package/coverage/src/apiMethods/index.html +266 -0
- package/coverage/src/apiMethods/instanceMethods.ts.html +160 -0
- package/coverage/src/apiMethods/instanceUserMethods.ts.html +268 -0
- package/coverage/src/apiMethods/modelMethods.ts.html +352 -0
- package/coverage/src/apiMethods/pageMethods.ts.html +1276 -0
- package/coverage/src/apiMethods/serverUserMethods.ts.html +196 -0
- package/coverage/src/apiMethods/webhookMethods.ts.html +271 -0
- package/coverage/src/enums/batchItemType.ts.html +106 -0
- package/coverage/src/enums/batchOperationType.ts.html +142 -0
- package/coverage/src/enums/batchState..ts.html +106 -0
- package/coverage/src/enums/index.html +161 -0
- package/coverage/src/enums/workflowOperationType.ts.html +175 -0
- package/coverage/src/index.html +116 -0
- package/coverage/src/models/assetContainer.ts.html +106 -0
- package/coverage/src/models/assetGalleries.ts.html +103 -0
- package/coverage/src/models/assetMediaGrouping.ts.html +136 -0
- package/coverage/src/models/assetMediaGroupingMetaData.ts.html +97 -0
- package/coverage/src/models/batch.ts.html +178 -0
- package/coverage/src/models/batchItem.ts.html +127 -0
- package/coverage/src/models/container.ts.html +232 -0
- package/coverage/src/models/contentDefinitionTypeID.ts.html +142 -0
- package/coverage/src/models/contentItem.ts.html +202 -0
- package/coverage/src/models/contentSectionDefaultModule.ts.html +106 -0
- package/coverage/src/models/contentSectionDefinition.ts.html +196 -0
- package/coverage/src/models/contentViewColumn.ts.html +109 -0
- package/coverage/src/models/exception.ts.html +109 -0
- package/coverage/src/models/index.html +476 -0
- package/coverage/src/models/instanceRole.ts.html +106 -0
- package/coverage/src/models/instanceUser.ts.html +130 -0
- package/coverage/src/models/locales.ts.html +100 -0
- package/coverage/src/models/media.ts.html +178 -0
- package/coverage/src/models/model.ts.html +172 -0
- package/coverage/src/models/notification.ts.html +124 -0
- package/coverage/src/models/options.ts.html +109 -0
- package/coverage/src/models/pageItem.ts.html +268 -0
- package/coverage/src/models/pageModel.ts.html +130 -0
- package/coverage/src/models/sharedModule.ts.html +106 -0
- package/coverage/src/models/sitemap.ts.html +148 -0
- package/coverage/src/models/websiteUser.ts.html +157 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/apiClient.d.ts.map +1 -0
- package/dist/apiClient.js.map +1 -0
- package/dist/apiMethods/assetMethods.d.ts.map +1 -0
- package/dist/apiMethods/assetMethods.js +38 -38
- package/dist/apiMethods/assetMethods.js.map +1 -0
- package/dist/apiMethods/batchMethods.d.ts.map +1 -0
- package/dist/apiMethods/batchMethods.js +33 -33
- package/dist/apiMethods/batchMethods.js.map +1 -0
- package/dist/apiMethods/clientInstance.d.ts.map +1 -0
- package/dist/apiMethods/clientInstance.js +18 -15
- package/dist/apiMethods/clientInstance.js.map +1 -0
- package/dist/apiMethods/containerMethods.d.ts.map +1 -0
- package/dist/apiMethods/containerMethods.js +20 -20
- package/dist/apiMethods/containerMethods.js.map +1 -0
- package/dist/apiMethods/contentMethods.d.ts.map +1 -0
- package/dist/apiMethods/contentMethods.js +68 -68
- package/dist/apiMethods/contentMethods.js.map +1 -0
- package/dist/apiMethods/instanceMethods.d.ts.map +1 -0
- package/dist/apiMethods/instanceMethods.js +3 -3
- package/dist/apiMethods/instanceMethods.js.map +1 -0
- package/dist/apiMethods/instanceUserMethods.d.ts.map +1 -0
- package/dist/apiMethods/instanceUserMethods.js +10 -10
- package/dist/apiMethods/instanceUserMethods.js.map +1 -0
- package/dist/apiMethods/modelMethods.d.ts.map +1 -0
- package/dist/apiMethods/modelMethods.js +13 -13
- package/dist/apiMethods/modelMethods.js.map +1 -0
- package/dist/apiMethods/pageMethods.d.ts +2 -1
- package/dist/apiMethods/pageMethods.d.ts.map +1 -0
- package/dist/apiMethods/pageMethods.js +79 -73
- package/dist/apiMethods/pageMethods.js.map +1 -0
- package/dist/apiMethods/serverUserMethods.d.ts.map +1 -0
- package/dist/apiMethods/serverUserMethods.js +4 -4
- package/dist/apiMethods/serverUserMethods.js.map +1 -0
- package/dist/apiMethods/webhookMethods.d.ts.map +1 -0
- package/dist/apiMethods/webhookMethods.js +11 -11
- package/dist/apiMethods/webhookMethods.js.map +1 -0
- package/dist/enums/assetGroupingType.d.ts.map +1 -0
- package/dist/enums/assetGroupingType.js +1 -1
- package/dist/enums/assetGroupingType.js.map +1 -0
- package/dist/enums/batchItemType.d.ts.map +1 -0
- package/dist/enums/batchItemType.js +1 -1
- package/dist/enums/batchItemType.js.map +1 -0
- package/dist/enums/batchOperationType.d.ts.map +1 -0
- package/dist/enums/batchOperationType.js +1 -1
- package/dist/enums/batchOperationType.js.map +1 -0
- package/dist/enums/batchState..d.ts.map +1 -0
- package/dist/enums/batchState..js +1 -1
- package/dist/enums/batchState..js.map +1 -0
- package/dist/enums/pageItemTemplateType.d.ts.map +1 -0
- package/dist/enums/pageItemTemplateType.js +1 -1
- package/dist/enums/pageItemTemplateType.js.map +1 -0
- package/dist/enums/workflowOperationType.d.ts.map +1 -0
- package/dist/enums/workflowOperationType.js +1 -1
- package/dist/enums/workflowOperationType.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -0
- package/dist/models/assetContainer.d.ts.map +1 -0
- package/dist/models/assetContainer.js.map +1 -0
- package/dist/models/assetGalleries.d.ts.map +1 -0
- package/dist/models/assetGalleries.js.map +1 -0
- package/dist/models/assetMediaGrouping.d.ts.map +1 -0
- package/dist/models/assetMediaGrouping.js.map +1 -0
- package/dist/models/assetMediaGroupingMetaData.d.ts.map +1 -0
- package/dist/models/assetMediaGroupingMetaData.js.map +1 -0
- package/dist/models/batch.d.ts.map +1 -0
- package/dist/models/batch.js.map +1 -0
- package/dist/models/batchItem.d.ts.map +1 -0
- package/dist/models/batchItem.js.map +1 -0
- package/dist/models/batchTypes.d.ts.map +1 -0
- package/dist/models/batchTypes.js.map +1 -0
- package/dist/models/container.d.ts.map +1 -0
- package/dist/models/container.js.map +1 -0
- package/dist/models/contentDefinitionTypeID.d.ts.map +1 -0
- package/dist/models/contentDefinitionTypeID.js +1 -1
- package/dist/models/contentDefinitionTypeID.js.map +1 -0
- package/dist/models/contentItem.d.ts.map +1 -0
- package/dist/models/contentItem.js.map +1 -0
- package/dist/models/contentItemHistory.d.ts.map +1 -0
- package/dist/models/contentItemHistory.js.map +1 -0
- package/dist/models/contentListFilterModel.d.ts.map +1 -0
- package/dist/models/contentListFilterModel.js.map +1 -0
- package/dist/models/contentSectionDefaultModule.d.ts.map +1 -0
- package/dist/models/contentSectionDefaultModule.js.map +1 -0
- package/dist/models/contentSectionDefinition.d.ts.map +1 -0
- package/dist/models/contentSectionDefinition.js.map +1 -0
- package/dist/models/contentViewColumn.d.ts.map +1 -0
- package/dist/models/contentViewColumn.js.map +1 -0
- package/dist/models/exception.d.ts.map +1 -0
- package/dist/models/exception.js +2 -0
- package/dist/models/exception.js.map +1 -0
- package/dist/models/instanceRole.d.ts.map +1 -0
- package/dist/models/instanceRole.js.map +1 -0
- package/dist/models/instanceUser.d.ts.map +1 -0
- package/dist/models/instanceUser.js.map +1 -0
- package/dist/models/itemComments.d.ts.map +1 -0
- package/dist/models/itemComments.js.map +1 -0
- package/dist/models/listParams.d.ts.map +1 -0
- package/dist/models/listParams.js.map +1 -0
- package/dist/models/locales.d.ts.map +1 -0
- package/dist/models/locales.js +2 -0
- package/dist/models/locales.js.map +1 -0
- package/dist/models/media.d.ts.map +1 -0
- package/dist/models/media.js.map +1 -0
- package/dist/models/model.d.ts.map +1 -0
- package/dist/models/model.js.map +1 -0
- package/dist/models/notification.d.ts.map +1 -0
- package/dist/models/notification.js.map +1 -0
- package/dist/models/options.d.ts.map +1 -0
- package/dist/models/options.js.map +1 -0
- package/dist/models/pageHistory.d.ts.map +1 -0
- package/dist/models/pageHistory.js.map +1 -0
- package/dist/models/pageItem.d.ts.map +1 -0
- package/dist/models/pageItem.js.map +1 -0
- package/dist/models/pageModel.d.ts.map +1 -0
- package/dist/models/pageModel.js.map +1 -0
- package/dist/models/serverUser.d.ts.map +1 -0
- package/dist/models/serverUser.js.map +1 -0
- package/dist/models/sharedModule.d.ts.map +1 -0
- package/dist/models/sharedModule.js.map +1 -0
- package/dist/models/sitemap.d.ts.map +1 -0
- package/dist/models/sitemap.js.map +1 -0
- package/dist/models/webhook.d.ts.map +1 -0
- package/dist/models/webhook.js.map +1 -0
- package/dist/models/websiteListing.d.ts.map +1 -0
- package/dist/models/websiteListing.js.map +1 -0
- package/dist/models/websiteUser.d.ts.map +1 -0
- package/dist/models/websiteUser.js.map +1 -0
- package/docs/asset-methods.md +382 -0
- package/docs/auth-component.md +361 -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 +1 -1
package/.env
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Agility CMS SDK Configuration
|
|
2
|
+
AGILITY_GUID=f3866b86-u
|
|
3
|
+
AGILITY_API_KEY=defaultpreview.2672a9e1f5f8fade023029763b540c64eabfab48f92e693fa01081d845783dca
|
|
4
|
+
AGILITY_LOCALES=en-us
|
|
5
|
+
AGILITY_SITEMAP=website
|
|
6
|
+
AGILITY_API_ISPREVIEW=true
|
|
7
|
+
AGILITY_MANAGEMENT_API_BASE_URL=https://mgmt.aglty.io
|
|
8
|
+
|
|
9
|
+
# Test Environment Selection (dev, prod, prod-aus, prod-ca, prod-eu, preprod-contentserver, preprod-fetchapi)
|
|
10
|
+
# TEST_ENV=dev // passed in by CI/CD and packages script
|
|
11
|
+
|
|
12
|
+
# Azure Storage Configuration (for token management)
|
|
13
|
+
STORAGE_ACCOUNT=agilitydevstorage
|
|
14
|
+
STORAGE_ACCOUNT_KEY=JrNwq93Zi9B0FJfqTToMQvArtyrNsGdgEVxaUgfMs/Uuv2+aatR5kRNRUeyuxTITJe7zw7n8mQTw+AStU9I1Bg==
|
|
15
|
+
STORAGE_ACCOUNT_TABLE=TokenInfo
|
|
16
|
+
|
|
17
|
+
# Dev Environment Configuration
|
|
18
|
+
DEV_GUID=c741222b-1080-45f6-9a7f-982381c5a485
|
|
19
|
+
DEV_API_KEY_FETCH=UnitTestsFetch.2ace650991363fbcffa6776d411d1b0d616b8e3424ce842b81cba7af0039197e
|
|
20
|
+
DEV_API_KEY_PREVIEW=UnitTestsPreview.69e6bca345ced0b7ca5ab358b351ea5c870790a5945c25d749a865332906b124
|
|
21
|
+
DEV_WEBSITE_NAME=Headless Integration Testing
|
|
22
|
+
DEV_SECURITY_KEY=SABlAGEAZABsAGUAcwBzACAASQBuAHQAZQBnAHIAYQB0AGkAbwBuACAAVABlAHMAdABpAG4AZwAtAEEANwA5ADUANAAxAEMANQAtAEUAQgAzADIALQA0ADYAMwBCAC0AQgBBADYANgAtADkARQBDAEMANwBCADYAOAA3ADYANQBFAA==
|
|
23
|
+
DEV_CONTENT_SERVER_BASE_URL=https://dev-contentserver.publishwithagility.com
|
|
24
|
+
DEV_FETCH_API_BASE_URL=https://api-dev.aglty.io
|
|
25
|
+
DEV_DIRECT_FETCH_API_BASE_URL=http://agility-fetch-api-dev.azurewebsites.net
|
|
26
|
+
DEV_MANAGEMENT_API_BASE_URL=https://mgmt-dev.aglty.io
|
|
27
|
+
|
|
28
|
+
# Production Environment Configuration
|
|
29
|
+
PROD_GUID=9de2e54a-ff2f-426c-b424-08ff5f86fa89
|
|
30
|
+
PROD_API_KEY_FETCH=defaultlive.b47f945a9af1a76e3f8f78d2f00b314e22bab26f23f3db6e1d22133be00243ac
|
|
31
|
+
PROD_API_KEY_PREVIEW=defaultpreview.2d48ab74ab1337b444207510d89988aedf07300bbba33e6771ed0b5d825d47b5
|
|
32
|
+
PROD_WEBSITE_NAME=Headless Integration Testing
|
|
33
|
+
PROD_SECURITY_KEY=SABlAGEAZABsAGUAcwBzACAASQBuAHQAZQBnAHIAYQB0AGkAbwBuACAAVABlAHMAdABpAG4AZwAtAEEANwA5ADUANAAxAEMANQAtAEUAQgAzADIALQA0ADYAMwBCAC0AQgBBADYANgAtADkARQBDAEMANwBCADYAOAA3ADYANQBFAA==
|
|
34
|
+
PROD_CONTENT_SERVER_BASE_URL=https://contentserver1503.agilitycms.com
|
|
35
|
+
PROD_FETCH_API_BASE_URL=https://api.aglty.io
|
|
36
|
+
PROD_DIRECT_FETCH_API_BASE_URL=https://agility-fetch-api-usa.azurewebsites.net
|
|
37
|
+
PROD_MANAGEMENT_API_BASE_URL=https://mgmt.aglty.io
|
|
38
|
+
|
|
39
|
+
# Production Australia Environment Configuration
|
|
40
|
+
PROD_AUS_GUID=6155f68e-a
|
|
41
|
+
PROD_AUS_API_KEY_FETCH=fetch.c89b614a7355f459fa849c1bb2e2fb7d389551317fd35a170c482ab1c52098a1
|
|
42
|
+
PROD_AUS_API_KEY_PREVIEW=preview.8ad5baa258698b3faf9ce7f420b43d2ea6384b4d3cf610b8e280c7d5c1ba00be
|
|
43
|
+
PROD_AUS_WEBSITE_NAME=Headless Integration Testing - AUS
|
|
44
|
+
PROD_AUS_SECURITY_KEY=SABlAGEAZABsAGUAcwBzACAASQBuAHQAZQBnAHIAYQB0AGkAbwBuACAAVABlAHMAdABpAG4AZwAtAEEANwA5ADUANAAxAEMANQAtAEUAQgAzADIALQA0ADYAMwBCAC0AQgBBADYANgAtADkARQBDAEMANwBCADYAOAA3ADYANQBFAA==
|
|
45
|
+
PROD_AUS_CONTENT_SERVER_BASE_URL=https://contentserver-aus.agilitycms.com
|
|
46
|
+
PROD_AUS_FETCH_API_BASE_URL=https://api-aus.aglty.io
|
|
47
|
+
PROD_AUS_DIRECT_FETCH_API_BASE_URL=https://agility-fetch-api-aus.azurewebsites.net/
|
|
48
|
+
PROD_AUS_MANAGEMENT_API_BASE_URL=https://mgmt-aus.aglty.io
|
|
49
|
+
|
|
50
|
+
# Production Canada Environment Configuration
|
|
51
|
+
PROD_CA_GUID=9de2e54a-ff2f-426c-b424-190060970b9a
|
|
52
|
+
PROD_CA_API_KEY_FETCH=Fetch.de1ff4693f4dd06cb2f350e901ac994fd9b2b1c692ff34ada13776b21be7abc2
|
|
53
|
+
PROD_CA_API_KEY_PREVIEW=Preview.c7450fccf0089edc128fdd7954269b61ba363f63b409ece79c007596e722f205
|
|
54
|
+
PROD_CA_WEBSITE_NAME=Headless Integration Testing - CA
|
|
55
|
+
PROD_CA_SECURITY_KEY=SABlAGEAZABsAGUAcwBzACAASQBuAHQAZQBnAHIAYQB0AGkAbwBuACAAVABlAHMAdABpAG4AZwAtAEEANwA5ADUANAAxAEMANQAtAEUAQgAzADIALQA0ADYAMwBCAC0AQgBBADYANgAtADkARQBDAEMANwBCADYAOAA3ADYANQBFAA==
|
|
56
|
+
PROD_CA_CONTENT_SERVER_BASE_URL=https://contentserver-ca.agilitycms.com
|
|
57
|
+
PROD_CA_FETCH_API_BASE_URL=https://api-ca.aglty.io
|
|
58
|
+
PROD_CA_DIRECT_FETCH_API_BASE_URL=https://agility-fetch-api-canada.azurewebsites.net
|
|
59
|
+
PROD_CA_MANAGEMENT_API_BASE_URL=https://mgmt-ca.aglty.io
|
|
60
|
+
|
|
61
|
+
# Production Europe Environment Configuration
|
|
62
|
+
PROD_EU_GUID=9de2e54a-ff2f-426c-b424-201171a81cab
|
|
63
|
+
PROD_EU_API_KEY_FETCH=Fetch.2c4e5d26008c0c964d2da5fe99714163b996696424c375c3c9ef44326405e702
|
|
64
|
+
PROD_EU_API_KEY_PREVIEW=Preview.64254d904a0cc4011f4d582b4a93e5e56fd0f2f516f190477ada67c322ee8a17
|
|
65
|
+
PROD_EU_WEBSITE_NAME=Headless Integration Testing - EU
|
|
66
|
+
PROD_EU_SECURITY_KEY=SABlAGEAZABsAGUAcwBzACAASQBuAHQAZQBnAHIAYQB0AGkAbwBuACAAVABlAHMAdABpAG4AZwAtAEEANwA5ADUANAAxAEMANQAtAEUAQgAzADIALQA0ADYAMwBCAC0AQgBBADYANgAtADkARQBDAEMANwBCADYAOAA3ADYANQBFAA==
|
|
67
|
+
PROD_EU_CONTENT_SERVER_BASE_URL=https://contentserver-eu.agilitycms.com
|
|
68
|
+
PROD_EU_FETCH_API_BASE_URL=https://api-eu.aglty.io
|
|
69
|
+
PROD_EU_DIRECT_FETCH_API_BASE_URL=https://agility-fetch-api-europe.azurewebsites.net
|
|
70
|
+
PROD_EU_MANAGEMENT_API_BASE_URL=https://mgmt-eu.aglty.io
|
|
71
|
+
|
|
72
|
+
# Preprod Content Server Environment Configuration
|
|
73
|
+
PREPROD_CONTENTSERVER_GUID=9de2e54a-ff2f-426c-b424-08ff5f86fa89
|
|
74
|
+
PREPROD_CONTENTSERVER_API_KEY_FETCH=defaultlive.b47f945a9af1a76e3f8f78d2f00b314e22bab26f23f3db6e1d22133be00243ac
|
|
75
|
+
PREPROD_CONTENTSERVER_API_KEY_PREVIEW=defaultpreview.2d48ab74ab1337b444207510d89988aedf07300bbba33e6771ed0b5d825d47b5
|
|
76
|
+
PREPROD_CONTENTSERVER_WEBSITE_NAME=Headless Integration Testing
|
|
77
|
+
PREPROD_CONTENTSERVER_SECURITY_KEY=SABlAGEAZABsAGUAcwBzACAASQBuAHQAZQBnAHIAYQB0AGkAbwBuACAAVABlAHMAdABpAG4AZwAtAEEANwA5ADUANAAxAEMANQAtAEUAQgAzADIALQA0ADYAMwBCAC0AQgBBADYANgAtADkARQBDAEMANwBCADYAOAA3ADYANQBFAA==
|
|
78
|
+
PREPROD_CONTENTSERVER_CONTENT_SERVER_BASE_URL=https://contentserver-usa-preprod.azurewebsites.net
|
|
79
|
+
PREPROD_CONTENTSERVER_FETCH_API_BASE_URL=https://api.aglty.io
|
|
80
|
+
PREPROD_CONTENTSERVER_DIRECT_FETCH_API_BASE_URL=https://agility-fetch-api-usa.azurewebsites.net
|
|
81
|
+
PREPROD_CONTENTSERVER_MANAGEMENT_API_BASE_URL=https://mgmt.aglty.io
|
|
82
|
+
|
|
83
|
+
# Preprod Fetch API Environment Configuration
|
|
84
|
+
PREPROD_FETCHAPI_GUID=9de2e54a-ff2f-426c-b424-08ff5f86fa89
|
|
85
|
+
PREPROD_FETCHAPI_API_KEY_FETCH=defaultlive.b47f945a9af1a76e3f8f78d2f00b314e22bab26f23f3db6e1d22133be00243ac
|
|
86
|
+
PREPROD_FETCHAPI_API_KEY_PREVIEW=defaultpreview.2d48ab74ab1337b444207510d89988aedf07300bbba33e6771ed0b5d825d47b5
|
|
87
|
+
PREPROD_FETCHAPI_WEBSITE_NAME=Headless Integration Testing
|
|
88
|
+
PREPROD_FETCHAPI_SECURITY_KEY=SABlAGEAZABsAGUAcwBzACAASQBuAHQAZQBnAHIAYQB0AGkAbwBuACAAVABlAHMAdABpAG4AZwAtAEEANwA5ADUANAAxAEMANQAtAEUAQgAzADIALQA0ADYAMwBCAC0AQgBBADYANgAtADkARQBDAEMANwBCADYAOAA3ADYANQBFAA==
|
|
89
|
+
PREPROD_FETCHAPI_CONTENT_SERVER_BASE_URL=https://contentserver1503.agilitycms.com
|
|
90
|
+
PREPROD_FETCHAPI_FETCH_API_BASE_URL=https://api.aglty.io
|
|
91
|
+
PREPROD_FETCHAPI_DIRECT_FETCH_API_BASE_URL=https://agility-fetch-api-usa-preprod.azurewebsites.net
|
|
92
|
+
PREPROD_FETCHAPI_MANAGEMENT_API_BASE_URL=https://mgmt.aglty.io
|
package/README.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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.
|
|
@@ -17,9 +29,11 @@
|
|
|
17
29
|
3. You will need valid Agility CMS credentials to authenticate and obtain an access token.
|
|
18
30
|
|
|
19
31
|
### Authentication
|
|
20
|
-
|
|
32
|
+
For detailed authentication instructions, including OAuth 2.0 setup, token management, and security best practices, see the **[Authentication & Setup Guide](./docs/auth.md)**.
|
|
33
|
+
|
|
34
|
+
### Making a Request
|
|
21
35
|
|
|
22
|
-
|
|
36
|
+
#### Simple OAuth Authentication (Recommended)
|
|
23
37
|
|
|
24
38
|
1. First, initiate the authorization flow by making a GET request to the authorization endpoint:
|
|
25
39
|
```javascript
|
|
@@ -88,329 +102,107 @@ const response = await fetch('https://mgmt.aglty.io/oauth/refresh', {
|
|
|
88
102
|
const { access_token, refresh_token, expires_in } = await response.json();
|
|
89
103
|
```
|
|
90
104
|
|
|
91
|
-
Note:
|
|
92
|
-
- The access token has a limited lifetime (typically 1 hour)
|
|
93
|
-
- The refresh token can be used to obtain new access tokens
|
|
94
|
-
- Store refresh tokens securely and never expose them in client-side code
|
|
95
|
-
- Implement proper error handling for authentication failures
|
|
96
105
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```Javascript
|
|
106
|
+
#### Manual Token Authentication (For CI/CD)
|
|
107
|
+
```typescript
|
|
100
108
|
import * as mgmtApi from "@agility/management-sdk";
|
|
101
109
|
|
|
102
|
-
//
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
//Initialize the APIClient Class
|
|
107
|
-
let apiClient = new mgmtApi.ApiClient(options);
|
|
108
|
-
|
|
109
|
-
let guid = "<<Provide the Guid of the Website>>";
|
|
110
|
-
let locale = "<<Provide the locale of the Website>>"; //Example: en-us
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
//make the request: get a content item with the ID '22'
|
|
115
|
-
var contentItem = await apiClient.contentMethods.getContentItem(22,guid, locale);
|
|
116
|
-
|
|
117
|
-
//To log the response of the contentItem object in console.
|
|
118
|
-
console.log(JSON.stringify(contentItem));
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## Understanding Agility CMS Batch Architecture
|
|
122
|
-
|
|
123
|
-
Agility CMS uses a simple approach for working with content and batches:
|
|
124
|
-
|
|
125
|
-
### Content/Page Creation (Handled by Respective Controllers)
|
|
126
|
-
- **contentMethods.saveContentItem()** - Creates a single new content item and adds it to a batch
|
|
127
|
-
- **contentMethods.saveContentItems()** - Creates multiple new content items and adds them to a batch
|
|
128
|
-
- **pageMethods.savePage()** - Creates a new page and adds it to a batch
|
|
129
|
-
- These methods create the content AND automatically handle batch creation/management
|
|
130
|
-
|
|
131
|
-
### Batch Workflow Operations (Handled by Batch Controller)
|
|
132
|
-
- **batchMethods.publishBatch()** - Publishes all items in an existing batch
|
|
133
|
-
- **batchMethods.unpublishBatch()** - Unpublishes all items in an existing batch
|
|
134
|
-
- **batchMethods.approveBatch()** - Approves all items in an existing batch
|
|
135
|
-
- **batchMethods.declineBatch()** - Declines all items in an existing batch
|
|
136
|
-
- **batchMethods.requestApprovalBatch()** - Requests approval for all items in an existing batch
|
|
137
|
-
- **batchMethods.getBatch()** - Retrieves details of an existing batch
|
|
138
|
-
- **batchMethods.getBatchTypes()** - Retrieves all batch-related enum types for developer discovery
|
|
139
|
-
|
|
140
|
-
## Class AssetMethods
|
|
141
|
-
This class is used to perform operations related to Assets. The following are the methods: -
|
|
142
|
-
|
|
143
|
-
### upload
|
|
144
|
-
| Parameter | Type | Description |
|
|
145
|
-
| :-------- | :------- | :------------------------- |
|
|
146
|
-
| `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>>');`|
|
|
147
|
-
| `agilityFolderPath` | `string` | Path of the folder in Agility where the file(s) needs to be uploaded.|
|
|
148
|
-
| `guid` | `string` | Current website guid.|
|
|
149
|
-
| `groupingID` | `number` | Path of the folder in Agility where the file(s) needs to be uploaded.|
|
|
150
|
-
|
|
151
|
-
Returns: A collection of ```Media``` class Object.
|
|
152
|
-
|
|
153
|
-
### createFolder
|
|
154
|
-
| Parameter | Type | Description |
|
|
155
|
-
| :-------- | :------- | :------------------------- |
|
|
156
|
-
| `originKey` | `string` | The origin key of the requested folder. |
|
|
157
|
-
| `guid` | `string` | Current website guid.|
|
|
158
|
-
|
|
159
|
-
Returns: A collection of ```Media``` class Object.
|
|
160
|
-
|
|
161
|
-
### deleteFolder
|
|
162
|
-
| Parameter | Type | Description |
|
|
163
|
-
| :-------- | :------- | :------------------------- |
|
|
164
|
-
| `originKey` | `string` | The origin key of the requested folder. |
|
|
165
|
-
| `guid` | `string` | Current website guid.|
|
|
166
|
-
| `mediaID` | `number` | The mediaID of the folder that needs to be deleted.|
|
|
167
|
-
|
|
168
|
-
### renameFolder
|
|
169
|
-
| Parameter | Type | Description |
|
|
170
|
-
| :-------- | :------- | :------------------------- |
|
|
171
|
-
| `folderName` | `string` | The original folder name. |
|
|
172
|
-
| `newFolderName` | `string` | The new folder name. |
|
|
173
|
-
| `guid` | `string` | Current website guid.|
|
|
174
|
-
| `mediaID` | `number` | The mediaID of the folder that needs to be renamed.|
|
|
175
|
-
|
|
176
|
-
### deleteFile
|
|
177
|
-
| Parameter | Type | Description |
|
|
178
|
-
| :-------- | :------- | :------------------------- |
|
|
179
|
-
| `mediaID` | `number` | The mediaID of the asset which needs to be deleted.|
|
|
180
|
-
| `guid` | `string` | Current website guid.|
|
|
181
|
-
Returns
|
|
182
|
-
A ```string``` response if a file has been deleted.
|
|
183
|
-
|
|
184
|
-
### moveFile
|
|
185
|
-
| Parameter | Type | Description |
|
|
186
|
-
| :-------- | :------- | :------------------------- |
|
|
187
|
-
| `mediaID` | `number` | The mediaID of the file that needs to be moved.|
|
|
188
|
-
| `newFolder` | `string` | The new location (in Agility) where the file needs to be moved.|
|
|
189
|
-
| `guid` | `string` | Current website guid.|
|
|
190
|
-
|
|
191
|
-
Returns: An object of ```Media``` class with the new location of the file.
|
|
192
|
-
|
|
193
|
-
### getMediaList
|
|
194
|
-
| Parameter | Type | Description |
|
|
195
|
-
| :-------- | :------- | :------------------------- |
|
|
196
|
-
| `pageSize` | `number` | The page size on which the assets needs to selected.|
|
|
197
|
-
| `recordOffset` | `number` | The record offset value to skip search results.|
|
|
198
|
-
| `guid` | `string` | Current website guid.|
|
|
199
|
-
|
|
200
|
-
Returns: An object of ```AssetMediaList``` class.
|
|
201
|
-
|
|
202
|
-
### getGalleryById
|
|
203
|
-
| Parameter | Type | Description |
|
|
204
|
-
| :-------- | :------- | :------------------------- |
|
|
205
|
-
| `guid` | `string` | Current website guid.|
|
|
206
|
-
| `id` | `number` | The ID of the requested gallery.|
|
|
207
|
-
|
|
208
|
-
Returns: An object of ```assetMediaGrouping``` class.
|
|
209
|
-
|
|
210
|
-
### getGalleryByName
|
|
211
|
-
| Parameter | Type | Description |
|
|
212
|
-
| :-------- | :------- | :------------------------- |
|
|
213
|
-
| `guid` | `string` | Current website guid.|
|
|
214
|
-
| `galleryName` | `string` | The name of the requested gallery.|
|
|
215
|
-
|
|
216
|
-
Returns: An object of ```assetMediaGrouping``` class.
|
|
217
|
-
|
|
218
|
-
### getDefaultContainer
|
|
219
|
-
| Parameter | Type | Description |
|
|
220
|
-
| :-------- | :------- | :------------------------- |
|
|
221
|
-
| `guid` | `string` | Current website guid.|
|
|
222
|
-
|
|
223
|
-
Returns: An object of ```assetContainer``` class.
|
|
224
|
-
|
|
225
|
-
### getGalleries
|
|
226
|
-
| Parameter | Type | Description |
|
|
227
|
-
| :-------- | :------- | :------------------------- |
|
|
228
|
-
| `guid` | `string` | Current website guid.|
|
|
229
|
-
| `search` | `string` | String to search a specific gallery item.|
|
|
230
|
-
| `pageSize` | `number` | The pageSize on which the galleries needs to be selected.|
|
|
231
|
-
| `rowIndex` | `number` | The rowIndex value for the resultant record set.|
|
|
232
|
-
|
|
233
|
-
Returns: An object of ```assetGalleries``` class.
|
|
234
|
-
|
|
235
|
-
### saveGallery
|
|
236
|
-
| Parameter | Type | Description |
|
|
237
|
-
| :-------- | :------- | :------------------------- |
|
|
238
|
-
| `guid` | `string` | Current website guid.|
|
|
239
|
-
| `gallery` | `assetMediaGrouping` | Object of AssetMediaGrouping class.|
|
|
240
|
-
|
|
241
|
-
Returns: An object of ```assetMediaGrouping``` class.
|
|
242
|
-
|
|
243
|
-
### deleteGallery
|
|
244
|
-
| Parameter | Type | Description |
|
|
245
|
-
| :-------- | :------- | :------------------------- |
|
|
246
|
-
| `guid` | `string` | Current website guid.|
|
|
247
|
-
| `id` | `number` | The id of the gallery to be deleted.|
|
|
248
|
-
|
|
249
|
-
A ```string``` response if the gallery has been deleted.
|
|
250
|
-
|
|
251
|
-
### getAssetByID
|
|
252
|
-
| Parameter | Type | Description |
|
|
253
|
-
| :-------- | :------- | :------------------------- |
|
|
254
|
-
| `mediaID` | `number` | The mediaID of the requested asset.|
|
|
255
|
-
| `guid` | `string` | Current website guid.|
|
|
256
|
-
|
|
257
|
-
Returns: An object of ```Media``` class with the information of the asset.
|
|
258
|
-
|
|
259
|
-
### getAssetByUrl
|
|
260
|
-
| Parameter | Type | Description |
|
|
261
|
-
| :-------- | :------- | :------------------------- |
|
|
262
|
-
| `url` | `string` | The url of the requested asset.|
|
|
263
|
-
| `guid` | `string` | Current website guid.|
|
|
264
|
-
|
|
265
|
-
Returns: An object of ```Media``` class with the information of the asset.
|
|
266
|
-
|
|
267
|
-
## Class BatchMethods
|
|
268
|
-
This class is used to perform **workflow operations** on existing batches.
|
|
269
|
-
|
|
270
|
-
**Important**: To CREATE new content or pages, use `contentMethods.saveContentItem(s)` or `pageMethods.savePage()` instead. These batch methods are for managing workflow operations (publish, unpublish, approve, etc.) on existing batches.
|
|
271
|
-
|
|
272
|
-
### getBatch
|
|
273
|
-
Retrieves details of an existing batch.
|
|
274
|
-
|
|
275
|
-
| Parameter | Type | Description |
|
|
276
|
-
| :-------- | :------- | :------------------------- |
|
|
277
|
-
| `batchID` | `number` | The batchID of the requested batch.|
|
|
278
|
-
| `guid` | `string` | Current website guid.|
|
|
279
|
-
| `expandItems` | `boolean` | *(Optional)* Whether to include full item details. Default: `true`|
|
|
110
|
+
// Token-based approach for CI/CD and automated environments
|
|
111
|
+
const options = new mgmtApi.Options();
|
|
112
|
+
options.token = process.env.AGILITY_API_TOKEN;
|
|
113
|
+
const apiClient = new mgmtApi.ApiClient(options);
|
|
280
114
|
|
|
281
|
-
|
|
115
|
+
const guid = process.env.AGILITY_GUID;
|
|
116
|
+
const locale = "en-us";
|
|
282
117
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
const batch = await apiClient.batchMethods.getBatch(123, guid);
|
|
286
|
-
|
|
287
|
-
// Get basic batch information only (performance optimization)
|
|
288
|
-
const batchBasic = await apiClient.batchMethods.getBatch(123, guid, false);
|
|
118
|
+
const contentItem = await apiClient.contentMethods.getContentItem(22, guid, locale);
|
|
119
|
+
console.log('Content retrieved:', contentItem.fields.title);
|
|
289
120
|
```
|
|
290
121
|
|
|
291
|
-
|
|
292
|
-
Publishes all items in an existing batch.
|
|
122
|
+
> 💡 **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.
|
|
293
123
|
|
|
294
|
-
|
|
295
|
-
| :-------- | :------- | :------------------------- |
|
|
296
|
-
| `batchID` | `number` | The batchID of the batch to publish.|
|
|
297
|
-
| `guid` | `string` | Current website guid.|
|
|
298
|
-
| `returnBatchId` | `boolean` | *(Optional)* If `true`, returns batch ID immediately. If `false` (default), waits for completion.|
|
|
124
|
+
## API Method Classes
|
|
299
125
|
|
|
300
|
-
|
|
126
|
+
### File and Media Management
|
|
127
|
+
- **[AssetMethods](./docs/asset-methods.md)** - File and media management operations (15 functions)
|
|
128
|
+
- [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)
|
|
301
129
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
// Publish batch and return immediately for custom polling
|
|
307
|
-
const batchId = await apiClient.batchMethods.publishBatch(123, guid, true);
|
|
308
|
-
```
|
|
130
|
+
### Workflow Operations
|
|
131
|
+
- **[BatchMethods](./docs/batch-methods.md)** - Batch workflow operations (7 functions)
|
|
132
|
+
- [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)
|
|
309
133
|
|
|
310
|
-
###
|
|
311
|
-
|
|
134
|
+
### Content Management
|
|
135
|
+
- **[ContainerMethods](./docs/container-methods.md)** - Container management operations (8 functions)
|
|
136
|
+
- [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)
|
|
312
137
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
| `batchID` | `number` | The batchID of the batch to unpublish.|
|
|
316
|
-
| `guid` | `string` | Current website guid.|
|
|
317
|
-
| `returnBatchId` | `boolean` | *(Optional)* If `true`, returns batch ID immediately. If `false` (default), waits for completion.|
|
|
138
|
+
- **[ContentMethods](./docs/content-methods.md)** - Content item operations (13 functions)
|
|
139
|
+
- [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)
|
|
318
140
|
|
|
319
|
-
|
|
141
|
+
- **[ModelMethods](./docs/model-methods.md)** - Content model operations (6 functions)
|
|
142
|
+
- [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)
|
|
320
143
|
|
|
321
|
-
###
|
|
322
|
-
|
|
144
|
+
### Page Management
|
|
145
|
+
- **[PageMethods](./docs/page-methods.md)** - Page management operations (17 functions)
|
|
146
|
+
- [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)
|
|
323
147
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
| `guid` | `string` | Current website guid.|
|
|
328
|
-
| `returnBatchId` | `boolean` | *(Optional)* If `true`, returns batch ID immediately. If `false` (default), waits for completion.|
|
|
148
|
+
### User Management
|
|
149
|
+
- **[InstanceMethods](./docs/instance-methods.md)** - Instance-level operations (1 function)
|
|
150
|
+
- [getLocales](./docs/instance-methods.md#getlocales)
|
|
329
151
|
|
|
330
|
-
|
|
152
|
+
- **[InstanceUserMethods](./docs/instance-user-methods.md)** - Instance user management (3 functions)
|
|
153
|
+
- [getUsers](./docs/instance-user-methods.md#getusers), [saveUser](./docs/instance-user-methods.md#saveuser), [deleteUser](./docs/instance-user-methods.md#deleteuser)
|
|
331
154
|
|
|
332
|
-
|
|
333
|
-
|
|
155
|
+
- **[ServerUserMethods](./docs/server-user-methods.md)** - Server user operations (2 functions)
|
|
156
|
+
- [me](./docs/server-user-methods.md#me), [you](./docs/server-user-methods.md#you)
|
|
334
157
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
| `guid` | `string` | Current website guid.|
|
|
339
|
-
| `returnBatchId` | `boolean` | *(Optional)* If `true`, returns batch ID immediately. If `false` (default), waits for completion.|
|
|
158
|
+
### Integration
|
|
159
|
+
- **[WebhookMethods](./docs/webhook-methods.md)** - Webhook management (4 functions)
|
|
160
|
+
- [getWebhook](./docs/webhook-methods.md#getwebhook), [webhookList](./docs/webhook-methods.md#webhooklist), [saveWebhook](./docs/webhook-methods.md#savewebhook), [deleteWebhook](./docs/webhook-methods.md#deletewebhook)
|
|
340
161
|
|
|
341
|
-
|
|
162
|
+
### Multi-Instance Operations
|
|
163
|
+
- **[Multi-Instance Operations](./docs/multi-instance-operations.md)** - Advanced workflows for managing content across multiple instances and locales
|
|
164
|
+
- Configuration-driven content creation across multiple environments
|
|
165
|
+
- Parallel processing and batch operations
|
|
166
|
+
- Performance optimization and error handling
|
|
167
|
+
- Cross-instance synchronization and reporting
|
|
342
168
|
|
|
343
|
-
###
|
|
344
|
-
|
|
169
|
+
### CI/CD & Automation
|
|
170
|
+
- **[CI/CD & Automated Environments](./docs/cicd.md)** - Token-based authentication for automated environments
|
|
171
|
+
- CI/CD pipeline examples (GitHub Actions, GitLab CI, Jenkins)
|
|
172
|
+
- Serverless functions (AWS Lambda, Vercel)
|
|
173
|
+
- Environment configuration and security best practices
|
|
174
|
+
- Token management and rotation
|
|
345
175
|
|
|
346
|
-
|
|
347
|
-
| :-------- | :------- | :------------------------- |
|
|
348
|
-
| `batchID` | `number` | The batchID of the batch to request approval for.|
|
|
349
|
-
| `guid` | `string` | Current website guid.|
|
|
350
|
-
| `returnBatchId` | `boolean` | *(Optional)* If `true`, returns batch ID immediately. If `false` (default), waits for completion.|
|
|
176
|
+
## Examples
|
|
351
177
|
|
|
352
|
-
|
|
178
|
+
### Understanding Agility CMS Batch Architecture
|
|
353
179
|
|
|
354
|
-
|
|
355
|
-
Retrieves all batch-related enum types for developer discovery and dynamic UI population.
|
|
180
|
+
Agility CMS uses a simple approach for working with content and batches:
|
|
356
181
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
182
|
+
#### Content/Page Creation (Handled by Respective Controllers)
|
|
183
|
+
- **contentMethods.saveContentItem()** - Creates a single new content item and adds it to a batch
|
|
184
|
+
- **contentMethods.saveContentItems()** - Creates multiple new content items and adds them to a batch
|
|
185
|
+
- **pageMethods.savePage()** - Creates a new page and adds it to a batch
|
|
186
|
+
- These methods create the content AND automatically handle batch creation/management
|
|
360
187
|
|
|
361
|
-
|
|
188
|
+
#### Batch Workflow Operations (Handled by Batch Controller)
|
|
189
|
+
- **batchMethods.publishBatch()** - Publishes all items in an existing batch
|
|
190
|
+
- **batchMethods.unpublishBatch()** - Unpublishes all items in an existing batch
|
|
191
|
+
- **batchMethods.approveBatch()** - Approves all items in an existing batch
|
|
192
|
+
- **batchMethods.declineBatch()** - Declines all items in an existing batch
|
|
193
|
+
- **batchMethods.requestApprovalBatch()** - Requests approval for all items in an existing batch
|
|
194
|
+
- **batchMethods.getBatch()** - Retrieves details of an existing batch
|
|
195
|
+
- **batchMethods.getBatchTypes()** - Retrieves all batch-related enum types for developer discovery
|
|
362
196
|
|
|
363
|
-
|
|
364
|
-
// Get all batch types for dynamic UI population
|
|
365
|
-
const types = await apiClient.batchMethods.getBatchTypes(guid);
|
|
366
|
-
|
|
367
|
-
// Create dropdown options for item types
|
|
368
|
-
const itemTypeOptions = types.itemTypes.map(type => ({
|
|
369
|
-
label: type.name,
|
|
370
|
-
value: type.value
|
|
371
|
-
}));
|
|
372
|
-
|
|
373
|
-
// Validate operation type
|
|
374
|
-
const isValidWorkflowOperation = (value) =>
|
|
375
|
-
types.workflowOperations.some(op => op.value === value);
|
|
376
|
-
|
|
377
|
-
// Access specific enum data
|
|
378
|
-
console.log('Available item types:', types.itemTypes);
|
|
379
|
-
console.log('Available workflow operations:', types.workflowOperations);
|
|
380
|
-
console.log('Available batch states:', types.states);
|
|
381
|
-
console.log('All operation types:', types.operationTypes);
|
|
382
|
-
```
|
|
197
|
+
### Complete Workflow Example
|
|
383
198
|
|
|
384
|
-
**Response Structure:**
|
|
385
199
|
```typescript
|
|
386
|
-
|
|
387
|
-
itemTypes: EnumInfo[]; // Page, ContentItem, ContentList, Tag, ModuleDef
|
|
388
|
-
operationTypes: EnumInfo[]; // All operation types
|
|
389
|
-
workflowOperations: EnumInfo[]; // Publish, Unpublish, Approve, Decline, RequestApproval
|
|
390
|
-
states: EnumInfo[]; // None, Pending, InProcess, Processed, Deleted
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
interface EnumInfo {
|
|
394
|
-
value: number; // Numeric enum value
|
|
395
|
-
name: string; // String name (e.g., "Publish")
|
|
396
|
-
description: string; // Human-readable description
|
|
397
|
-
}
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
**Benefits:**
|
|
401
|
-
- 🎨 **Dynamic UI Population** - Frontend dropdowns populate automatically
|
|
402
|
-
- ✅ **Client Validation** - Validate inputs against live API data
|
|
403
|
-
- 🔍 **API Discovery** - Explore options without reading docs
|
|
404
|
-
- 🚀 **Future-Proof** - New enum values appear automatically
|
|
200
|
+
import * as mgmtApi from '@agility/management-sdk';
|
|
405
201
|
|
|
406
|
-
|
|
202
|
+
// Authenticate with simple OAuth flow
|
|
203
|
+
const client = new mgmtApi.ApiClient();
|
|
204
|
+
await client.auth();
|
|
407
205
|
|
|
408
|
-
Here's a complete example showing how to work with batches:
|
|
409
|
-
|
|
410
|
-
```typescript
|
|
411
|
-
import { ApiClient } from '@agility/management-sdk';
|
|
412
|
-
|
|
413
|
-
const client = new ApiClient({ token: 'your-token' });
|
|
414
206
|
const guid = 'your-instance-guid';
|
|
415
207
|
const locale = 'en-us';
|
|
416
208
|
|
|
@@ -458,26 +250,6 @@ console.log('Batch submitted for publishing:', batchId);
|
|
|
458
250
|
console.log('All operations completed successfully!');
|
|
459
251
|
```
|
|
460
252
|
|
|
461
|
-
## Summary: Complete BatchMethods API
|
|
462
|
-
|
|
463
|
-
The `BatchMethods` class provides **7 essential methods** for batch workflow management:
|
|
464
|
-
|
|
465
|
-
### **Batch Operations (7 methods)**
|
|
466
|
-
- `getBatch()` - Retrieve batch details and status
|
|
467
|
-
- `publishBatch()` - Publish all items in a batch
|
|
468
|
-
- `unpublishBatch()` - Unpublish all items in a batch
|
|
469
|
-
- `approveBatch()` - Approve all items in a batch
|
|
470
|
-
- `declineBatch()` - Decline all items in a batch
|
|
471
|
-
- `requestApprovalBatch()` - Request approval for all items in a batch
|
|
472
|
-
- `getBatchTypes()` - Get all enum types for dynamic UIs
|
|
473
|
-
|
|
474
|
-
**Developer Experience Features:**
|
|
475
|
-
- 🎨 **Dynamic UI Support** - `getBatchTypes()` populates dropdowns automatically
|
|
476
|
-
- ✅ **Strong Typing** - Full TypeScript support with intellisense
|
|
477
|
-
- 🔄 **Auto-Retry Logic** - Built-in polling for operation completion
|
|
478
|
-
- 📚 **Self-Documenting** - Enum discovery eliminates hard-coded values
|
|
479
|
-
- ⚡ **Streamlined API** - Focused on essential batch workflow operations
|
|
480
|
-
|
|
481
253
|
## TypeScript Interfaces
|
|
482
254
|
|
|
483
255
|
### Batch Response Interfaces
|