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 Assets {
|
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* List assets for a given site
|
|
53
|
+
* List assets for a given site
|
|
54
|
+
*
|
|
55
|
+
* Required scope | `assets:read`
|
|
54
56
|
*
|
|
55
57
|
* @param {string} siteId - Unique identifier for a Site
|
|
56
58
|
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -70,15 +72,7 @@ class Assets {
|
|
|
70
72
|
const _response = yield core.fetcher({
|
|
71
73
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/assets`),
|
|
72
74
|
method: "GET",
|
|
73
|
-
headers: {
|
|
74
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
75
|
-
"X-Fern-Language": "JavaScript",
|
|
76
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
77
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
78
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
79
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
80
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
81
|
-
},
|
|
75
|
+
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),
|
|
82
76
|
contentType: "application/json",
|
|
83
77
|
requestType: "json",
|
|
84
78
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -99,11 +93,23 @@ class Assets {
|
|
|
99
93
|
case 400:
|
|
100
94
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
101
95
|
case 401:
|
|
102
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
96
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
97
|
+
unrecognizedObjectKeys: "passthrough",
|
|
98
|
+
allowUnrecognizedUnionMembers: true,
|
|
99
|
+
allowUnrecognizedEnumValues: true,
|
|
100
|
+
skipValidation: true,
|
|
101
|
+
breadcrumbsPrefix: ["response"],
|
|
102
|
+
}));
|
|
103
103
|
case 404:
|
|
104
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
104
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
105
|
+
unrecognizedObjectKeys: "passthrough",
|
|
106
|
+
allowUnrecognizedUnionMembers: true,
|
|
107
|
+
allowUnrecognizedEnumValues: true,
|
|
108
|
+
skipValidation: true,
|
|
109
|
+
breadcrumbsPrefix: ["response"],
|
|
110
|
+
}));
|
|
105
111
|
case 429:
|
|
106
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
112
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
107
113
|
unrecognizedObjectKeys: "passthrough",
|
|
108
114
|
allowUnrecognizedUnionMembers: true,
|
|
109
115
|
allowUnrecognizedEnumValues: true,
|
|
@@ -111,7 +117,13 @@ class Assets {
|
|
|
111
117
|
breadcrumbsPrefix: ["response"],
|
|
112
118
|
}));
|
|
113
119
|
case 500:
|
|
114
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
120
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
121
|
+
unrecognizedObjectKeys: "passthrough",
|
|
122
|
+
allowUnrecognizedUnionMembers: true,
|
|
123
|
+
allowUnrecognizedEnumValues: true,
|
|
124
|
+
skipValidation: true,
|
|
125
|
+
breadcrumbsPrefix: ["response"],
|
|
126
|
+
}));
|
|
115
127
|
default:
|
|
116
128
|
throw new errors.WebflowError({
|
|
117
129
|
statusCode: _response.error.statusCode,
|
|
@@ -126,7 +138,7 @@ class Assets {
|
|
|
126
138
|
body: _response.error.rawBody,
|
|
127
139
|
});
|
|
128
140
|
case "timeout":
|
|
129
|
-
throw new errors.WebflowTimeoutError();
|
|
141
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/assets.");
|
|
130
142
|
case "unknown":
|
|
131
143
|
throw new errors.WebflowError({
|
|
132
144
|
message: _response.error.errorMessage,
|
|
@@ -135,7 +147,13 @@ class Assets {
|
|
|
135
147
|
});
|
|
136
148
|
}
|
|
137
149
|
/**
|
|
138
|
-
* Create a new asset entry.
|
|
150
|
+
* Create a new asset entry.
|
|
151
|
+
*
|
|
152
|
+
* This endpoint generates a response with the following information: `uploadUrl` and `uploadDetails`.
|
|
153
|
+
* You can use these two properties to [upload the file to Amazon s3 by making a POST](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html)
|
|
154
|
+
* request to the `uploadUrl` with the `uploadDetails` object as your header information in the request.
|
|
155
|
+
*
|
|
156
|
+
* Required scope | `assets:write`
|
|
139
157
|
*
|
|
140
158
|
* @param {string} siteId - Unique identifier for a Site
|
|
141
159
|
* @param {Webflow.AssetsCreateRequest} request
|
|
@@ -159,18 +177,14 @@ class Assets {
|
|
|
159
177
|
const _response = yield core.fetcher({
|
|
160
178
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/assets`),
|
|
161
179
|
method: "POST",
|
|
162
|
-
headers: {
|
|
163
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
164
|
-
"X-Fern-Language": "JavaScript",
|
|
165
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
166
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
167
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
168
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
169
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
170
|
-
},
|
|
180
|
+
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),
|
|
171
181
|
contentType: "application/json",
|
|
172
182
|
requestType: "json",
|
|
173
|
-
body: serializers.AssetsCreateRequest.jsonOrThrow(request, {
|
|
183
|
+
body: serializers.AssetsCreateRequest.jsonOrThrow(request, {
|
|
184
|
+
unrecognizedObjectKeys: "passthrough",
|
|
185
|
+
allowUnrecognizedUnionMembers: true,
|
|
186
|
+
allowUnrecognizedEnumValues: true,
|
|
187
|
+
}),
|
|
174
188
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
175
189
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
176
190
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -189,11 +203,23 @@ class Assets {
|
|
|
189
203
|
case 400:
|
|
190
204
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
191
205
|
case 401:
|
|
192
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
206
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
207
|
+
unrecognizedObjectKeys: "passthrough",
|
|
208
|
+
allowUnrecognizedUnionMembers: true,
|
|
209
|
+
allowUnrecognizedEnumValues: true,
|
|
210
|
+
skipValidation: true,
|
|
211
|
+
breadcrumbsPrefix: ["response"],
|
|
212
|
+
}));
|
|
193
213
|
case 404:
|
|
194
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
214
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
215
|
+
unrecognizedObjectKeys: "passthrough",
|
|
216
|
+
allowUnrecognizedUnionMembers: true,
|
|
217
|
+
allowUnrecognizedEnumValues: true,
|
|
218
|
+
skipValidation: true,
|
|
219
|
+
breadcrumbsPrefix: ["response"],
|
|
220
|
+
}));
|
|
195
221
|
case 429:
|
|
196
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
222
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
197
223
|
unrecognizedObjectKeys: "passthrough",
|
|
198
224
|
allowUnrecognizedUnionMembers: true,
|
|
199
225
|
allowUnrecognizedEnumValues: true,
|
|
@@ -201,7 +227,13 @@ class Assets {
|
|
|
201
227
|
breadcrumbsPrefix: ["response"],
|
|
202
228
|
}));
|
|
203
229
|
case 500:
|
|
204
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
230
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
231
|
+
unrecognizedObjectKeys: "passthrough",
|
|
232
|
+
allowUnrecognizedUnionMembers: true,
|
|
233
|
+
allowUnrecognizedEnumValues: true,
|
|
234
|
+
skipValidation: true,
|
|
235
|
+
breadcrumbsPrefix: ["response"],
|
|
236
|
+
}));
|
|
205
237
|
default:
|
|
206
238
|
throw new errors.WebflowError({
|
|
207
239
|
statusCode: _response.error.statusCode,
|
|
@@ -216,7 +248,7 @@ class Assets {
|
|
|
216
248
|
body: _response.error.rawBody,
|
|
217
249
|
});
|
|
218
250
|
case "timeout":
|
|
219
|
-
throw new errors.WebflowTimeoutError();
|
|
251
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/assets.");
|
|
220
252
|
case "unknown":
|
|
221
253
|
throw new errors.WebflowError({
|
|
222
254
|
message: _response.error.errorMessage,
|
|
@@ -225,7 +257,9 @@ class Assets {
|
|
|
225
257
|
});
|
|
226
258
|
}
|
|
227
259
|
/**
|
|
228
|
-
* Get an Asset
|
|
260
|
+
* Get an Asset
|
|
261
|
+
*
|
|
262
|
+
* Required scope | `assets:read`
|
|
229
263
|
*
|
|
230
264
|
* @param {string} assetId - Unique identifier for an Asset on a site
|
|
231
265
|
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -245,15 +279,7 @@ class Assets {
|
|
|
245
279
|
const _response = yield core.fetcher({
|
|
246
280
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `assets/${encodeURIComponent(assetId)}`),
|
|
247
281
|
method: "GET",
|
|
248
|
-
headers: {
|
|
249
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
250
|
-
"X-Fern-Language": "JavaScript",
|
|
251
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
252
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
253
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
254
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
255
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
256
|
-
},
|
|
282
|
+
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),
|
|
257
283
|
contentType: "application/json",
|
|
258
284
|
requestType: "json",
|
|
259
285
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -274,11 +300,23 @@ class Assets {
|
|
|
274
300
|
case 400:
|
|
275
301
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
276
302
|
case 401:
|
|
277
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
303
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
304
|
+
unrecognizedObjectKeys: "passthrough",
|
|
305
|
+
allowUnrecognizedUnionMembers: true,
|
|
306
|
+
allowUnrecognizedEnumValues: true,
|
|
307
|
+
skipValidation: true,
|
|
308
|
+
breadcrumbsPrefix: ["response"],
|
|
309
|
+
}));
|
|
278
310
|
case 404:
|
|
279
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
311
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
312
|
+
unrecognizedObjectKeys: "passthrough",
|
|
313
|
+
allowUnrecognizedUnionMembers: true,
|
|
314
|
+
allowUnrecognizedEnumValues: true,
|
|
315
|
+
skipValidation: true,
|
|
316
|
+
breadcrumbsPrefix: ["response"],
|
|
317
|
+
}));
|
|
280
318
|
case 429:
|
|
281
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
319
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
282
320
|
unrecognizedObjectKeys: "passthrough",
|
|
283
321
|
allowUnrecognizedUnionMembers: true,
|
|
284
322
|
allowUnrecognizedEnumValues: true,
|
|
@@ -286,7 +324,13 @@ class Assets {
|
|
|
286
324
|
breadcrumbsPrefix: ["response"],
|
|
287
325
|
}));
|
|
288
326
|
case 500:
|
|
289
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
327
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
328
|
+
unrecognizedObjectKeys: "passthrough",
|
|
329
|
+
allowUnrecognizedUnionMembers: true,
|
|
330
|
+
allowUnrecognizedEnumValues: true,
|
|
331
|
+
skipValidation: true,
|
|
332
|
+
breadcrumbsPrefix: ["response"],
|
|
333
|
+
}));
|
|
290
334
|
default:
|
|
291
335
|
throw new errors.WebflowError({
|
|
292
336
|
statusCode: _response.error.statusCode,
|
|
@@ -301,7 +345,7 @@ class Assets {
|
|
|
301
345
|
body: _response.error.rawBody,
|
|
302
346
|
});
|
|
303
347
|
case "timeout":
|
|
304
|
-
throw new errors.WebflowTimeoutError();
|
|
348
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /assets/{asset_id}.");
|
|
305
349
|
case "unknown":
|
|
306
350
|
throw new errors.WebflowError({
|
|
307
351
|
message: _response.error.errorMessage,
|
|
@@ -312,6 +356,8 @@ class Assets {
|
|
|
312
356
|
/**
|
|
313
357
|
* Delete an Asset
|
|
314
358
|
*
|
|
359
|
+
* Required Scope: `assets: write`
|
|
360
|
+
*
|
|
315
361
|
* @param {string} assetId - Unique identifier for an Asset on a site
|
|
316
362
|
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
317
363
|
*
|
|
@@ -330,15 +376,7 @@ class Assets {
|
|
|
330
376
|
const _response = yield core.fetcher({
|
|
331
377
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `assets/${encodeURIComponent(assetId)}`),
|
|
332
378
|
method: "DELETE",
|
|
333
|
-
headers: {
|
|
334
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
335
|
-
"X-Fern-Language": "JavaScript",
|
|
336
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
337
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
338
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
339
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
340
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
341
|
-
},
|
|
379
|
+
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),
|
|
342
380
|
contentType: "application/json",
|
|
343
381
|
requestType: "json",
|
|
344
382
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -353,11 +391,23 @@ class Assets {
|
|
|
353
391
|
case 400:
|
|
354
392
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
355
393
|
case 401:
|
|
356
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
394
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
395
|
+
unrecognizedObjectKeys: "passthrough",
|
|
396
|
+
allowUnrecognizedUnionMembers: true,
|
|
397
|
+
allowUnrecognizedEnumValues: true,
|
|
398
|
+
skipValidation: true,
|
|
399
|
+
breadcrumbsPrefix: ["response"],
|
|
400
|
+
}));
|
|
357
401
|
case 404:
|
|
358
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
402
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
403
|
+
unrecognizedObjectKeys: "passthrough",
|
|
404
|
+
allowUnrecognizedUnionMembers: true,
|
|
405
|
+
allowUnrecognizedEnumValues: true,
|
|
406
|
+
skipValidation: true,
|
|
407
|
+
breadcrumbsPrefix: ["response"],
|
|
408
|
+
}));
|
|
359
409
|
case 429:
|
|
360
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
410
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
361
411
|
unrecognizedObjectKeys: "passthrough",
|
|
362
412
|
allowUnrecognizedUnionMembers: true,
|
|
363
413
|
allowUnrecognizedEnumValues: true,
|
|
@@ -365,7 +415,13 @@ class Assets {
|
|
|
365
415
|
breadcrumbsPrefix: ["response"],
|
|
366
416
|
}));
|
|
367
417
|
case 500:
|
|
368
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
418
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
419
|
+
unrecognizedObjectKeys: "passthrough",
|
|
420
|
+
allowUnrecognizedUnionMembers: true,
|
|
421
|
+
allowUnrecognizedEnumValues: true,
|
|
422
|
+
skipValidation: true,
|
|
423
|
+
breadcrumbsPrefix: ["response"],
|
|
424
|
+
}));
|
|
369
425
|
default:
|
|
370
426
|
throw new errors.WebflowError({
|
|
371
427
|
statusCode: _response.error.statusCode,
|
|
@@ -380,7 +436,7 @@ class Assets {
|
|
|
380
436
|
body: _response.error.rawBody,
|
|
381
437
|
});
|
|
382
438
|
case "timeout":
|
|
383
|
-
throw new errors.WebflowTimeoutError();
|
|
439
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /assets/{asset_id}.");
|
|
384
440
|
case "unknown":
|
|
385
441
|
throw new errors.WebflowError({
|
|
386
442
|
message: _response.error.errorMessage,
|
|
@@ -389,7 +445,9 @@ class Assets {
|
|
|
389
445
|
});
|
|
390
446
|
}
|
|
391
447
|
/**
|
|
392
|
-
* Update an Asset
|
|
448
|
+
* Update an Asset
|
|
449
|
+
*
|
|
450
|
+
* Required scope | `assets:write`
|
|
393
451
|
*
|
|
394
452
|
* @param {string} assetId - Unique identifier for an Asset on a site
|
|
395
453
|
* @param {Webflow.AssetsUpdateRequest} request
|
|
@@ -402,28 +460,22 @@ class Assets {
|
|
|
402
460
|
* @throws {@link Webflow.InternalServerError}
|
|
403
461
|
*
|
|
404
462
|
* @example
|
|
405
|
-
* await client.assets.update("580e63fc8c9a982ac9b8b745"
|
|
406
|
-
* displayName: "bulldoze.png"
|
|
407
|
-
* })
|
|
463
|
+
* await client.assets.update("580e63fc8c9a982ac9b8b745")
|
|
408
464
|
*/
|
|
409
|
-
update(assetId, request, requestOptions) {
|
|
465
|
+
update(assetId, request = {}, requestOptions) {
|
|
410
466
|
var _a;
|
|
411
467
|
return __awaiter(this, void 0, void 0, function* () {
|
|
412
468
|
const _response = yield core.fetcher({
|
|
413
469
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `assets/${encodeURIComponent(assetId)}`),
|
|
414
470
|
method: "PATCH",
|
|
415
|
-
headers: {
|
|
416
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
417
|
-
"X-Fern-Language": "JavaScript",
|
|
418
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
419
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
420
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
421
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
422
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
423
|
-
},
|
|
471
|
+
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),
|
|
424
472
|
contentType: "application/json",
|
|
425
473
|
requestType: "json",
|
|
426
|
-
body: serializers.AssetsUpdateRequest.jsonOrThrow(request, {
|
|
474
|
+
body: serializers.AssetsUpdateRequest.jsonOrThrow(request, {
|
|
475
|
+
unrecognizedObjectKeys: "passthrough",
|
|
476
|
+
allowUnrecognizedUnionMembers: true,
|
|
477
|
+
allowUnrecognizedEnumValues: true,
|
|
478
|
+
}),
|
|
427
479
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
428
480
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
429
481
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -442,11 +494,23 @@ class Assets {
|
|
|
442
494
|
case 400:
|
|
443
495
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
444
496
|
case 401:
|
|
445
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
497
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
498
|
+
unrecognizedObjectKeys: "passthrough",
|
|
499
|
+
allowUnrecognizedUnionMembers: true,
|
|
500
|
+
allowUnrecognizedEnumValues: true,
|
|
501
|
+
skipValidation: true,
|
|
502
|
+
breadcrumbsPrefix: ["response"],
|
|
503
|
+
}));
|
|
446
504
|
case 404:
|
|
447
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
505
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
506
|
+
unrecognizedObjectKeys: "passthrough",
|
|
507
|
+
allowUnrecognizedUnionMembers: true,
|
|
508
|
+
allowUnrecognizedEnumValues: true,
|
|
509
|
+
skipValidation: true,
|
|
510
|
+
breadcrumbsPrefix: ["response"],
|
|
511
|
+
}));
|
|
448
512
|
case 429:
|
|
449
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
513
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
450
514
|
unrecognizedObjectKeys: "passthrough",
|
|
451
515
|
allowUnrecognizedUnionMembers: true,
|
|
452
516
|
allowUnrecognizedEnumValues: true,
|
|
@@ -454,7 +518,13 @@ class Assets {
|
|
|
454
518
|
breadcrumbsPrefix: ["response"],
|
|
455
519
|
}));
|
|
456
520
|
case 500:
|
|
457
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
521
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
522
|
+
unrecognizedObjectKeys: "passthrough",
|
|
523
|
+
allowUnrecognizedUnionMembers: true,
|
|
524
|
+
allowUnrecognizedEnumValues: true,
|
|
525
|
+
skipValidation: true,
|
|
526
|
+
breadcrumbsPrefix: ["response"],
|
|
527
|
+
}));
|
|
458
528
|
default:
|
|
459
529
|
throw new errors.WebflowError({
|
|
460
530
|
statusCode: _response.error.statusCode,
|
|
@@ -469,7 +539,7 @@ class Assets {
|
|
|
469
539
|
body: _response.error.rawBody,
|
|
470
540
|
});
|
|
471
541
|
case "timeout":
|
|
472
|
-
throw new errors.WebflowTimeoutError();
|
|
542
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /assets/{asset_id}.");
|
|
473
543
|
case "unknown":
|
|
474
544
|
throw new errors.WebflowError({
|
|
475
545
|
message: _response.error.errorMessage,
|
|
@@ -478,7 +548,9 @@ class Assets {
|
|
|
478
548
|
});
|
|
479
549
|
}
|
|
480
550
|
/**
|
|
481
|
-
* List Asset Folders within a given site
|
|
551
|
+
* List Asset Folders within a given site
|
|
552
|
+
*
|
|
553
|
+
* Required scope | `assets:read`
|
|
482
554
|
*
|
|
483
555
|
* @param {string} siteId - Unique identifier for a Site
|
|
484
556
|
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -498,15 +570,7 @@ class Assets {
|
|
|
498
570
|
const _response = yield core.fetcher({
|
|
499
571
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/asset_folders`),
|
|
500
572
|
method: "GET",
|
|
501
|
-
headers: {
|
|
502
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
503
|
-
"X-Fern-Language": "JavaScript",
|
|
504
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
505
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
506
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
507
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
508
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
509
|
-
},
|
|
573
|
+
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),
|
|
510
574
|
contentType: "application/json",
|
|
511
575
|
requestType: "json",
|
|
512
576
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -527,11 +591,23 @@ class Assets {
|
|
|
527
591
|
case 400:
|
|
528
592
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
529
593
|
case 401:
|
|
530
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
594
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
595
|
+
unrecognizedObjectKeys: "passthrough",
|
|
596
|
+
allowUnrecognizedUnionMembers: true,
|
|
597
|
+
allowUnrecognizedEnumValues: true,
|
|
598
|
+
skipValidation: true,
|
|
599
|
+
breadcrumbsPrefix: ["response"],
|
|
600
|
+
}));
|
|
531
601
|
case 404:
|
|
532
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
602
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
603
|
+
unrecognizedObjectKeys: "passthrough",
|
|
604
|
+
allowUnrecognizedUnionMembers: true,
|
|
605
|
+
allowUnrecognizedEnumValues: true,
|
|
606
|
+
skipValidation: true,
|
|
607
|
+
breadcrumbsPrefix: ["response"],
|
|
608
|
+
}));
|
|
533
609
|
case 429:
|
|
534
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
610
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
535
611
|
unrecognizedObjectKeys: "passthrough",
|
|
536
612
|
allowUnrecognizedUnionMembers: true,
|
|
537
613
|
allowUnrecognizedEnumValues: true,
|
|
@@ -539,7 +615,13 @@ class Assets {
|
|
|
539
615
|
breadcrumbsPrefix: ["response"],
|
|
540
616
|
}));
|
|
541
617
|
case 500:
|
|
542
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
618
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
619
|
+
unrecognizedObjectKeys: "passthrough",
|
|
620
|
+
allowUnrecognizedUnionMembers: true,
|
|
621
|
+
allowUnrecognizedEnumValues: true,
|
|
622
|
+
skipValidation: true,
|
|
623
|
+
breadcrumbsPrefix: ["response"],
|
|
624
|
+
}));
|
|
543
625
|
default:
|
|
544
626
|
throw new errors.WebflowError({
|
|
545
627
|
statusCode: _response.error.statusCode,
|
|
@@ -554,7 +636,7 @@ class Assets {
|
|
|
554
636
|
body: _response.error.rawBody,
|
|
555
637
|
});
|
|
556
638
|
case "timeout":
|
|
557
|
-
throw new errors.WebflowTimeoutError();
|
|
639
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/asset_folders.");
|
|
558
640
|
case "unknown":
|
|
559
641
|
throw new errors.WebflowError({
|
|
560
642
|
message: _response.error.errorMessage,
|
|
@@ -563,7 +645,9 @@ class Assets {
|
|
|
563
645
|
});
|
|
564
646
|
}
|
|
565
647
|
/**
|
|
566
|
-
* Create an Asset Folder within a given site
|
|
648
|
+
* Create an Asset Folder within a given site
|
|
649
|
+
*
|
|
650
|
+
* Required scope | `assets:write`
|
|
567
651
|
*
|
|
568
652
|
* @param {string} siteId - Unique identifier for a Site
|
|
569
653
|
* @param {Webflow.AssetsCreateFolderRequest} request
|
|
@@ -586,18 +670,14 @@ class Assets {
|
|
|
586
670
|
const _response = yield core.fetcher({
|
|
587
671
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/asset_folders`),
|
|
588
672
|
method: "POST",
|
|
589
|
-
headers: {
|
|
590
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
591
|
-
"X-Fern-Language": "JavaScript",
|
|
592
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
593
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
594
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
595
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
596
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
597
|
-
},
|
|
673
|
+
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),
|
|
598
674
|
contentType: "application/json",
|
|
599
675
|
requestType: "json",
|
|
600
|
-
body: serializers.AssetsCreateFolderRequest.jsonOrThrow(request, {
|
|
676
|
+
body: serializers.AssetsCreateFolderRequest.jsonOrThrow(request, {
|
|
677
|
+
unrecognizedObjectKeys: "passthrough",
|
|
678
|
+
allowUnrecognizedUnionMembers: true,
|
|
679
|
+
allowUnrecognizedEnumValues: true,
|
|
680
|
+
}),
|
|
601
681
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
602
682
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
603
683
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -616,11 +696,23 @@ class Assets {
|
|
|
616
696
|
case 400:
|
|
617
697
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
618
698
|
case 401:
|
|
619
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
699
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
700
|
+
unrecognizedObjectKeys: "passthrough",
|
|
701
|
+
allowUnrecognizedUnionMembers: true,
|
|
702
|
+
allowUnrecognizedEnumValues: true,
|
|
703
|
+
skipValidation: true,
|
|
704
|
+
breadcrumbsPrefix: ["response"],
|
|
705
|
+
}));
|
|
620
706
|
case 404:
|
|
621
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
707
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
708
|
+
unrecognizedObjectKeys: "passthrough",
|
|
709
|
+
allowUnrecognizedUnionMembers: true,
|
|
710
|
+
allowUnrecognizedEnumValues: true,
|
|
711
|
+
skipValidation: true,
|
|
712
|
+
breadcrumbsPrefix: ["response"],
|
|
713
|
+
}));
|
|
622
714
|
case 429:
|
|
623
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
715
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
624
716
|
unrecognizedObjectKeys: "passthrough",
|
|
625
717
|
allowUnrecognizedUnionMembers: true,
|
|
626
718
|
allowUnrecognizedEnumValues: true,
|
|
@@ -628,7 +720,13 @@ class Assets {
|
|
|
628
720
|
breadcrumbsPrefix: ["response"],
|
|
629
721
|
}));
|
|
630
722
|
case 500:
|
|
631
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
723
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
724
|
+
unrecognizedObjectKeys: "passthrough",
|
|
725
|
+
allowUnrecognizedUnionMembers: true,
|
|
726
|
+
allowUnrecognizedEnumValues: true,
|
|
727
|
+
skipValidation: true,
|
|
728
|
+
breadcrumbsPrefix: ["response"],
|
|
729
|
+
}));
|
|
632
730
|
default:
|
|
633
731
|
throw new errors.WebflowError({
|
|
634
732
|
statusCode: _response.error.statusCode,
|
|
@@ -643,7 +741,7 @@ class Assets {
|
|
|
643
741
|
body: _response.error.rawBody,
|
|
644
742
|
});
|
|
645
743
|
case "timeout":
|
|
646
|
-
throw new errors.WebflowTimeoutError();
|
|
744
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/asset_folders.");
|
|
647
745
|
case "unknown":
|
|
648
746
|
throw new errors.WebflowError({
|
|
649
747
|
message: _response.error.errorMessage,
|
|
@@ -652,7 +750,9 @@ class Assets {
|
|
|
652
750
|
});
|
|
653
751
|
}
|
|
654
752
|
/**
|
|
655
|
-
* Get details about a specific Asset Folder
|
|
753
|
+
* Get details about a specific Asset Folder
|
|
754
|
+
*
|
|
755
|
+
* Required scope | `assets:read`
|
|
656
756
|
*
|
|
657
757
|
* @param {string} assetFolderId - Unique identifier for an Asset Folder
|
|
658
758
|
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -672,15 +772,7 @@ class Assets {
|
|
|
672
772
|
const _response = yield core.fetcher({
|
|
673
773
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `asset_folders/${encodeURIComponent(assetFolderId)}`),
|
|
674
774
|
method: "GET",
|
|
675
|
-
headers: {
|
|
676
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
677
|
-
"X-Fern-Language": "JavaScript",
|
|
678
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
679
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
680
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
681
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
682
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
683
|
-
},
|
|
775
|
+
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),
|
|
684
776
|
contentType: "application/json",
|
|
685
777
|
requestType: "json",
|
|
686
778
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -701,11 +793,23 @@ class Assets {
|
|
|
701
793
|
case 400:
|
|
702
794
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
703
795
|
case 401:
|
|
704
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
796
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
797
|
+
unrecognizedObjectKeys: "passthrough",
|
|
798
|
+
allowUnrecognizedUnionMembers: true,
|
|
799
|
+
allowUnrecognizedEnumValues: true,
|
|
800
|
+
skipValidation: true,
|
|
801
|
+
breadcrumbsPrefix: ["response"],
|
|
802
|
+
}));
|
|
705
803
|
case 404:
|
|
706
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
804
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
805
|
+
unrecognizedObjectKeys: "passthrough",
|
|
806
|
+
allowUnrecognizedUnionMembers: true,
|
|
807
|
+
allowUnrecognizedEnumValues: true,
|
|
808
|
+
skipValidation: true,
|
|
809
|
+
breadcrumbsPrefix: ["response"],
|
|
810
|
+
}));
|
|
707
811
|
case 429:
|
|
708
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
812
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
709
813
|
unrecognizedObjectKeys: "passthrough",
|
|
710
814
|
allowUnrecognizedUnionMembers: true,
|
|
711
815
|
allowUnrecognizedEnumValues: true,
|
|
@@ -713,7 +817,13 @@ class Assets {
|
|
|
713
817
|
breadcrumbsPrefix: ["response"],
|
|
714
818
|
}));
|
|
715
819
|
case 500:
|
|
716
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
820
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
821
|
+
unrecognizedObjectKeys: "passthrough",
|
|
822
|
+
allowUnrecognizedUnionMembers: true,
|
|
823
|
+
allowUnrecognizedEnumValues: true,
|
|
824
|
+
skipValidation: true,
|
|
825
|
+
breadcrumbsPrefix: ["response"],
|
|
826
|
+
}));
|
|
717
827
|
default:
|
|
718
828
|
throw new errors.WebflowError({
|
|
719
829
|
statusCode: _response.error.statusCode,
|
|
@@ -728,7 +838,7 @@ class Assets {
|
|
|
728
838
|
body: _response.error.rawBody,
|
|
729
839
|
});
|
|
730
840
|
case "timeout":
|
|
731
|
-
throw new errors.WebflowTimeoutError();
|
|
841
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /asset_folders/{asset_folder_id}.");
|
|
732
842
|
case "unknown":
|
|
733
843
|
throw new errors.WebflowError({
|
|
734
844
|
message: _response.error.errorMessage,
|