webflow-api 2.4.0 → 2.5.0
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/.mock/definition/__package__.yml +2495 -0
- package/.mock/definition/accessGroups.yml +80 -0
- package/.mock/definition/api.yml +13 -0
- package/.mock/definition/assets.yml +414 -0
- package/.mock/definition/collections/fields.yml +187 -0
- package/.mock/definition/collections/items.yml +1511 -0
- package/.mock/definition/collections.yml +185 -0
- package/.mock/definition/ecommerce.yml +42 -0
- package/.mock/definition/forms.yml +301 -0
- package/.mock/definition/inventory.yml +120 -0
- package/.mock/definition/orders.yml +1569 -0
- package/.mock/definition/pages/scripts.yml +169 -0
- package/.mock/definition/pages.yml +443 -0
- package/.mock/definition/products.yml +500 -0
- package/.mock/definition/scripts.yml +257 -0
- package/.mock/definition/sites/activityLogs.yml +65 -0
- package/.mock/definition/sites/scripts.yml +228 -0
- package/.mock/definition/sites.yml +299 -0
- package/.mock/definition/token.yml +71 -0
- package/.mock/definition/users.yml +392 -0
- package/.mock/definition/webhooks.yml +189 -0
- package/.mock/fern.config.json +4 -0
- package/Client.d.ts +2 -0
- package/README.md +23 -30
- package/api/errors/InternalServerError.d.ts +2 -1
- package/api/errors/NotFoundError.d.ts +2 -1
- package/api/errors/TooManyRequestsError.d.ts +1 -1
- package/api/errors/UnauthorizedError.d.ts +2 -1
- package/api/resources/accessGroups/client/Client.d.ts +5 -1
- package/api/resources/accessGroups/client/Client.js +27 -15
- package/api/resources/assets/client/Client.d.ts +31 -11
- package/api/resources/assets/client/Client.js +236 -126
- package/api/resources/assets/client/requests/AssetsCreateRequest.d.ts +2 -2
- package/api/resources/assets/client/requests/AssetsUpdateRequest.d.ts +5 -5
- package/api/resources/collections/client/Client.d.ts +15 -22
- package/api/resources/collections/client/Client.js +109 -137
- package/api/resources/collections/resources/fields/client/Client.d.ts +34 -2
- package/api/resources/collections/resources/fields/client/Client.js +163 -32
- package/api/resources/collections/resources/items/client/Client.d.ts +302 -30
- package/api/resources/collections/resources/items/client/Client.js +959 -221
- package/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.d.ts +61 -0
- package/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.d.ts +11 -0
- package/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.d.ts +11 -0
- package/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.d.ts +128 -0
- package/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.d.ts +128 -0
- package/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.js +5 -0
- package/api/resources/collections/resources/items/client/requests/index.d.ts +5 -0
- package/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.d.ts +5 -0
- package/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.js +5 -0
- package/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.d.ts +14 -0
- package/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.js +5 -0
- package/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.d.ts +14 -0
- package/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.js +5 -0
- package/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.d.ts +5 -0
- package/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.js +5 -0
- package/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.d.ts +8 -0
- package/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.js +5 -0
- package/api/resources/collections/resources/items/types/ItemsCreateItemRequest.d.ts +5 -0
- package/api/resources/collections/resources/items/types/ItemsCreateItemRequest.js +5 -0
- package/api/resources/collections/resources/items/types/ItemsCreateItemRequestItems.d.ts +8 -0
- package/api/resources/collections/resources/items/types/ItemsCreateItemRequestItems.js +5 -0
- package/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.d.ts +9 -0
- package/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.js +5 -0
- package/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.d.ts +9 -0
- package/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.js +5 -0
- package/api/resources/collections/resources/items/types/index.d.ts +9 -0
- package/api/resources/collections/resources/items/types/index.js +9 -0
- package/api/resources/ecommerce/client/Client.d.ts +2 -0
- package/api/resources/ecommerce/client/Client.js +24 -14
- package/api/resources/forms/client/Client.d.ts +17 -5
- package/api/resources/forms/client/Client.js +140 -76
- package/api/resources/inventory/client/Client.d.ts +8 -1
- package/api/resources/inventory/client/Client.js +59 -30
- package/api/resources/orders/client/Client.d.ts +7 -2
- package/api/resources/orders/client/Client.js +164 -89
- package/api/resources/pages/client/Client.d.ts +25 -14
- package/api/resources/pages/client/Client.js +169 -100
- package/api/resources/pages/client/requests/DomWrite.d.ts +6 -6
- package/api/resources/pages/client/requests/PagesGetContentRequest.d.ts +2 -2
- package/api/resources/pages/client/requests/PagesGetMetadataRequest.d.ts +2 -2
- package/api/resources/pages/client/requests/PagesListRequest.d.ts +2 -2
- package/api/resources/pages/client/requests/UpdatePageSettingsRequest.d.ts +3 -4
- package/api/resources/pages/resources/scripts/client/Client.d.ts +29 -3
- package/api/resources/pages/resources/scripts/client/Client.js +104 -46
- package/api/resources/products/client/Client.d.ts +26 -10
- package/api/resources/products/client/Client.js +188 -98
- package/api/resources/scripts/client/Client.d.ts +31 -3
- package/api/resources/scripts/client/Client.js +111 -47
- package/api/resources/sites/client/Client.d.ts +16 -4
- package/api/resources/sites/client/Client.js +101 -59
- package/api/resources/sites/client/requests/SitesPublishRequest.d.ts +1 -1
- package/api/resources/sites/resources/activityLogs/client/Client.d.ts +2 -0
- package/api/resources/sites/resources/activityLogs/client/Client.js +17 -13
- package/api/resources/sites/resources/scripts/client/Client.d.ts +26 -4
- package/api/resources/sites/resources/scripts/client/Client.js +125 -61
- package/api/resources/token/client/Client.d.ts +7 -2
- package/api/resources/token/client/Client.js +23 -24
- package/api/resources/users/client/Client.d.ts +21 -6
- package/api/resources/users/client/Client.js +149 -78
- package/api/resources/webhooks/client/Client.d.ts +15 -2
- package/api/resources/webhooks/client/Client.js +114 -59
- package/api/types/AssetFolder.d.ts +1 -1
- package/api/types/AuthorizationAuthorization.d.ts +1 -1
- package/api/types/AuthorizedUser.d.ts +1 -1
- package/api/types/BulkCollectionItemFieldData.d.ts +1 -1
- package/api/types/CollectionItem.d.ts +1 -1
- package/api/types/CollectionItemFieldData.d.ts +1 -1
- package/api/types/CollectionItemListNoPagination.d.ts +11 -0
- package/api/types/CollectionItemListNoPagination.js +5 -0
- package/api/types/CollectionItemWithIdInput.d.ts +24 -0
- package/api/types/CollectionItemWithIdInput.js +5 -0
- package/api/types/CollectionItemWithIdInputFieldData.d.ts +11 -0
- package/api/types/CollectionItemWithIdInputFieldData.js +5 -0
- package/api/types/ConflictErrorBody.d.ts +1 -10
- package/api/types/CustomCodeBlock.d.ts +2 -2
- package/api/types/DuplicateUserEmail.d.ts +1 -11
- package/api/types/ErrorCode.d.ts +38 -0
- package/api/types/ErrorCode.js +37 -0
- package/api/types/Error_.d.ts +1 -1
- package/api/types/ForbiddenErrorBody.d.ts +2 -7
- package/api/types/Form.d.ts +8 -8
- package/api/types/FormSubmission.d.ts +3 -3
- package/api/types/InvalidScopes.d.ts +4 -0
- package/api/types/InvalidScopes.js +5 -0
- package/api/types/NotEnterprisePlanSite.d.ts +1 -11
- package/api/types/Order.d.ts +5 -1
- package/api/types/Page.d.ts +2 -0
- package/api/types/Site.d.ts +4 -0
- package/api/types/SiteActivityLogItem.d.ts +1 -1
- package/api/types/SiteActivityLogItemEvent.d.ts +48 -0
- package/api/types/SiteActivityLogItemEvent.js +50 -0
- package/api/types/SiteActivityLogItemResourceOperation.d.ts +5 -1
- package/api/types/SiteActivityLogItemResourceOperation.js +4 -0
- package/api/types/SiteDataCollectionType.d.ts +12 -0
- package/api/types/SiteDataCollectionType.js +11 -0
- package/api/types/UserLimitReached.d.ts +1 -11
- package/api/types/UsersNotEnabled.d.ts +1 -11
- package/api/types/index.d.ts +10 -6
- package/api/types/index.js +10 -6
- package/core/fetcher/Fetcher.d.ts +1 -1
- package/core/fetcher/getResponseBody.js +3 -0
- package/core/fetcher/requestWithRetries.js +13 -4
- package/core/schemas/builders/object/object.js +28 -0
- package/core/schemas/builders/object/types.d.ts +5 -0
- package/dist/Client.d.ts +2 -0
- package/dist/api/errors/InternalServerError.d.ts +2 -1
- package/dist/api/errors/NotFoundError.d.ts +2 -1
- package/dist/api/errors/TooManyRequestsError.d.ts +1 -1
- package/dist/api/errors/UnauthorizedError.d.ts +2 -1
- package/dist/api/resources/accessGroups/client/Client.d.ts +5 -1
- package/dist/api/resources/accessGroups/client/Client.js +27 -15
- package/dist/api/resources/assets/client/Client.d.ts +31 -11
- package/dist/api/resources/assets/client/Client.js +236 -126
- package/dist/api/resources/assets/client/requests/AssetsCreateRequest.d.ts +2 -2
- package/dist/api/resources/assets/client/requests/AssetsUpdateRequest.d.ts +5 -5
- package/dist/api/resources/collections/client/Client.d.ts +15 -22
- package/dist/api/resources/collections/client/Client.js +109 -137
- package/dist/api/resources/collections/resources/fields/client/Client.d.ts +34 -2
- package/dist/api/resources/collections/resources/fields/client/Client.js +163 -32
- package/dist/api/resources/collections/resources/items/client/Client.d.ts +302 -30
- package/dist/api/resources/collections/resources/items/client/Client.js +959 -221
- package/dist/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.d.ts +61 -0
- package/dist/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.js +5 -0
- package/dist/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.d.ts +11 -0
- package/dist/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.js +5 -0
- package/dist/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.d.ts +11 -0
- package/dist/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.js +5 -0
- package/dist/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.d.ts +128 -0
- package/dist/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.js +5 -0
- package/dist/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.d.ts +128 -0
- package/dist/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.js +5 -0
- package/dist/api/resources/collections/resources/items/client/requests/index.d.ts +5 -0
- package/dist/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.d.ts +5 -0
- package/dist/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.js +5 -0
- package/dist/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.d.ts +14 -0
- package/dist/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.js +5 -0
- package/dist/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.d.ts +14 -0
- package/dist/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.js +5 -0
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.d.ts +5 -0
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.js +5 -0
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.d.ts +8 -0
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.js +5 -0
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemRequest.d.ts +5 -0
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemRequest.js +5 -0
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemRequestItems.d.ts +8 -0
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemRequestItems.js +5 -0
- package/dist/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.d.ts +9 -0
- package/dist/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.js +5 -0
- package/dist/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.d.ts +9 -0
- package/dist/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.js +5 -0
- package/dist/api/resources/collections/resources/items/types/index.d.ts +9 -0
- package/dist/api/resources/collections/resources/items/types/index.js +9 -0
- package/dist/api/resources/ecommerce/client/Client.d.ts +2 -0
- package/dist/api/resources/ecommerce/client/Client.js +24 -14
- package/dist/api/resources/forms/client/Client.d.ts +17 -5
- package/dist/api/resources/forms/client/Client.js +140 -76
- package/dist/api/resources/inventory/client/Client.d.ts +8 -1
- package/dist/api/resources/inventory/client/Client.js +59 -30
- package/dist/api/resources/orders/client/Client.d.ts +7 -2
- package/dist/api/resources/orders/client/Client.js +164 -89
- package/dist/api/resources/pages/client/Client.d.ts +25 -14
- package/dist/api/resources/pages/client/Client.js +169 -100
- package/dist/api/resources/pages/client/requests/DomWrite.d.ts +6 -6
- package/dist/api/resources/pages/client/requests/PagesGetContentRequest.d.ts +2 -2
- package/dist/api/resources/pages/client/requests/PagesGetMetadataRequest.d.ts +2 -2
- package/dist/api/resources/pages/client/requests/PagesListRequest.d.ts +2 -2
- package/dist/api/resources/pages/client/requests/UpdatePageSettingsRequest.d.ts +3 -4
- package/dist/api/resources/pages/resources/scripts/client/Client.d.ts +29 -3
- package/dist/api/resources/pages/resources/scripts/client/Client.js +104 -46
- package/dist/api/resources/products/client/Client.d.ts +26 -10
- package/dist/api/resources/products/client/Client.js +188 -98
- package/dist/api/resources/scripts/client/Client.d.ts +31 -3
- package/dist/api/resources/scripts/client/Client.js +111 -47
- package/dist/api/resources/sites/client/Client.d.ts +16 -4
- package/dist/api/resources/sites/client/Client.js +101 -59
- package/dist/api/resources/sites/client/requests/SitesPublishRequest.d.ts +1 -1
- package/dist/api/resources/sites/resources/activityLogs/client/Client.d.ts +2 -0
- package/dist/api/resources/sites/resources/activityLogs/client/Client.js +17 -13
- package/dist/api/resources/sites/resources/scripts/client/Client.d.ts +26 -4
- package/dist/api/resources/sites/resources/scripts/client/Client.js +125 -61
- package/dist/api/resources/token/client/Client.d.ts +7 -2
- package/dist/api/resources/token/client/Client.js +23 -24
- package/dist/api/resources/users/client/Client.d.ts +21 -6
- package/dist/api/resources/users/client/Client.js +149 -78
- package/dist/api/resources/webhooks/client/Client.d.ts +15 -2
- package/dist/api/resources/webhooks/client/Client.js +114 -59
- package/dist/api/types/AssetFolder.d.ts +1 -1
- package/dist/api/types/AuthorizationAuthorization.d.ts +1 -1
- package/dist/api/types/AuthorizedUser.d.ts +1 -1
- package/dist/api/types/BulkCollectionItemFieldData.d.ts +1 -1
- package/dist/api/types/CollectionItem.d.ts +1 -1
- package/dist/api/types/CollectionItemFieldData.d.ts +1 -1
- package/dist/api/types/CollectionItemListNoPagination.d.ts +11 -0
- package/dist/api/types/CollectionItemListNoPagination.js +5 -0
- package/dist/api/types/CollectionItemWithIdInput.d.ts +24 -0
- package/dist/api/types/CollectionItemWithIdInput.js +5 -0
- package/dist/api/types/CollectionItemWithIdInputFieldData.d.ts +11 -0
- package/dist/api/types/CollectionItemWithIdInputFieldData.js +5 -0
- package/dist/api/types/ConflictErrorBody.d.ts +1 -10
- package/dist/api/types/CustomCodeBlock.d.ts +2 -2
- package/dist/api/types/DuplicateUserEmail.d.ts +1 -11
- package/dist/api/types/ErrorCode.d.ts +38 -0
- package/dist/api/types/ErrorCode.js +37 -0
- package/dist/api/types/Error_.d.ts +1 -1
- package/dist/api/types/ForbiddenErrorBody.d.ts +2 -7
- package/dist/api/types/Form.d.ts +8 -8
- package/dist/api/types/FormSubmission.d.ts +3 -3
- package/dist/api/types/InvalidScopes.d.ts +4 -0
- package/dist/api/types/InvalidScopes.js +5 -0
- package/dist/api/types/NotEnterprisePlanSite.d.ts +1 -11
- package/dist/api/types/Order.d.ts +5 -1
- package/dist/api/types/Page.d.ts +2 -0
- package/dist/api/types/Site.d.ts +4 -0
- package/dist/api/types/SiteActivityLogItem.d.ts +1 -1
- package/dist/api/types/SiteActivityLogItemEvent.d.ts +48 -0
- package/dist/api/types/SiteActivityLogItemEvent.js +50 -0
- package/dist/api/types/SiteActivityLogItemResourceOperation.d.ts +5 -1
- package/dist/api/types/SiteActivityLogItemResourceOperation.js +4 -0
- package/dist/api/types/SiteDataCollectionType.d.ts +12 -0
- package/dist/api/types/SiteDataCollectionType.js +11 -0
- package/dist/api/types/UserLimitReached.d.ts +1 -11
- package/dist/api/types/UsersNotEnabled.d.ts +1 -11
- package/dist/api/types/index.d.ts +10 -6
- package/dist/api/types/index.js +10 -6
- package/dist/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/core/fetcher/getResponseBody.js +3 -0
- package/dist/core/fetcher/requestWithRetries.js +13 -4
- package/dist/core/schemas/builders/object/object.js +28 -0
- package/dist/core/schemas/builders/object/types.d.ts +5 -0
- package/dist/errors/WebflowTimeoutError.d.ts +1 -1
- package/dist/errors/WebflowTimeoutError.js +2 -2
- package/dist/serialization/resources/assets/client/requests/AssetsUpdateRequest.d.ts +2 -1
- package/dist/serialization/resources/assets/client/requests/AssetsUpdateRequest.js +2 -1
- package/dist/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.d.ts +16 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.js +37 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.js +34 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.js +34 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.js +34 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.js +34 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/index.d.ts +5 -0
- package/dist/serialization/resources/collections/resources/items/client/requests/index.js +11 -1
- package/dist/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.d.ts +12 -0
- package/dist/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.js +36 -0
- package/dist/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.d.ts +14 -0
- package/dist/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.js +36 -0
- package/dist/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.d.ts +14 -0
- package/dist/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.js +36 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.d.ts +12 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.js +33 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.js +34 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemRequest.d.ts +12 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemRequest.js +33 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestItems.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestItems.js +34 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.js +34 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.js +34 -0
- package/dist/serialization/resources/collections/resources/items/types/index.d.ts +9 -0
- package/dist/serialization/resources/collections/resources/items/types/index.js +9 -0
- package/dist/serialization/resources/pages/client/requests/DomWrite.d.ts +1 -1
- package/dist/serialization/types/BulkCollectionItemFieldData.js +4 -2
- package/dist/serialization/types/CollectionItem.d.ts +1 -1
- package/dist/serialization/types/CollectionItem.js +1 -1
- package/dist/serialization/types/CollectionItemFieldData.js +4 -2
- package/dist/serialization/types/CollectionItemListNoPagination.d.ts +13 -0
- package/dist/serialization/types/{TooManyRequestsErrorBody.js → CollectionItemListNoPagination.js} +4 -6
- package/dist/serialization/types/CollectionItemWithIdInput.d.ts +20 -0
- package/dist/serialization/types/CollectionItemWithIdInput.js +41 -0
- package/dist/serialization/types/CollectionItemWithIdInputFieldData.d.ts +14 -0
- package/dist/serialization/types/{MissingScopes.js → CollectionItemWithIdInputFieldData.js} +7 -8
- package/dist/serialization/types/ConflictErrorBody.d.ts +4 -8
- package/dist/serialization/types/ConflictErrorBody.js +3 -7
- package/dist/serialization/types/DuplicateUserEmail.d.ts +2 -8
- package/dist/serialization/types/DuplicateUserEmail.js +1 -7
- package/dist/serialization/types/ErrorCode.d.ts +10 -0
- package/dist/serialization/types/ErrorCode.js +61 -0
- package/dist/serialization/types/Error_.d.ts +2 -1
- package/dist/serialization/types/Error_.js +2 -1
- package/dist/serialization/types/ForbiddenErrorBody.d.ts +4 -8
- package/dist/serialization/types/ForbiddenErrorBody.js +3 -7
- package/dist/serialization/types/Form.d.ts +1 -1
- package/dist/serialization/types/Form.js +1 -1
- package/dist/serialization/types/InvalidScopes.d.ts +10 -0
- package/{serialization/types/MissingScopes.js → dist/serialization/types/InvalidScopes.js} +2 -8
- package/dist/serialization/types/NotEnterprisePlanSite.d.ts +2 -8
- package/dist/serialization/types/NotEnterprisePlanSite.js +1 -7
- package/dist/serialization/types/Page.d.ts +1 -0
- package/dist/serialization/types/Page.js +1 -0
- package/dist/serialization/types/Site.d.ts +3 -0
- package/dist/serialization/types/Site.js +3 -0
- package/dist/serialization/types/SiteActivityLogItem.d.ts +2 -1
- package/dist/serialization/types/SiteActivityLogItem.js +2 -1
- package/dist/serialization/types/SiteActivityLogItemEvent.d.ts +10 -0
- package/dist/serialization/types/SiteActivityLogItemEvent.js +74 -0
- package/dist/serialization/types/SiteActivityLogItemResourceOperation.d.ts +1 -1
- package/dist/serialization/types/SiteActivityLogItemResourceOperation.js +11 -1
- package/dist/serialization/types/SiteDataCollectionType.d.ts +10 -0
- package/dist/serialization/types/SiteDataCollectionType.js +31 -0
- package/dist/serialization/types/UserLimitReached.d.ts +2 -8
- package/dist/serialization/types/UserLimitReached.js +1 -7
- package/dist/serialization/types/UsersNotEnabled.d.ts +2 -8
- package/dist/serialization/types/UsersNotEnabled.js +1 -7
- package/dist/serialization/types/index.d.ts +10 -5
- package/dist/serialization/types/index.js +10 -5
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/ItemsClient.d.ts +23 -49
- package/dist/wrapper/ItemsClient.js +50 -216
- package/dist/wrapper/WebflowClient.d.ts +1 -1
- package/dist/wrapper/WebflowClient.js +11 -1
- package/errors/WebflowTimeoutError.d.ts +1 -1
- package/errors/WebflowTimeoutError.js +2 -2
- package/package.json +1 -2
- package/reference.md +821 -230
- package/serialization/resources/assets/client/requests/AssetsUpdateRequest.d.ts +2 -1
- package/serialization/resources/assets/client/requests/AssetsUpdateRequest.js +2 -1
- package/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.d.ts +16 -0
- package/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.js +37 -0
- package/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.d.ts +13 -0
- package/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.js +34 -0
- package/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.d.ts +13 -0
- package/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.js +34 -0
- package/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.d.ts +13 -0
- package/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.js +34 -0
- package/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.d.ts +13 -0
- package/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.js +34 -0
- package/serialization/resources/collections/resources/items/client/requests/index.d.ts +5 -0
- package/serialization/resources/collections/resources/items/client/requests/index.js +11 -1
- package/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.d.ts +12 -0
- package/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.js +36 -0
- package/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.d.ts +14 -0
- package/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.js +36 -0
- package/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.d.ts +14 -0
- package/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.js +36 -0
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.d.ts +12 -0
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.js +33 -0
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.d.ts +13 -0
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.js +34 -0
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemRequest.d.ts +12 -0
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemRequest.js +33 -0
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestItems.d.ts +13 -0
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestItems.js +34 -0
- package/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.d.ts +13 -0
- package/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.js +34 -0
- package/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.d.ts +13 -0
- package/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.js +34 -0
- package/serialization/resources/collections/resources/items/types/index.d.ts +9 -0
- package/serialization/resources/collections/resources/items/types/index.js +9 -0
- package/serialization/resources/pages/client/requests/DomWrite.d.ts +1 -1
- package/serialization/types/BulkCollectionItemFieldData.js +4 -2
- package/serialization/types/CollectionItem.d.ts +1 -1
- package/serialization/types/CollectionItem.js +1 -1
- package/serialization/types/CollectionItemFieldData.js +4 -2
- package/serialization/types/CollectionItemListNoPagination.d.ts +13 -0
- package/serialization/types/{TooManyRequestsErrorBody.js → CollectionItemListNoPagination.js} +4 -6
- package/serialization/types/CollectionItemWithIdInput.d.ts +20 -0
- package/serialization/types/CollectionItemWithIdInput.js +41 -0
- package/serialization/types/CollectionItemWithIdInputFieldData.d.ts +14 -0
- package/serialization/types/CollectionItemWithIdInputFieldData.js +36 -0
- package/serialization/types/ConflictErrorBody.d.ts +4 -8
- package/serialization/types/ConflictErrorBody.js +3 -7
- package/serialization/types/DuplicateUserEmail.d.ts +2 -8
- package/serialization/types/DuplicateUserEmail.js +1 -7
- package/serialization/types/ErrorCode.d.ts +10 -0
- package/serialization/types/ErrorCode.js +61 -0
- package/serialization/types/Error_.d.ts +2 -1
- package/serialization/types/Error_.js +2 -1
- package/serialization/types/ForbiddenErrorBody.d.ts +4 -8
- package/serialization/types/ForbiddenErrorBody.js +3 -7
- package/serialization/types/Form.d.ts +1 -1
- package/serialization/types/Form.js +1 -1
- package/serialization/types/InvalidScopes.d.ts +10 -0
- package/serialization/types/InvalidScopes.js +31 -0
- package/serialization/types/NotEnterprisePlanSite.d.ts +2 -8
- package/serialization/types/NotEnterprisePlanSite.js +1 -7
- package/serialization/types/Page.d.ts +1 -0
- package/serialization/types/Page.js +1 -0
- package/serialization/types/Site.d.ts +3 -0
- package/serialization/types/Site.js +3 -0
- package/serialization/types/SiteActivityLogItem.d.ts +2 -1
- package/serialization/types/SiteActivityLogItem.js +2 -1
- package/serialization/types/SiteActivityLogItemEvent.d.ts +10 -0
- package/serialization/types/SiteActivityLogItemEvent.js +74 -0
- package/serialization/types/SiteActivityLogItemResourceOperation.d.ts +1 -1
- package/serialization/types/SiteActivityLogItemResourceOperation.js +11 -1
- package/serialization/types/SiteDataCollectionType.d.ts +10 -0
- package/serialization/types/SiteDataCollectionType.js +31 -0
- package/serialization/types/UserLimitReached.d.ts +2 -8
- package/serialization/types/UserLimitReached.js +1 -7
- package/serialization/types/UsersNotEnabled.d.ts +2 -8
- package/serialization/types/UsersNotEnabled.js +1 -7
- package/serialization/types/index.d.ts +10 -5
- package/serialization/types/index.js +10 -5
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/ItemsClient.d.ts +23 -49
- package/wrapper/ItemsClient.js +50 -216
- package/wrapper/WebflowClient.d.ts +1 -1
- package/wrapper/WebflowClient.js +11 -1
- package/api/types/MissingScopes.d.ts +0 -14
- package/api/types/TooManyRequestsErrorBody.d.ts +0 -9
- package/dist/api/types/MissingScopes.d.ts +0 -14
- package/dist/api/types/TooManyRequestsErrorBody.d.ts +0 -9
- package/dist/serialization/types/MissingScopes.d.ts +0 -16
- package/dist/serialization/types/TooManyRequestsErrorBody.d.ts +0 -15
- package/serialization/types/MissingScopes.d.ts +0 -16
- package/serialization/types/TooManyRequestsErrorBody.d.ts +0 -15
- /package/api/{types/MissingScopes.js → resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.js} +0 -0
- /package/api/{types/TooManyRequestsErrorBody.js → resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.js} +0 -0
- /package/{dist/api/types/MissingScopes.js → api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.js} +0 -0
- /package/{dist/api/types/TooManyRequestsErrorBody.js → api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.js} +0 -0
|
@@ -50,7 +50,9 @@ class Items {
|
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* List of all Items within a Collection.
|
|
53
|
+
* List of all Items within a Collection.
|
|
54
|
+
*
|
|
55
|
+
* Required scope | `CMS:read`
|
|
54
56
|
*
|
|
55
57
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
56
58
|
* @param {Webflow.collections.ItemsListItemsRequest} request
|
|
@@ -94,15 +96,7 @@ class Items {
|
|
|
94
96
|
const _response = yield core.fetcher({
|
|
95
97
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items`),
|
|
96
98
|
method: "GET",
|
|
97
|
-
headers: {
|
|
98
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
99
|
-
"X-Fern-Language": "JavaScript",
|
|
100
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
101
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
102
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
103
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
104
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
105
|
-
},
|
|
99
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
106
100
|
contentType: "application/json",
|
|
107
101
|
queryParameters: _queryParams,
|
|
108
102
|
requestType: "json",
|
|
@@ -124,11 +118,23 @@ class Items {
|
|
|
124
118
|
case 400:
|
|
125
119
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
126
120
|
case 401:
|
|
127
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
121
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
122
|
+
unrecognizedObjectKeys: "passthrough",
|
|
123
|
+
allowUnrecognizedUnionMembers: true,
|
|
124
|
+
allowUnrecognizedEnumValues: true,
|
|
125
|
+
skipValidation: true,
|
|
126
|
+
breadcrumbsPrefix: ["response"],
|
|
127
|
+
}));
|
|
128
128
|
case 404:
|
|
129
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
129
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
130
|
+
unrecognizedObjectKeys: "passthrough",
|
|
131
|
+
allowUnrecognizedUnionMembers: true,
|
|
132
|
+
allowUnrecognizedEnumValues: true,
|
|
133
|
+
skipValidation: true,
|
|
134
|
+
breadcrumbsPrefix: ["response"],
|
|
135
|
+
}));
|
|
130
136
|
case 429:
|
|
131
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
137
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
132
138
|
unrecognizedObjectKeys: "passthrough",
|
|
133
139
|
allowUnrecognizedUnionMembers: true,
|
|
134
140
|
allowUnrecognizedEnumValues: true,
|
|
@@ -136,7 +142,13 @@ class Items {
|
|
|
136
142
|
breadcrumbsPrefix: ["response"],
|
|
137
143
|
}));
|
|
138
144
|
case 500:
|
|
139
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
145
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
146
|
+
unrecognizedObjectKeys: "passthrough",
|
|
147
|
+
allowUnrecognizedUnionMembers: true,
|
|
148
|
+
allowUnrecognizedEnumValues: true,
|
|
149
|
+
skipValidation: true,
|
|
150
|
+
breadcrumbsPrefix: ["response"],
|
|
151
|
+
}));
|
|
140
152
|
default:
|
|
141
153
|
throw new errors.WebflowError({
|
|
142
154
|
statusCode: _response.error.statusCode,
|
|
@@ -151,7 +163,7 @@ class Items {
|
|
|
151
163
|
body: _response.error.rawBody,
|
|
152
164
|
});
|
|
153
165
|
case "timeout":
|
|
154
|
-
throw new errors.WebflowTimeoutError();
|
|
166
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /collections/{collection_id}/items.");
|
|
155
167
|
case "unknown":
|
|
156
168
|
throw new errors.WebflowError({
|
|
157
169
|
message: _response.error.errorMessage,
|
|
@@ -160,10 +172,14 @@ class Items {
|
|
|
160
172
|
});
|
|
161
173
|
}
|
|
162
174
|
/**
|
|
163
|
-
*
|
|
175
|
+
* Create Item(s) in a Collection.
|
|
176
|
+
*
|
|
177
|
+
* To create items across multiple locales, please use [this endpoint.](/data/v2.0.0/reference/cms/collection-items/bulk-items/create-items)
|
|
178
|
+
*
|
|
179
|
+
* Required scope | `CMS:write`
|
|
164
180
|
*
|
|
165
181
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
166
|
-
* @param {Webflow.
|
|
182
|
+
* @param {Webflow.collections.ItemsCreateItemRequest} request
|
|
167
183
|
* @param {Items.RequestOptions} requestOptions - Request-specific configuration.
|
|
168
184
|
*
|
|
169
185
|
* @throws {@link Webflow.BadRequestError}
|
|
@@ -174,11 +190,6 @@ class Items {
|
|
|
174
190
|
*
|
|
175
191
|
* @example
|
|
176
192
|
* await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
|
|
177
|
-
* id: "42b720ef280c7a7a3be8cabe",
|
|
178
|
-
* cmsLocaleId: "653ad57de882f528b32e810e",
|
|
179
|
-
* lastPublished: "2022-11-29T16:22:43.159Z",
|
|
180
|
-
* lastUpdated: "2022-11-17T17:19:43.282Z",
|
|
181
|
-
* createdOn: "2022-11-17T17:11:57.148Z",
|
|
182
193
|
* isArchived: false,
|
|
183
194
|
* isDraft: false,
|
|
184
195
|
* fieldData: {
|
|
@@ -186,6 +197,25 @@ class Items {
|
|
|
186
197
|
* slug: "pan-galactic-gargle-blaster"
|
|
187
198
|
* }
|
|
188
199
|
* })
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
|
|
203
|
+
* items: [{
|
|
204
|
+
* isArchived: false,
|
|
205
|
+
* isDraft: false,
|
|
206
|
+
* fieldData: {
|
|
207
|
+
* name: "Senior Data Analyst",
|
|
208
|
+
* slug: "senior-data-analyst"
|
|
209
|
+
* }
|
|
210
|
+
* }, {
|
|
211
|
+
* isArchived: false,
|
|
212
|
+
* isDraft: false,
|
|
213
|
+
* fieldData: {
|
|
214
|
+
* name: "Product Manager",
|
|
215
|
+
* slug: "product-manager"
|
|
216
|
+
* }
|
|
217
|
+
* }]
|
|
218
|
+
* })
|
|
189
219
|
*/
|
|
190
220
|
createItem(collectionId, request, requestOptions) {
|
|
191
221
|
var _a;
|
|
@@ -193,18 +223,269 @@ class Items {
|
|
|
193
223
|
const _response = yield core.fetcher({
|
|
194
224
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items`),
|
|
195
225
|
method: "POST",
|
|
196
|
-
headers: {
|
|
197
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
198
|
-
"X-Fern-Language": "JavaScript",
|
|
199
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
200
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
201
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
202
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
203
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
204
|
-
},
|
|
226
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
205
227
|
contentType: "application/json",
|
|
206
228
|
requestType: "json",
|
|
207
|
-
body: serializers.
|
|
229
|
+
body: serializers.collections.ItemsCreateItemRequest.jsonOrThrow(request, {
|
|
230
|
+
unrecognizedObjectKeys: "passthrough",
|
|
231
|
+
allowUnrecognizedUnionMembers: true,
|
|
232
|
+
allowUnrecognizedEnumValues: true,
|
|
233
|
+
}),
|
|
234
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
235
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
236
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
237
|
+
});
|
|
238
|
+
if (_response.ok) {
|
|
239
|
+
return serializers.CollectionItem.parseOrThrow(_response.body, {
|
|
240
|
+
unrecognizedObjectKeys: "passthrough",
|
|
241
|
+
allowUnrecognizedUnionMembers: true,
|
|
242
|
+
allowUnrecognizedEnumValues: true,
|
|
243
|
+
skipValidation: true,
|
|
244
|
+
breadcrumbsPrefix: ["response"],
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
if (_response.error.reason === "status-code") {
|
|
248
|
+
switch (_response.error.statusCode) {
|
|
249
|
+
case 400:
|
|
250
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
251
|
+
case 401:
|
|
252
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
253
|
+
unrecognizedObjectKeys: "passthrough",
|
|
254
|
+
allowUnrecognizedUnionMembers: true,
|
|
255
|
+
allowUnrecognizedEnumValues: true,
|
|
256
|
+
skipValidation: true,
|
|
257
|
+
breadcrumbsPrefix: ["response"],
|
|
258
|
+
}));
|
|
259
|
+
case 404:
|
|
260
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
261
|
+
unrecognizedObjectKeys: "passthrough",
|
|
262
|
+
allowUnrecognizedUnionMembers: true,
|
|
263
|
+
allowUnrecognizedEnumValues: true,
|
|
264
|
+
skipValidation: true,
|
|
265
|
+
breadcrumbsPrefix: ["response"],
|
|
266
|
+
}));
|
|
267
|
+
case 429:
|
|
268
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
269
|
+
unrecognizedObjectKeys: "passthrough",
|
|
270
|
+
allowUnrecognizedUnionMembers: true,
|
|
271
|
+
allowUnrecognizedEnumValues: true,
|
|
272
|
+
skipValidation: true,
|
|
273
|
+
breadcrumbsPrefix: ["response"],
|
|
274
|
+
}));
|
|
275
|
+
case 500:
|
|
276
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
277
|
+
unrecognizedObjectKeys: "passthrough",
|
|
278
|
+
allowUnrecognizedUnionMembers: true,
|
|
279
|
+
allowUnrecognizedEnumValues: true,
|
|
280
|
+
skipValidation: true,
|
|
281
|
+
breadcrumbsPrefix: ["response"],
|
|
282
|
+
}));
|
|
283
|
+
default:
|
|
284
|
+
throw new errors.WebflowError({
|
|
285
|
+
statusCode: _response.error.statusCode,
|
|
286
|
+
body: _response.error.body,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
switch (_response.error.reason) {
|
|
291
|
+
case "non-json":
|
|
292
|
+
throw new errors.WebflowError({
|
|
293
|
+
statusCode: _response.error.statusCode,
|
|
294
|
+
body: _response.error.rawBody,
|
|
295
|
+
});
|
|
296
|
+
case "timeout":
|
|
297
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /collections/{collection_id}/items.");
|
|
298
|
+
case "unknown":
|
|
299
|
+
throw new errors.WebflowError({
|
|
300
|
+
message: _response.error.errorMessage,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Delete Items from a Collection.
|
|
307
|
+
*
|
|
308
|
+
* **Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be deleted only in the primary locale.
|
|
309
|
+
*
|
|
310
|
+
* Required scope | `CMS:write`
|
|
311
|
+
*
|
|
312
|
+
* @param {string} collectionId - Unique identifier for a Collection
|
|
313
|
+
* @param {Webflow.collections.ItemsDeleteItemsRequest} request
|
|
314
|
+
* @param {Items.RequestOptions} requestOptions - Request-specific configuration.
|
|
315
|
+
*
|
|
316
|
+
* @throws {@link Webflow.BadRequestError}
|
|
317
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
318
|
+
* @throws {@link Webflow.NotFoundError}
|
|
319
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
320
|
+
* @throws {@link Webflow.InternalServerError}
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745")
|
|
324
|
+
*/
|
|
325
|
+
deleteItems(collectionId, request = {}, requestOptions) {
|
|
326
|
+
var _a;
|
|
327
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
328
|
+
const _response = yield core.fetcher({
|
|
329
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items`),
|
|
330
|
+
method: "DELETE",
|
|
331
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
332
|
+
contentType: "application/json",
|
|
333
|
+
requestType: "json",
|
|
334
|
+
body: serializers.collections.ItemsDeleteItemsRequest.jsonOrThrow(request, {
|
|
335
|
+
unrecognizedObjectKeys: "passthrough",
|
|
336
|
+
allowUnrecognizedUnionMembers: true,
|
|
337
|
+
allowUnrecognizedEnumValues: true,
|
|
338
|
+
}),
|
|
339
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
340
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
341
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
342
|
+
});
|
|
343
|
+
if (_response.ok) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (_response.error.reason === "status-code") {
|
|
347
|
+
switch (_response.error.statusCode) {
|
|
348
|
+
case 400:
|
|
349
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
350
|
+
case 401:
|
|
351
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
352
|
+
unrecognizedObjectKeys: "passthrough",
|
|
353
|
+
allowUnrecognizedUnionMembers: true,
|
|
354
|
+
allowUnrecognizedEnumValues: true,
|
|
355
|
+
skipValidation: true,
|
|
356
|
+
breadcrumbsPrefix: ["response"],
|
|
357
|
+
}));
|
|
358
|
+
case 404:
|
|
359
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
360
|
+
unrecognizedObjectKeys: "passthrough",
|
|
361
|
+
allowUnrecognizedUnionMembers: true,
|
|
362
|
+
allowUnrecognizedEnumValues: true,
|
|
363
|
+
skipValidation: true,
|
|
364
|
+
breadcrumbsPrefix: ["response"],
|
|
365
|
+
}));
|
|
366
|
+
case 429:
|
|
367
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
368
|
+
unrecognizedObjectKeys: "passthrough",
|
|
369
|
+
allowUnrecognizedUnionMembers: true,
|
|
370
|
+
allowUnrecognizedEnumValues: true,
|
|
371
|
+
skipValidation: true,
|
|
372
|
+
breadcrumbsPrefix: ["response"],
|
|
373
|
+
}));
|
|
374
|
+
case 500:
|
|
375
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
376
|
+
unrecognizedObjectKeys: "passthrough",
|
|
377
|
+
allowUnrecognizedUnionMembers: true,
|
|
378
|
+
allowUnrecognizedEnumValues: true,
|
|
379
|
+
skipValidation: true,
|
|
380
|
+
breadcrumbsPrefix: ["response"],
|
|
381
|
+
}));
|
|
382
|
+
default:
|
|
383
|
+
throw new errors.WebflowError({
|
|
384
|
+
statusCode: _response.error.statusCode,
|
|
385
|
+
body: _response.error.body,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
switch (_response.error.reason) {
|
|
390
|
+
case "non-json":
|
|
391
|
+
throw new errors.WebflowError({
|
|
392
|
+
statusCode: _response.error.statusCode,
|
|
393
|
+
body: _response.error.rawBody,
|
|
394
|
+
});
|
|
395
|
+
case "timeout":
|
|
396
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /collections/{collection_id}/items.");
|
|
397
|
+
case "unknown":
|
|
398
|
+
throw new errors.WebflowError({
|
|
399
|
+
message: _response.error.errorMessage,
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Update a single item or multiple items (up to 100) in a Collection.
|
|
406
|
+
*
|
|
407
|
+
* **Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be updated only in the primary locale.
|
|
408
|
+
*
|
|
409
|
+
* Required scope | `CMS:write`
|
|
410
|
+
*
|
|
411
|
+
* @param {string} collectionId - Unique identifier for a Collection
|
|
412
|
+
* @param {Webflow.collections.ItemsUpdateItemsRequest} request
|
|
413
|
+
* @param {Items.RequestOptions} requestOptions - Request-specific configuration.
|
|
414
|
+
*
|
|
415
|
+
* @throws {@link Webflow.BadRequestError}
|
|
416
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
417
|
+
* @throws {@link Webflow.NotFoundError}
|
|
418
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
419
|
+
* @throws {@link Webflow.InternalServerError}
|
|
420
|
+
*
|
|
421
|
+
* @example
|
|
422
|
+
* await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", {
|
|
423
|
+
* items: [{
|
|
424
|
+
* id: "66f6ed9576ddacf3149d5ea6",
|
|
425
|
+
* cmsLocaleId: "66f6e966c9e1dc700a857ca5",
|
|
426
|
+
* fieldData: {
|
|
427
|
+
* name: "Ne Paniquez Pas",
|
|
428
|
+
* slug: "ne-paniquez-pas"
|
|
429
|
+
* }
|
|
430
|
+
* }, {
|
|
431
|
+
* id: "66f6ed9576ddacf3149d5ea6",
|
|
432
|
+
* cmsLocaleId: "66f6e966c9e1dc700a857ca4",
|
|
433
|
+
* fieldData: {
|
|
434
|
+
* name: "No Entrar en P\u00E1nico",
|
|
435
|
+
* slug: "no-entrar-en-panico"
|
|
436
|
+
* }
|
|
437
|
+
* }, {
|
|
438
|
+
* id: "66f6ed9576ddacf3149d5eaa",
|
|
439
|
+
* cmsLocaleId: "66f6e966c9e1dc700a857ca5",
|
|
440
|
+
* fieldData: {
|
|
441
|
+
* name: "Au Revoir et Merci pour Tous les Poissons",
|
|
442
|
+
* slug: "au-revoir-et-merci"
|
|
443
|
+
* }
|
|
444
|
+
* }, {
|
|
445
|
+
* id: "66f6ed9576ddacf3149d5eaa",
|
|
446
|
+
* cmsLocaleId: "66f6e966c9e1dc700a857ca4",
|
|
447
|
+
* fieldData: {
|
|
448
|
+
* name: "Hasta Luego y Gracias por Todo el Pescado",
|
|
449
|
+
* slug: "hasta-luego-y-gracias"
|
|
450
|
+
* }
|
|
451
|
+
* }]
|
|
452
|
+
* })
|
|
453
|
+
*
|
|
454
|
+
* @example
|
|
455
|
+
* await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", {
|
|
456
|
+
* items: [{
|
|
457
|
+
* id: "580e64008c9a982ac9b8b754",
|
|
458
|
+
* isArchived: false,
|
|
459
|
+
* isDraft: false,
|
|
460
|
+
* fieldData: {
|
|
461
|
+
* name: "Senior Data Analyst",
|
|
462
|
+
* slug: "senior-data-analyst"
|
|
463
|
+
* }
|
|
464
|
+
* }, {
|
|
465
|
+
* id: "580e64008c9a982ac9b8b754",
|
|
466
|
+
* isArchived: false,
|
|
467
|
+
* isDraft: false,
|
|
468
|
+
* fieldData: {
|
|
469
|
+
* name: "Product Manager",
|
|
470
|
+
* slug: "product-manager"
|
|
471
|
+
* }
|
|
472
|
+
* }]
|
|
473
|
+
* })
|
|
474
|
+
*/
|
|
475
|
+
updateItems(collectionId, request = {}, requestOptions) {
|
|
476
|
+
var _a;
|
|
477
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
478
|
+
const _response = yield core.fetcher({
|
|
479
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items`),
|
|
480
|
+
method: "PATCH",
|
|
481
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
482
|
+
contentType: "application/json",
|
|
483
|
+
requestType: "json",
|
|
484
|
+
body: serializers.collections.ItemsUpdateItemsRequest.jsonOrThrow(request, {
|
|
485
|
+
unrecognizedObjectKeys: "passthrough",
|
|
486
|
+
allowUnrecognizedUnionMembers: true,
|
|
487
|
+
allowUnrecognizedEnumValues: true,
|
|
488
|
+
}),
|
|
208
489
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
209
490
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
210
491
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -223,11 +504,23 @@ class Items {
|
|
|
223
504
|
case 400:
|
|
224
505
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
225
506
|
case 401:
|
|
226
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
507
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
508
|
+
unrecognizedObjectKeys: "passthrough",
|
|
509
|
+
allowUnrecognizedUnionMembers: true,
|
|
510
|
+
allowUnrecognizedEnumValues: true,
|
|
511
|
+
skipValidation: true,
|
|
512
|
+
breadcrumbsPrefix: ["response"],
|
|
513
|
+
}));
|
|
227
514
|
case 404:
|
|
228
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
515
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
516
|
+
unrecognizedObjectKeys: "passthrough",
|
|
517
|
+
allowUnrecognizedUnionMembers: true,
|
|
518
|
+
allowUnrecognizedEnumValues: true,
|
|
519
|
+
skipValidation: true,
|
|
520
|
+
breadcrumbsPrefix: ["response"],
|
|
521
|
+
}));
|
|
229
522
|
case 429:
|
|
230
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
523
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
231
524
|
unrecognizedObjectKeys: "passthrough",
|
|
232
525
|
allowUnrecognizedUnionMembers: true,
|
|
233
526
|
allowUnrecognizedEnumValues: true,
|
|
@@ -235,7 +528,13 @@ class Items {
|
|
|
235
528
|
breadcrumbsPrefix: ["response"],
|
|
236
529
|
}));
|
|
237
530
|
case 500:
|
|
238
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
531
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
532
|
+
unrecognizedObjectKeys: "passthrough",
|
|
533
|
+
allowUnrecognizedUnionMembers: true,
|
|
534
|
+
allowUnrecognizedEnumValues: true,
|
|
535
|
+
skipValidation: true,
|
|
536
|
+
breadcrumbsPrefix: ["response"],
|
|
537
|
+
}));
|
|
239
538
|
default:
|
|
240
539
|
throw new errors.WebflowError({
|
|
241
540
|
statusCode: _response.error.statusCode,
|
|
@@ -250,7 +549,7 @@ class Items {
|
|
|
250
549
|
body: _response.error.rawBody,
|
|
251
550
|
});
|
|
252
551
|
case "timeout":
|
|
253
|
-
throw new errors.WebflowTimeoutError();
|
|
552
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /collections/{collection_id}/items.");
|
|
254
553
|
case "unknown":
|
|
255
554
|
throw new errors.WebflowError({
|
|
256
555
|
message: _response.error.errorMessage,
|
|
@@ -259,7 +558,9 @@ class Items {
|
|
|
259
558
|
});
|
|
260
559
|
}
|
|
261
560
|
/**
|
|
262
|
-
* List of all live Items within a Collection.
|
|
561
|
+
* List of all live Items within a Collection.
|
|
562
|
+
*
|
|
563
|
+
* Required scope | `CMS:read`
|
|
263
564
|
*
|
|
264
565
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
265
566
|
* @param {Webflow.collections.ItemsListItemsLiveRequest} request
|
|
@@ -302,42 +603,276 @@ class Items {
|
|
|
302
603
|
}
|
|
303
604
|
const _response = yield core.fetcher({
|
|
304
605
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/live`),
|
|
305
|
-
method: "GET",
|
|
306
|
-
headers: {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
606
|
+
method: "GET",
|
|
607
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
608
|
+
contentType: "application/json",
|
|
609
|
+
queryParameters: _queryParams,
|
|
610
|
+
requestType: "json",
|
|
611
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
612
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
613
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
614
|
+
});
|
|
615
|
+
if (_response.ok) {
|
|
616
|
+
return serializers.CollectionItemList.parseOrThrow(_response.body, {
|
|
617
|
+
unrecognizedObjectKeys: "passthrough",
|
|
618
|
+
allowUnrecognizedUnionMembers: true,
|
|
619
|
+
allowUnrecognizedEnumValues: true,
|
|
620
|
+
skipValidation: true,
|
|
621
|
+
breadcrumbsPrefix: ["response"],
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
if (_response.error.reason === "status-code") {
|
|
625
|
+
switch (_response.error.statusCode) {
|
|
626
|
+
case 400:
|
|
627
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
628
|
+
case 401:
|
|
629
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
630
|
+
unrecognizedObjectKeys: "passthrough",
|
|
631
|
+
allowUnrecognizedUnionMembers: true,
|
|
632
|
+
allowUnrecognizedEnumValues: true,
|
|
633
|
+
skipValidation: true,
|
|
634
|
+
breadcrumbsPrefix: ["response"],
|
|
635
|
+
}));
|
|
636
|
+
case 404:
|
|
637
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
638
|
+
unrecognizedObjectKeys: "passthrough",
|
|
639
|
+
allowUnrecognizedUnionMembers: true,
|
|
640
|
+
allowUnrecognizedEnumValues: true,
|
|
641
|
+
skipValidation: true,
|
|
642
|
+
breadcrumbsPrefix: ["response"],
|
|
643
|
+
}));
|
|
644
|
+
case 429:
|
|
645
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
646
|
+
unrecognizedObjectKeys: "passthrough",
|
|
647
|
+
allowUnrecognizedUnionMembers: true,
|
|
648
|
+
allowUnrecognizedEnumValues: true,
|
|
649
|
+
skipValidation: true,
|
|
650
|
+
breadcrumbsPrefix: ["response"],
|
|
651
|
+
}));
|
|
652
|
+
case 500:
|
|
653
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
654
|
+
unrecognizedObjectKeys: "passthrough",
|
|
655
|
+
allowUnrecognizedUnionMembers: true,
|
|
656
|
+
allowUnrecognizedEnumValues: true,
|
|
657
|
+
skipValidation: true,
|
|
658
|
+
breadcrumbsPrefix: ["response"],
|
|
659
|
+
}));
|
|
660
|
+
default:
|
|
661
|
+
throw new errors.WebflowError({
|
|
662
|
+
statusCode: _response.error.statusCode,
|
|
663
|
+
body: _response.error.body,
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
switch (_response.error.reason) {
|
|
668
|
+
case "non-json":
|
|
669
|
+
throw new errors.WebflowError({
|
|
670
|
+
statusCode: _response.error.statusCode,
|
|
671
|
+
body: _response.error.rawBody,
|
|
672
|
+
});
|
|
673
|
+
case "timeout":
|
|
674
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /collections/{collection_id}/items/live.");
|
|
675
|
+
case "unknown":
|
|
676
|
+
throw new errors.WebflowError({
|
|
677
|
+
message: _response.error.errorMessage,
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Create live Item(s) in a Collection. The Item(s) will be published to the live site.
|
|
684
|
+
*
|
|
685
|
+
* To create items across multiple locales, [please use this endpoint.](/v2.0.0/data/reference/cms/collection-items/bulk-items/create-items)
|
|
686
|
+
*
|
|
687
|
+
* Required scope | `CMS:write`
|
|
688
|
+
*
|
|
689
|
+
* @param {string} collectionId - Unique identifier for a Collection
|
|
690
|
+
* @param {Webflow.collections.ItemsCreateItemLiveRequest} request
|
|
691
|
+
* @param {Items.RequestOptions} requestOptions - Request-specific configuration.
|
|
692
|
+
*
|
|
693
|
+
* @throws {@link Webflow.BadRequestError}
|
|
694
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
695
|
+
* @throws {@link Webflow.NotFoundError}
|
|
696
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
697
|
+
* @throws {@link Webflow.InternalServerError}
|
|
698
|
+
*
|
|
699
|
+
* @example
|
|
700
|
+
* await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
|
|
701
|
+
* isArchived: false,
|
|
702
|
+
* isDraft: false,
|
|
703
|
+
* fieldData: {
|
|
704
|
+
* name: "Pan Galactic Gargle Blaster Recipe",
|
|
705
|
+
* slug: "pan-galactic-gargle-blaster"
|
|
706
|
+
* }
|
|
707
|
+
* })
|
|
708
|
+
*
|
|
709
|
+
* @example
|
|
710
|
+
* await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
|
|
711
|
+
* items: [{
|
|
712
|
+
* isArchived: false,
|
|
713
|
+
* isDraft: false,
|
|
714
|
+
* fieldData: {
|
|
715
|
+
* name: "Senior Data Analyst",
|
|
716
|
+
* slug: "senior-data-analyst"
|
|
717
|
+
* }
|
|
718
|
+
* }, {
|
|
719
|
+
* isArchived: false,
|
|
720
|
+
* isDraft: false,
|
|
721
|
+
* fieldData: {
|
|
722
|
+
* name: "Product Manager",
|
|
723
|
+
* slug: "product-manager"
|
|
724
|
+
* }
|
|
725
|
+
* }]
|
|
726
|
+
* })
|
|
727
|
+
*/
|
|
728
|
+
createItemLive(collectionId, request, requestOptions) {
|
|
729
|
+
var _a;
|
|
730
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
731
|
+
const _response = yield core.fetcher({
|
|
732
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/live`),
|
|
733
|
+
method: "POST",
|
|
734
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
735
|
+
contentType: "application/json",
|
|
736
|
+
requestType: "json",
|
|
737
|
+
body: serializers.collections.ItemsCreateItemLiveRequest.jsonOrThrow(request, {
|
|
738
|
+
unrecognizedObjectKeys: "passthrough",
|
|
739
|
+
allowUnrecognizedUnionMembers: true,
|
|
740
|
+
allowUnrecognizedEnumValues: true,
|
|
741
|
+
}),
|
|
742
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
743
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
744
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
745
|
+
});
|
|
746
|
+
if (_response.ok) {
|
|
747
|
+
return serializers.CollectionItem.parseOrThrow(_response.body, {
|
|
748
|
+
unrecognizedObjectKeys: "passthrough",
|
|
749
|
+
allowUnrecognizedUnionMembers: true,
|
|
750
|
+
allowUnrecognizedEnumValues: true,
|
|
751
|
+
skipValidation: true,
|
|
752
|
+
breadcrumbsPrefix: ["response"],
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
if (_response.error.reason === "status-code") {
|
|
756
|
+
switch (_response.error.statusCode) {
|
|
757
|
+
case 400:
|
|
758
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
759
|
+
case 401:
|
|
760
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
761
|
+
unrecognizedObjectKeys: "passthrough",
|
|
762
|
+
allowUnrecognizedUnionMembers: true,
|
|
763
|
+
allowUnrecognizedEnumValues: true,
|
|
764
|
+
skipValidation: true,
|
|
765
|
+
breadcrumbsPrefix: ["response"],
|
|
766
|
+
}));
|
|
767
|
+
case 404:
|
|
768
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
769
|
+
unrecognizedObjectKeys: "passthrough",
|
|
770
|
+
allowUnrecognizedUnionMembers: true,
|
|
771
|
+
allowUnrecognizedEnumValues: true,
|
|
772
|
+
skipValidation: true,
|
|
773
|
+
breadcrumbsPrefix: ["response"],
|
|
774
|
+
}));
|
|
775
|
+
case 429:
|
|
776
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
777
|
+
unrecognizedObjectKeys: "passthrough",
|
|
778
|
+
allowUnrecognizedUnionMembers: true,
|
|
779
|
+
allowUnrecognizedEnumValues: true,
|
|
780
|
+
skipValidation: true,
|
|
781
|
+
breadcrumbsPrefix: ["response"],
|
|
782
|
+
}));
|
|
783
|
+
case 500:
|
|
784
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
785
|
+
unrecognizedObjectKeys: "passthrough",
|
|
786
|
+
allowUnrecognizedUnionMembers: true,
|
|
787
|
+
allowUnrecognizedEnumValues: true,
|
|
788
|
+
skipValidation: true,
|
|
789
|
+
breadcrumbsPrefix: ["response"],
|
|
790
|
+
}));
|
|
791
|
+
default:
|
|
792
|
+
throw new errors.WebflowError({
|
|
793
|
+
statusCode: _response.error.statusCode,
|
|
794
|
+
body: _response.error.body,
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
switch (_response.error.reason) {
|
|
799
|
+
case "non-json":
|
|
800
|
+
throw new errors.WebflowError({
|
|
801
|
+
statusCode: _response.error.statusCode,
|
|
802
|
+
body: _response.error.rawBody,
|
|
803
|
+
});
|
|
804
|
+
case "timeout":
|
|
805
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /collections/{collection_id}/items/live.");
|
|
806
|
+
case "unknown":
|
|
807
|
+
throw new errors.WebflowError({
|
|
808
|
+
message: _response.error.errorMessage,
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Remove an item or multiple items (up to 100 items) from the live site. Deleting published items will unpublish the items from the live site and set them to draft.
|
|
815
|
+
*
|
|
816
|
+
* **Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be unpublished only in the primary locale.
|
|
817
|
+
*
|
|
818
|
+
* Required scope | `CMS:write`
|
|
819
|
+
*
|
|
820
|
+
* @param {string} collectionId - Unique identifier for a Collection
|
|
821
|
+
* @param {Webflow.collections.ItemsDeleteItemsLiveRequest} request
|
|
822
|
+
* @param {Items.RequestOptions} requestOptions - Request-specific configuration.
|
|
823
|
+
*
|
|
824
|
+
* @throws {@link Webflow.BadRequestError}
|
|
825
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
826
|
+
* @throws {@link Webflow.NotFoundError}
|
|
827
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
828
|
+
* @throws {@link Webflow.InternalServerError}
|
|
829
|
+
*
|
|
830
|
+
* @example
|
|
831
|
+
* await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745")
|
|
832
|
+
*/
|
|
833
|
+
deleteItemsLive(collectionId, request = {}, requestOptions) {
|
|
834
|
+
var _a;
|
|
835
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
836
|
+
const _response = yield core.fetcher({
|
|
837
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/live`),
|
|
838
|
+
method: "DELETE",
|
|
839
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
315
840
|
contentType: "application/json",
|
|
316
|
-
queryParameters: _queryParams,
|
|
317
841
|
requestType: "json",
|
|
842
|
+
body: serializers.collections.ItemsDeleteItemsLiveRequest.jsonOrThrow(request, {
|
|
843
|
+
unrecognizedObjectKeys: "passthrough",
|
|
844
|
+
allowUnrecognizedUnionMembers: true,
|
|
845
|
+
allowUnrecognizedEnumValues: true,
|
|
846
|
+
}),
|
|
318
847
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
319
848
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
320
849
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
321
850
|
});
|
|
322
851
|
if (_response.ok) {
|
|
323
|
-
return
|
|
324
|
-
unrecognizedObjectKeys: "passthrough",
|
|
325
|
-
allowUnrecognizedUnionMembers: true,
|
|
326
|
-
allowUnrecognizedEnumValues: true,
|
|
327
|
-
skipValidation: true,
|
|
328
|
-
breadcrumbsPrefix: ["response"],
|
|
329
|
-
});
|
|
852
|
+
return;
|
|
330
853
|
}
|
|
331
854
|
if (_response.error.reason === "status-code") {
|
|
332
855
|
switch (_response.error.statusCode) {
|
|
333
856
|
case 400:
|
|
334
857
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
335
858
|
case 401:
|
|
336
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
859
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
860
|
+
unrecognizedObjectKeys: "passthrough",
|
|
861
|
+
allowUnrecognizedUnionMembers: true,
|
|
862
|
+
allowUnrecognizedEnumValues: true,
|
|
863
|
+
skipValidation: true,
|
|
864
|
+
breadcrumbsPrefix: ["response"],
|
|
865
|
+
}));
|
|
337
866
|
case 404:
|
|
338
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
867
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
868
|
+
unrecognizedObjectKeys: "passthrough",
|
|
869
|
+
allowUnrecognizedUnionMembers: true,
|
|
870
|
+
allowUnrecognizedEnumValues: true,
|
|
871
|
+
skipValidation: true,
|
|
872
|
+
breadcrumbsPrefix: ["response"],
|
|
873
|
+
}));
|
|
339
874
|
case 429:
|
|
340
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
875
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
341
876
|
unrecognizedObjectKeys: "passthrough",
|
|
342
877
|
allowUnrecognizedUnionMembers: true,
|
|
343
878
|
allowUnrecognizedEnumValues: true,
|
|
@@ -345,7 +880,13 @@ class Items {
|
|
|
345
880
|
breadcrumbsPrefix: ["response"],
|
|
346
881
|
}));
|
|
347
882
|
case 500:
|
|
348
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
883
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
884
|
+
unrecognizedObjectKeys: "passthrough",
|
|
885
|
+
allowUnrecognizedUnionMembers: true,
|
|
886
|
+
allowUnrecognizedEnumValues: true,
|
|
887
|
+
skipValidation: true,
|
|
888
|
+
breadcrumbsPrefix: ["response"],
|
|
889
|
+
}));
|
|
349
890
|
default:
|
|
350
891
|
throw new errors.WebflowError({
|
|
351
892
|
statusCode: _response.error.statusCode,
|
|
@@ -360,7 +901,7 @@ class Items {
|
|
|
360
901
|
body: _response.error.rawBody,
|
|
361
902
|
});
|
|
362
903
|
case "timeout":
|
|
363
|
-
throw new errors.WebflowTimeoutError();
|
|
904
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /collections/{collection_id}/items/live.");
|
|
364
905
|
case "unknown":
|
|
365
906
|
throw new errors.WebflowError({
|
|
366
907
|
message: _response.error.errorMessage,
|
|
@@ -369,10 +910,14 @@ class Items {
|
|
|
369
910
|
});
|
|
370
911
|
}
|
|
371
912
|
/**
|
|
372
|
-
*
|
|
913
|
+
* Update a single live item or multiple live items (up to 100) in a Collection
|
|
914
|
+
*
|
|
915
|
+
* **Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be updated only in the primary locale.
|
|
916
|
+
*
|
|
917
|
+
* Required scope | `CMS:write`
|
|
373
918
|
*
|
|
374
919
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
375
|
-
* @param {Webflow.
|
|
920
|
+
* @param {Webflow.collections.ItemsUpdateItemsLiveRequest} request
|
|
376
921
|
* @param {Items.RequestOptions} requestOptions - Request-specific configuration.
|
|
377
922
|
*
|
|
378
923
|
* @throws {@link Webflow.BadRequestError}
|
|
@@ -382,44 +927,79 @@ class Items {
|
|
|
382
927
|
* @throws {@link Webflow.InternalServerError}
|
|
383
928
|
*
|
|
384
929
|
* @example
|
|
385
|
-
* await client.collections.items.
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
930
|
+
* await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", {
|
|
931
|
+
* items: [{
|
|
932
|
+
* id: "66f6ed9576ddacf3149d5ea6",
|
|
933
|
+
* cmsLocaleId: "66f6e966c9e1dc700a857ca5",
|
|
934
|
+
* fieldData: {
|
|
935
|
+
* name: "Ne Paniquez Pas",
|
|
936
|
+
* slug: "ne-paniquez-pas"
|
|
937
|
+
* }
|
|
938
|
+
* }, {
|
|
939
|
+
* id: "66f6ed9576ddacf3149d5ea6",
|
|
940
|
+
* cmsLocaleId: "66f6e966c9e1dc700a857ca4",
|
|
941
|
+
* fieldData: {
|
|
942
|
+
* name: "No Entrar en P\u00E1nico",
|
|
943
|
+
* slug: "no-entrar-en-panico"
|
|
944
|
+
* }
|
|
945
|
+
* }, {
|
|
946
|
+
* id: "66f6ed9576ddacf3149d5eaa",
|
|
947
|
+
* cmsLocaleId: "66f6e966c9e1dc700a857ca5",
|
|
948
|
+
* fieldData: {
|
|
949
|
+
* name: "Au Revoir et Merci pour Tous les Poissons",
|
|
950
|
+
* slug: "au-revoir-et-merci"
|
|
951
|
+
* }
|
|
952
|
+
* }, {
|
|
953
|
+
* id: "66f6ed9576ddacf3149d5eaa",
|
|
954
|
+
* cmsLocaleId: "66f6e966c9e1dc700a857ca4",
|
|
955
|
+
* fieldData: {
|
|
956
|
+
* name: "Hasta Luego y Gracias por Todo el Pescado",
|
|
957
|
+
* slug: "hasta-luego-y-gracias"
|
|
958
|
+
* }
|
|
959
|
+
* }]
|
|
960
|
+
* })
|
|
961
|
+
*
|
|
962
|
+
* @example
|
|
963
|
+
* await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", {
|
|
964
|
+
* items: [{
|
|
965
|
+
* id: "580e64008c9a982ac9b8b754",
|
|
966
|
+
* isArchived: false,
|
|
967
|
+
* isDraft: false,
|
|
968
|
+
* fieldData: {
|
|
969
|
+
* name: "Senior Data Analyst",
|
|
970
|
+
* slug: "senior-data-analyst"
|
|
971
|
+
* }
|
|
972
|
+
* }, {
|
|
973
|
+
* id: "580e64008c9a982ac9b8b754",
|
|
974
|
+
* isArchived: false,
|
|
975
|
+
* isDraft: false,
|
|
976
|
+
* fieldData: {
|
|
977
|
+
* name: "Product Manager",
|
|
978
|
+
* slug: "product-manager"
|
|
979
|
+
* }
|
|
980
|
+
* }]
|
|
397
981
|
* })
|
|
398
982
|
*/
|
|
399
|
-
|
|
983
|
+
updateItemsLive(collectionId, request = {}, requestOptions) {
|
|
400
984
|
var _a;
|
|
401
985
|
return __awaiter(this, void 0, void 0, function* () {
|
|
402
986
|
const _response = yield core.fetcher({
|
|
403
987
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/live`),
|
|
404
|
-
method: "
|
|
405
|
-
headers: {
|
|
406
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
407
|
-
"X-Fern-Language": "JavaScript",
|
|
408
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
409
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
410
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
411
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
412
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
413
|
-
},
|
|
988
|
+
method: "PATCH",
|
|
989
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
414
990
|
contentType: "application/json",
|
|
415
991
|
requestType: "json",
|
|
416
|
-
body: serializers.
|
|
992
|
+
body: serializers.collections.ItemsUpdateItemsLiveRequest.jsonOrThrow(request, {
|
|
993
|
+
unrecognizedObjectKeys: "passthrough",
|
|
994
|
+
allowUnrecognizedUnionMembers: true,
|
|
995
|
+
allowUnrecognizedEnumValues: true,
|
|
996
|
+
}),
|
|
417
997
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
418
998
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
419
999
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
420
1000
|
});
|
|
421
1001
|
if (_response.ok) {
|
|
422
|
-
return serializers.
|
|
1002
|
+
return serializers.CollectionItemListNoPagination.parseOrThrow(_response.body, {
|
|
423
1003
|
unrecognizedObjectKeys: "passthrough",
|
|
424
1004
|
allowUnrecognizedUnionMembers: true,
|
|
425
1005
|
allowUnrecognizedEnumValues: true,
|
|
@@ -432,11 +1012,23 @@ class Items {
|
|
|
432
1012
|
case 400:
|
|
433
1013
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
434
1014
|
case 401:
|
|
435
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1015
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1016
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1017
|
+
allowUnrecognizedUnionMembers: true,
|
|
1018
|
+
allowUnrecognizedEnumValues: true,
|
|
1019
|
+
skipValidation: true,
|
|
1020
|
+
breadcrumbsPrefix: ["response"],
|
|
1021
|
+
}));
|
|
436
1022
|
case 404:
|
|
437
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1023
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1024
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1025
|
+
allowUnrecognizedUnionMembers: true,
|
|
1026
|
+
allowUnrecognizedEnumValues: true,
|
|
1027
|
+
skipValidation: true,
|
|
1028
|
+
breadcrumbsPrefix: ["response"],
|
|
1029
|
+
}));
|
|
438
1030
|
case 429:
|
|
439
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1031
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
440
1032
|
unrecognizedObjectKeys: "passthrough",
|
|
441
1033
|
allowUnrecognizedUnionMembers: true,
|
|
442
1034
|
allowUnrecognizedEnumValues: true,
|
|
@@ -444,7 +1036,13 @@ class Items {
|
|
|
444
1036
|
breadcrumbsPrefix: ["response"],
|
|
445
1037
|
}));
|
|
446
1038
|
case 500:
|
|
447
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1039
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1040
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1041
|
+
allowUnrecognizedUnionMembers: true,
|
|
1042
|
+
allowUnrecognizedEnumValues: true,
|
|
1043
|
+
skipValidation: true,
|
|
1044
|
+
breadcrumbsPrefix: ["response"],
|
|
1045
|
+
}));
|
|
448
1046
|
default:
|
|
449
1047
|
throw new errors.WebflowError({
|
|
450
1048
|
statusCode: _response.error.statusCode,
|
|
@@ -459,7 +1057,7 @@ class Items {
|
|
|
459
1057
|
body: _response.error.rawBody,
|
|
460
1058
|
});
|
|
461
1059
|
case "timeout":
|
|
462
|
-
throw new errors.WebflowTimeoutError();
|
|
1060
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /collections/{collection_id}/items/live.");
|
|
463
1061
|
case "unknown":
|
|
464
1062
|
throw new errors.WebflowError({
|
|
465
1063
|
message: _response.error.errorMessage,
|
|
@@ -468,10 +1066,17 @@ class Items {
|
|
|
468
1066
|
});
|
|
469
1067
|
}
|
|
470
1068
|
/**
|
|
471
|
-
* Create
|
|
1069
|
+
* Create an item or multiple items in a CMS Collection across multiple corresponding locales.
|
|
1070
|
+
*
|
|
1071
|
+
* **Notes:**
|
|
1072
|
+
*
|
|
1073
|
+
* - This endpoint can create up to 100 items in a request.
|
|
1074
|
+
* - If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale.
|
|
1075
|
+
*
|
|
1076
|
+
* Required scope | `CMS:write`
|
|
472
1077
|
*
|
|
473
1078
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
474
|
-
* @param {Webflow.
|
|
1079
|
+
* @param {Webflow.collections.CreateBulkCollectionItemRequestBody} request
|
|
475
1080
|
* @param {Items.RequestOptions} requestOptions - Request-specific configuration.
|
|
476
1081
|
*
|
|
477
1082
|
* @throws {@link Webflow.BadRequestError}
|
|
@@ -481,28 +1086,44 @@ class Items {
|
|
|
481
1086
|
* @throws {@link Webflow.InternalServerError}
|
|
482
1087
|
*
|
|
483
1088
|
* @example
|
|
484
|
-
* await client.collections.items.
|
|
485
|
-
*
|
|
1089
|
+
* await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", {
|
|
1090
|
+
* cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"],
|
|
1091
|
+
* isArchived: false,
|
|
1092
|
+
* isDraft: false,
|
|
1093
|
+
* fieldData: {
|
|
1094
|
+
* name: "Don\u2019t Panic",
|
|
1095
|
+
* slug: "dont-panic"
|
|
1096
|
+
* }
|
|
1097
|
+
* })
|
|
1098
|
+
*
|
|
1099
|
+
* @example
|
|
1100
|
+
* await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", {
|
|
1101
|
+
* cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"],
|
|
1102
|
+
* isArchived: false,
|
|
1103
|
+
* isDraft: false,
|
|
1104
|
+
* fieldData: [{
|
|
1105
|
+
* name: "Don\u2019t Panic",
|
|
1106
|
+
* slug: "dont-panic"
|
|
1107
|
+
* }, {
|
|
1108
|
+
* name: "So Long and Thanks for All the Fish",
|
|
1109
|
+
* slug: "so-long-and-thanks"
|
|
1110
|
+
* }]
|
|
486
1111
|
* })
|
|
487
1112
|
*/
|
|
488
|
-
|
|
1113
|
+
createItems(collectionId, request = {}, requestOptions) {
|
|
489
1114
|
var _a;
|
|
490
1115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
491
1116
|
const _response = yield core.fetcher({
|
|
492
1117
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/bulk`),
|
|
493
1118
|
method: "POST",
|
|
494
|
-
headers: {
|
|
495
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
496
|
-
"X-Fern-Language": "JavaScript",
|
|
497
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
498
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
499
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
500
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
501
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
502
|
-
},
|
|
1119
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
503
1120
|
contentType: "application/json",
|
|
504
1121
|
requestType: "json",
|
|
505
|
-
body: serializers.
|
|
1122
|
+
body: serializers.collections.CreateBulkCollectionItemRequestBody.jsonOrThrow(request, {
|
|
1123
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1124
|
+
allowUnrecognizedUnionMembers: true,
|
|
1125
|
+
allowUnrecognizedEnumValues: true,
|
|
1126
|
+
}),
|
|
506
1127
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
507
1128
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
508
1129
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -521,11 +1142,23 @@ class Items {
|
|
|
521
1142
|
case 400:
|
|
522
1143
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
523
1144
|
case 401:
|
|
524
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1145
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1146
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1147
|
+
allowUnrecognizedUnionMembers: true,
|
|
1148
|
+
allowUnrecognizedEnumValues: true,
|
|
1149
|
+
skipValidation: true,
|
|
1150
|
+
breadcrumbsPrefix: ["response"],
|
|
1151
|
+
}));
|
|
525
1152
|
case 404:
|
|
526
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1153
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1154
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1155
|
+
allowUnrecognizedUnionMembers: true,
|
|
1156
|
+
allowUnrecognizedEnumValues: true,
|
|
1157
|
+
skipValidation: true,
|
|
1158
|
+
breadcrumbsPrefix: ["response"],
|
|
1159
|
+
}));
|
|
527
1160
|
case 429:
|
|
528
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1161
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
529
1162
|
unrecognizedObjectKeys: "passthrough",
|
|
530
1163
|
allowUnrecognizedUnionMembers: true,
|
|
531
1164
|
allowUnrecognizedEnumValues: true,
|
|
@@ -533,7 +1166,13 @@ class Items {
|
|
|
533
1166
|
breadcrumbsPrefix: ["response"],
|
|
534
1167
|
}));
|
|
535
1168
|
case 500:
|
|
536
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1169
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1170
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1171
|
+
allowUnrecognizedUnionMembers: true,
|
|
1172
|
+
allowUnrecognizedEnumValues: true,
|
|
1173
|
+
skipValidation: true,
|
|
1174
|
+
breadcrumbsPrefix: ["response"],
|
|
1175
|
+
}));
|
|
537
1176
|
default:
|
|
538
1177
|
throw new errors.WebflowError({
|
|
539
1178
|
statusCode: _response.error.statusCode,
|
|
@@ -548,7 +1187,7 @@ class Items {
|
|
|
548
1187
|
body: _response.error.rawBody,
|
|
549
1188
|
});
|
|
550
1189
|
case "timeout":
|
|
551
|
-
throw new errors.WebflowTimeoutError();
|
|
1190
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /collections/{collection_id}/items/bulk.");
|
|
552
1191
|
case "unknown":
|
|
553
1192
|
throw new errors.WebflowError({
|
|
554
1193
|
message: _response.error.errorMessage,
|
|
@@ -557,7 +1196,9 @@ class Items {
|
|
|
557
1196
|
});
|
|
558
1197
|
}
|
|
559
1198
|
/**
|
|
560
|
-
* Get details of a selected Collection Item.
|
|
1199
|
+
* Get details of a selected Collection Item.
|
|
1200
|
+
*
|
|
1201
|
+
* Required scope | `CMS:read`
|
|
561
1202
|
*
|
|
562
1203
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
563
1204
|
* @param {string} itemId - Unique identifier for an Item
|
|
@@ -584,15 +1225,7 @@ class Items {
|
|
|
584
1225
|
const _response = yield core.fetcher({
|
|
585
1226
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`),
|
|
586
1227
|
method: "GET",
|
|
587
|
-
headers: {
|
|
588
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
589
|
-
"X-Fern-Language": "JavaScript",
|
|
590
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
591
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
592
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
593
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
594
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
595
|
-
},
|
|
1228
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
596
1229
|
contentType: "application/json",
|
|
597
1230
|
queryParameters: _queryParams,
|
|
598
1231
|
requestType: "json",
|
|
@@ -614,11 +1247,23 @@ class Items {
|
|
|
614
1247
|
case 400:
|
|
615
1248
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
616
1249
|
case 401:
|
|
617
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1250
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1251
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1252
|
+
allowUnrecognizedUnionMembers: true,
|
|
1253
|
+
allowUnrecognizedEnumValues: true,
|
|
1254
|
+
skipValidation: true,
|
|
1255
|
+
breadcrumbsPrefix: ["response"],
|
|
1256
|
+
}));
|
|
618
1257
|
case 404:
|
|
619
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1258
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1259
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1260
|
+
allowUnrecognizedUnionMembers: true,
|
|
1261
|
+
allowUnrecognizedEnumValues: true,
|
|
1262
|
+
skipValidation: true,
|
|
1263
|
+
breadcrumbsPrefix: ["response"],
|
|
1264
|
+
}));
|
|
620
1265
|
case 429:
|
|
621
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1266
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
622
1267
|
unrecognizedObjectKeys: "passthrough",
|
|
623
1268
|
allowUnrecognizedUnionMembers: true,
|
|
624
1269
|
allowUnrecognizedEnumValues: true,
|
|
@@ -626,7 +1271,13 @@ class Items {
|
|
|
626
1271
|
breadcrumbsPrefix: ["response"],
|
|
627
1272
|
}));
|
|
628
1273
|
case 500:
|
|
629
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1274
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1275
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1276
|
+
allowUnrecognizedUnionMembers: true,
|
|
1277
|
+
allowUnrecognizedEnumValues: true,
|
|
1278
|
+
skipValidation: true,
|
|
1279
|
+
breadcrumbsPrefix: ["response"],
|
|
1280
|
+
}));
|
|
630
1281
|
default:
|
|
631
1282
|
throw new errors.WebflowError({
|
|
632
1283
|
statusCode: _response.error.statusCode,
|
|
@@ -641,7 +1292,7 @@ class Items {
|
|
|
641
1292
|
body: _response.error.rawBody,
|
|
642
1293
|
});
|
|
643
1294
|
case "timeout":
|
|
644
|
-
throw new errors.WebflowTimeoutError();
|
|
1295
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /collections/{collection_id}/items/{item_id}.");
|
|
645
1296
|
case "unknown":
|
|
646
1297
|
throw new errors.WebflowError({
|
|
647
1298
|
message: _response.error.errorMessage,
|
|
@@ -650,7 +1301,9 @@ class Items {
|
|
|
650
1301
|
});
|
|
651
1302
|
}
|
|
652
1303
|
/**
|
|
653
|
-
* Delete an Item from a Collection. This endpoint does not currently support bulk deletion.
|
|
1304
|
+
* Delete an Item from a Collection. This endpoint does not currently support bulk deletion.
|
|
1305
|
+
*
|
|
1306
|
+
* Required scope | `CMS:write`
|
|
654
1307
|
*
|
|
655
1308
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
656
1309
|
* @param {string} itemId - Unique identifier for an Item
|
|
@@ -677,15 +1330,7 @@ class Items {
|
|
|
677
1330
|
const _response = yield core.fetcher({
|
|
678
1331
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`),
|
|
679
1332
|
method: "DELETE",
|
|
680
|
-
headers: {
|
|
681
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
682
|
-
"X-Fern-Language": "JavaScript",
|
|
683
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
684
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
685
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
686
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
687
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
688
|
-
},
|
|
1333
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
689
1334
|
contentType: "application/json",
|
|
690
1335
|
queryParameters: _queryParams,
|
|
691
1336
|
requestType: "json",
|
|
@@ -701,11 +1346,23 @@ class Items {
|
|
|
701
1346
|
case 400:
|
|
702
1347
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
703
1348
|
case 401:
|
|
704
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1349
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1350
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1351
|
+
allowUnrecognizedUnionMembers: true,
|
|
1352
|
+
allowUnrecognizedEnumValues: true,
|
|
1353
|
+
skipValidation: true,
|
|
1354
|
+
breadcrumbsPrefix: ["response"],
|
|
1355
|
+
}));
|
|
705
1356
|
case 404:
|
|
706
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1357
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1358
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1359
|
+
allowUnrecognizedUnionMembers: true,
|
|
1360
|
+
allowUnrecognizedEnumValues: true,
|
|
1361
|
+
skipValidation: true,
|
|
1362
|
+
breadcrumbsPrefix: ["response"],
|
|
1363
|
+
}));
|
|
707
1364
|
case 429:
|
|
708
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1365
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
709
1366
|
unrecognizedObjectKeys: "passthrough",
|
|
710
1367
|
allowUnrecognizedUnionMembers: true,
|
|
711
1368
|
allowUnrecognizedEnumValues: true,
|
|
@@ -713,7 +1370,13 @@ class Items {
|
|
|
713
1370
|
breadcrumbsPrefix: ["response"],
|
|
714
1371
|
}));
|
|
715
1372
|
case 500:
|
|
716
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1373
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1374
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1375
|
+
allowUnrecognizedUnionMembers: true,
|
|
1376
|
+
allowUnrecognizedEnumValues: true,
|
|
1377
|
+
skipValidation: true,
|
|
1378
|
+
breadcrumbsPrefix: ["response"],
|
|
1379
|
+
}));
|
|
717
1380
|
default:
|
|
718
1381
|
throw new errors.WebflowError({
|
|
719
1382
|
statusCode: _response.error.statusCode,
|
|
@@ -728,7 +1391,7 @@ class Items {
|
|
|
728
1391
|
body: _response.error.rawBody,
|
|
729
1392
|
});
|
|
730
1393
|
case "timeout":
|
|
731
|
-
throw new errors.WebflowTimeoutError();
|
|
1394
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /collections/{collection_id}/items/{item_id}.");
|
|
732
1395
|
case "unknown":
|
|
733
1396
|
throw new errors.WebflowError({
|
|
734
1397
|
message: _response.error.errorMessage,
|
|
@@ -737,7 +1400,9 @@ class Items {
|
|
|
737
1400
|
});
|
|
738
1401
|
}
|
|
739
1402
|
/**
|
|
740
|
-
* Update a selected Item in a Collection.
|
|
1403
|
+
* Update a selected Item in a Collection.
|
|
1404
|
+
*
|
|
1405
|
+
* Required scope | `CMS:write`
|
|
741
1406
|
*
|
|
742
1407
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
743
1408
|
* @param {string} itemId - Unique identifier for an Item
|
|
@@ -771,18 +1436,14 @@ class Items {
|
|
|
771
1436
|
const _response = yield core.fetcher({
|
|
772
1437
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`),
|
|
773
1438
|
method: "PATCH",
|
|
774
|
-
headers: {
|
|
775
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
776
|
-
"X-Fern-Language": "JavaScript",
|
|
777
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
778
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
779
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
780
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
781
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
782
|
-
},
|
|
1439
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
783
1440
|
contentType: "application/json",
|
|
784
1441
|
requestType: "json",
|
|
785
|
-
body: serializers.CollectionItem.jsonOrThrow(request, {
|
|
1442
|
+
body: serializers.CollectionItem.jsonOrThrow(request, {
|
|
1443
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1444
|
+
allowUnrecognizedUnionMembers: true,
|
|
1445
|
+
allowUnrecognizedEnumValues: true,
|
|
1446
|
+
}),
|
|
786
1447
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
787
1448
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
788
1449
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -801,11 +1462,23 @@ class Items {
|
|
|
801
1462
|
case 400:
|
|
802
1463
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
803
1464
|
case 401:
|
|
804
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1465
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1466
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1467
|
+
allowUnrecognizedUnionMembers: true,
|
|
1468
|
+
allowUnrecognizedEnumValues: true,
|
|
1469
|
+
skipValidation: true,
|
|
1470
|
+
breadcrumbsPrefix: ["response"],
|
|
1471
|
+
}));
|
|
805
1472
|
case 404:
|
|
806
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1473
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1474
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1475
|
+
allowUnrecognizedUnionMembers: true,
|
|
1476
|
+
allowUnrecognizedEnumValues: true,
|
|
1477
|
+
skipValidation: true,
|
|
1478
|
+
breadcrumbsPrefix: ["response"],
|
|
1479
|
+
}));
|
|
807
1480
|
case 429:
|
|
808
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1481
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
809
1482
|
unrecognizedObjectKeys: "passthrough",
|
|
810
1483
|
allowUnrecognizedUnionMembers: true,
|
|
811
1484
|
allowUnrecognizedEnumValues: true,
|
|
@@ -813,7 +1486,13 @@ class Items {
|
|
|
813
1486
|
breadcrumbsPrefix: ["response"],
|
|
814
1487
|
}));
|
|
815
1488
|
case 500:
|
|
816
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1489
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1490
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1491
|
+
allowUnrecognizedUnionMembers: true,
|
|
1492
|
+
allowUnrecognizedEnumValues: true,
|
|
1493
|
+
skipValidation: true,
|
|
1494
|
+
breadcrumbsPrefix: ["response"],
|
|
1495
|
+
}));
|
|
817
1496
|
default:
|
|
818
1497
|
throw new errors.WebflowError({
|
|
819
1498
|
statusCode: _response.error.statusCode,
|
|
@@ -828,7 +1507,7 @@ class Items {
|
|
|
828
1507
|
body: _response.error.rawBody,
|
|
829
1508
|
});
|
|
830
1509
|
case "timeout":
|
|
831
|
-
throw new errors.WebflowTimeoutError();
|
|
1510
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /collections/{collection_id}/items/{item_id}.");
|
|
832
1511
|
case "unknown":
|
|
833
1512
|
throw new errors.WebflowError({
|
|
834
1513
|
message: _response.error.errorMessage,
|
|
@@ -837,7 +1516,9 @@ class Items {
|
|
|
837
1516
|
});
|
|
838
1517
|
}
|
|
839
1518
|
/**
|
|
840
|
-
* Get details of a selected Collection live Item.
|
|
1519
|
+
* Get details of a selected Collection live Item.
|
|
1520
|
+
*
|
|
1521
|
+
* Required scope | `CMS:read`
|
|
841
1522
|
*
|
|
842
1523
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
843
1524
|
* @param {string} itemId - Unique identifier for an Item
|
|
@@ -864,15 +1545,7 @@ class Items {
|
|
|
864
1545
|
const _response = yield core.fetcher({
|
|
865
1546
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`),
|
|
866
1547
|
method: "GET",
|
|
867
|
-
headers: {
|
|
868
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
869
|
-
"X-Fern-Language": "JavaScript",
|
|
870
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
871
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
872
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
873
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
874
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
875
|
-
},
|
|
1548
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
876
1549
|
contentType: "application/json",
|
|
877
1550
|
queryParameters: _queryParams,
|
|
878
1551
|
requestType: "json",
|
|
@@ -894,11 +1567,23 @@ class Items {
|
|
|
894
1567
|
case 400:
|
|
895
1568
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
896
1569
|
case 401:
|
|
897
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1570
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1571
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1572
|
+
allowUnrecognizedUnionMembers: true,
|
|
1573
|
+
allowUnrecognizedEnumValues: true,
|
|
1574
|
+
skipValidation: true,
|
|
1575
|
+
breadcrumbsPrefix: ["response"],
|
|
1576
|
+
}));
|
|
898
1577
|
case 404:
|
|
899
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1578
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1579
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1580
|
+
allowUnrecognizedUnionMembers: true,
|
|
1581
|
+
allowUnrecognizedEnumValues: true,
|
|
1582
|
+
skipValidation: true,
|
|
1583
|
+
breadcrumbsPrefix: ["response"],
|
|
1584
|
+
}));
|
|
900
1585
|
case 429:
|
|
901
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1586
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
902
1587
|
unrecognizedObjectKeys: "passthrough",
|
|
903
1588
|
allowUnrecognizedUnionMembers: true,
|
|
904
1589
|
allowUnrecognizedEnumValues: true,
|
|
@@ -906,7 +1591,13 @@ class Items {
|
|
|
906
1591
|
breadcrumbsPrefix: ["response"],
|
|
907
1592
|
}));
|
|
908
1593
|
case 500:
|
|
909
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1594
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1595
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1596
|
+
allowUnrecognizedUnionMembers: true,
|
|
1597
|
+
allowUnrecognizedEnumValues: true,
|
|
1598
|
+
skipValidation: true,
|
|
1599
|
+
breadcrumbsPrefix: ["response"],
|
|
1600
|
+
}));
|
|
910
1601
|
default:
|
|
911
1602
|
throw new errors.WebflowError({
|
|
912
1603
|
statusCode: _response.error.statusCode,
|
|
@@ -921,7 +1612,7 @@ class Items {
|
|
|
921
1612
|
body: _response.error.rawBody,
|
|
922
1613
|
});
|
|
923
1614
|
case "timeout":
|
|
924
|
-
throw new errors.WebflowTimeoutError();
|
|
1615
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /collections/{collection_id}/items/{item_id}/live.");
|
|
925
1616
|
case "unknown":
|
|
926
1617
|
throw new errors.WebflowError({
|
|
927
1618
|
message: _response.error.errorMessage,
|
|
@@ -930,7 +1621,11 @@ class Items {
|
|
|
930
1621
|
});
|
|
931
1622
|
}
|
|
932
1623
|
/**
|
|
933
|
-
* Remove a live item from the site. Removing a published item will unpublish the item from the live site and set it to draft.
|
|
1624
|
+
* Remove a live item from the site. Removing a published item will unpublish the item from the live site and set it to draft.
|
|
1625
|
+
*
|
|
1626
|
+
* This endpoint does not currently support bulk deletion.
|
|
1627
|
+
*
|
|
1628
|
+
* Required scope | `CMS:write`
|
|
934
1629
|
*
|
|
935
1630
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
936
1631
|
* @param {string} itemId - Unique identifier for an Item
|
|
@@ -957,15 +1652,7 @@ class Items {
|
|
|
957
1652
|
const _response = yield core.fetcher({
|
|
958
1653
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`),
|
|
959
1654
|
method: "DELETE",
|
|
960
|
-
headers: {
|
|
961
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
962
|
-
"X-Fern-Language": "JavaScript",
|
|
963
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
964
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
965
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
966
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
967
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
968
|
-
},
|
|
1655
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
969
1656
|
contentType: "application/json",
|
|
970
1657
|
queryParameters: _queryParams,
|
|
971
1658
|
requestType: "json",
|
|
@@ -981,11 +1668,23 @@ class Items {
|
|
|
981
1668
|
case 400:
|
|
982
1669
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
983
1670
|
case 401:
|
|
984
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1671
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1672
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1673
|
+
allowUnrecognizedUnionMembers: true,
|
|
1674
|
+
allowUnrecognizedEnumValues: true,
|
|
1675
|
+
skipValidation: true,
|
|
1676
|
+
breadcrumbsPrefix: ["response"],
|
|
1677
|
+
}));
|
|
985
1678
|
case 404:
|
|
986
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1679
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1680
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1681
|
+
allowUnrecognizedUnionMembers: true,
|
|
1682
|
+
allowUnrecognizedEnumValues: true,
|
|
1683
|
+
skipValidation: true,
|
|
1684
|
+
breadcrumbsPrefix: ["response"],
|
|
1685
|
+
}));
|
|
987
1686
|
case 429:
|
|
988
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1687
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
989
1688
|
unrecognizedObjectKeys: "passthrough",
|
|
990
1689
|
allowUnrecognizedUnionMembers: true,
|
|
991
1690
|
allowUnrecognizedEnumValues: true,
|
|
@@ -993,7 +1692,13 @@ class Items {
|
|
|
993
1692
|
breadcrumbsPrefix: ["response"],
|
|
994
1693
|
}));
|
|
995
1694
|
case 500:
|
|
996
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1695
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1696
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1697
|
+
allowUnrecognizedUnionMembers: true,
|
|
1698
|
+
allowUnrecognizedEnumValues: true,
|
|
1699
|
+
skipValidation: true,
|
|
1700
|
+
breadcrumbsPrefix: ["response"],
|
|
1701
|
+
}));
|
|
997
1702
|
default:
|
|
998
1703
|
throw new errors.WebflowError({
|
|
999
1704
|
statusCode: _response.error.statusCode,
|
|
@@ -1008,7 +1713,7 @@ class Items {
|
|
|
1008
1713
|
body: _response.error.rawBody,
|
|
1009
1714
|
});
|
|
1010
1715
|
case "timeout":
|
|
1011
|
-
throw new errors.WebflowTimeoutError();
|
|
1716
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /collections/{collection_id}/items/{item_id}/live.");
|
|
1012
1717
|
case "unknown":
|
|
1013
1718
|
throw new errors.WebflowError({
|
|
1014
1719
|
message: _response.error.errorMessage,
|
|
@@ -1017,7 +1722,9 @@ class Items {
|
|
|
1017
1722
|
});
|
|
1018
1723
|
}
|
|
1019
1724
|
/**
|
|
1020
|
-
* Update a selected live Item in a Collection. The updates for this Item will be published to the live site.
|
|
1725
|
+
* Update a selected live Item in a Collection. The updates for this Item will be published to the live site.
|
|
1726
|
+
*
|
|
1727
|
+
* Required scope | `CMS:write`
|
|
1021
1728
|
*
|
|
1022
1729
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
1023
1730
|
* @param {string} itemId - Unique identifier for an Item
|
|
@@ -1051,18 +1758,14 @@ class Items {
|
|
|
1051
1758
|
const _response = yield core.fetcher({
|
|
1052
1759
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`),
|
|
1053
1760
|
method: "PATCH",
|
|
1054
|
-
headers: {
|
|
1055
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
1056
|
-
"X-Fern-Language": "JavaScript",
|
|
1057
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
1058
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
1059
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
1060
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
1061
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
1062
|
-
},
|
|
1761
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1063
1762
|
contentType: "application/json",
|
|
1064
1763
|
requestType: "json",
|
|
1065
|
-
body: serializers.CollectionItem.jsonOrThrow(request, {
|
|
1764
|
+
body: serializers.CollectionItem.jsonOrThrow(request, {
|
|
1765
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1766
|
+
allowUnrecognizedUnionMembers: true,
|
|
1767
|
+
allowUnrecognizedEnumValues: true,
|
|
1768
|
+
}),
|
|
1066
1769
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1067
1770
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1068
1771
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1081,11 +1784,23 @@ class Items {
|
|
|
1081
1784
|
case 400:
|
|
1082
1785
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
1083
1786
|
case 401:
|
|
1084
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1787
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1788
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1789
|
+
allowUnrecognizedUnionMembers: true,
|
|
1790
|
+
allowUnrecognizedEnumValues: true,
|
|
1791
|
+
skipValidation: true,
|
|
1792
|
+
breadcrumbsPrefix: ["response"],
|
|
1793
|
+
}));
|
|
1085
1794
|
case 404:
|
|
1086
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1795
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1796
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1797
|
+
allowUnrecognizedUnionMembers: true,
|
|
1798
|
+
allowUnrecognizedEnumValues: true,
|
|
1799
|
+
skipValidation: true,
|
|
1800
|
+
breadcrumbsPrefix: ["response"],
|
|
1801
|
+
}));
|
|
1087
1802
|
case 429:
|
|
1088
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1803
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1089
1804
|
unrecognizedObjectKeys: "passthrough",
|
|
1090
1805
|
allowUnrecognizedUnionMembers: true,
|
|
1091
1806
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1093,7 +1808,13 @@ class Items {
|
|
|
1093
1808
|
breadcrumbsPrefix: ["response"],
|
|
1094
1809
|
}));
|
|
1095
1810
|
case 500:
|
|
1096
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1811
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1812
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1813
|
+
allowUnrecognizedUnionMembers: true,
|
|
1814
|
+
allowUnrecognizedEnumValues: true,
|
|
1815
|
+
skipValidation: true,
|
|
1816
|
+
breadcrumbsPrefix: ["response"],
|
|
1817
|
+
}));
|
|
1097
1818
|
default:
|
|
1098
1819
|
throw new errors.WebflowError({
|
|
1099
1820
|
statusCode: _response.error.statusCode,
|
|
@@ -1108,7 +1829,7 @@ class Items {
|
|
|
1108
1829
|
body: _response.error.rawBody,
|
|
1109
1830
|
});
|
|
1110
1831
|
case "timeout":
|
|
1111
|
-
throw new errors.WebflowTimeoutError();
|
|
1832
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /collections/{collection_id}/items/{item_id}/live.");
|
|
1112
1833
|
case "unknown":
|
|
1113
1834
|
throw new errors.WebflowError({
|
|
1114
1835
|
message: _response.error.errorMessage,
|
|
@@ -1117,7 +1838,9 @@ class Items {
|
|
|
1117
1838
|
});
|
|
1118
1839
|
}
|
|
1119
1840
|
/**
|
|
1120
|
-
* Publish an item or multiple items.
|
|
1841
|
+
* Publish an item or multiple items.
|
|
1842
|
+
*
|
|
1843
|
+
* Required scope | `cms:write`
|
|
1121
1844
|
*
|
|
1122
1845
|
* @param {string} collectionId - Unique identifier for a Collection
|
|
1123
1846
|
* @param {Webflow.collections.ItemsPublishItemRequest} request
|
|
@@ -1126,6 +1849,7 @@ class Items {
|
|
|
1126
1849
|
* @throws {@link Webflow.BadRequestError}
|
|
1127
1850
|
* @throws {@link Webflow.UnauthorizedError}
|
|
1128
1851
|
* @throws {@link Webflow.NotFoundError}
|
|
1852
|
+
* @throws {@link Webflow.ConflictError}
|
|
1129
1853
|
* @throws {@link Webflow.TooManyRequestsError}
|
|
1130
1854
|
* @throws {@link Webflow.InternalServerError}
|
|
1131
1855
|
*
|
|
@@ -1140,19 +1864,13 @@ class Items {
|
|
|
1140
1864
|
const _response = yield core.fetcher({
|
|
1141
1865
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/publish`),
|
|
1142
1866
|
method: "POST",
|
|
1143
|
-
headers: {
|
|
1144
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
1145
|
-
"X-Fern-Language": "JavaScript",
|
|
1146
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
1147
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
1148
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
1149
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
1150
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
1151
|
-
},
|
|
1867
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1152
1868
|
contentType: "application/json",
|
|
1153
1869
|
requestType: "json",
|
|
1154
1870
|
body: serializers.collections.ItemsPublishItemRequest.jsonOrThrow(request, {
|
|
1155
|
-
unrecognizedObjectKeys: "
|
|
1871
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1872
|
+
allowUnrecognizedUnionMembers: true,
|
|
1873
|
+
allowUnrecognizedEnumValues: true,
|
|
1156
1874
|
}),
|
|
1157
1875
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1158
1876
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -1172,11 +1890,25 @@ class Items {
|
|
|
1172
1890
|
case 400:
|
|
1173
1891
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
1174
1892
|
case 401:
|
|
1175
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
1893
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1894
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1895
|
+
allowUnrecognizedUnionMembers: true,
|
|
1896
|
+
allowUnrecognizedEnumValues: true,
|
|
1897
|
+
skipValidation: true,
|
|
1898
|
+
breadcrumbsPrefix: ["response"],
|
|
1899
|
+
}));
|
|
1176
1900
|
case 404:
|
|
1177
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
1901
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1902
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1903
|
+
allowUnrecognizedUnionMembers: true,
|
|
1904
|
+
allowUnrecognizedEnumValues: true,
|
|
1905
|
+
skipValidation: true,
|
|
1906
|
+
breadcrumbsPrefix: ["response"],
|
|
1907
|
+
}));
|
|
1908
|
+
case 409:
|
|
1909
|
+
throw new Webflow.ConflictError(_response.error.body);
|
|
1178
1910
|
case 429:
|
|
1179
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
1911
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1180
1912
|
unrecognizedObjectKeys: "passthrough",
|
|
1181
1913
|
allowUnrecognizedUnionMembers: true,
|
|
1182
1914
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1184,7 +1916,13 @@ class Items {
|
|
|
1184
1916
|
breadcrumbsPrefix: ["response"],
|
|
1185
1917
|
}));
|
|
1186
1918
|
case 500:
|
|
1187
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
1919
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
1920
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1921
|
+
allowUnrecognizedUnionMembers: true,
|
|
1922
|
+
allowUnrecognizedEnumValues: true,
|
|
1923
|
+
skipValidation: true,
|
|
1924
|
+
breadcrumbsPrefix: ["response"],
|
|
1925
|
+
}));
|
|
1188
1926
|
default:
|
|
1189
1927
|
throw new errors.WebflowError({
|
|
1190
1928
|
statusCode: _response.error.statusCode,
|
|
@@ -1199,7 +1937,7 @@ class Items {
|
|
|
1199
1937
|
body: _response.error.rawBody,
|
|
1200
1938
|
});
|
|
1201
1939
|
case "timeout":
|
|
1202
|
-
throw new errors.WebflowTimeoutError();
|
|
1940
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /collections/{collection_id}/items/publish.");
|
|
1203
1941
|
case "unknown":
|
|
1204
1942
|
throw new errors.WebflowError({
|
|
1205
1943
|
message: _response.error.errorMessage,
|