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,10 @@ class Products {
|
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* Retrieve all products for a site.
|
|
53
|
+
* Retrieve all products for a site.
|
|
54
|
+
*
|
|
55
|
+
* Use `limit` and `offset` to page through all products with subsequent requests. All SKUs for each product
|
|
56
|
+
* will also be fetched and returned. The `limit`, `offset` and `total` values represent Products only and do not include any SKUs.
|
|
54
57
|
*
|
|
55
58
|
* Required scope | `ecommerce:read`
|
|
56
59
|
*
|
|
@@ -83,15 +86,7 @@ class Products {
|
|
|
83
86
|
const _response = yield core.fetcher({
|
|
84
87
|
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)}/products`),
|
|
85
88
|
method: "GET",
|
|
86
|
-
headers: {
|
|
87
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
88
|
-
"X-Fern-Language": "JavaScript",
|
|
89
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
90
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
91
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
92
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
93
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
94
|
-
},
|
|
89
|
+
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),
|
|
95
90
|
contentType: "application/json",
|
|
96
91
|
queryParameters: _queryParams,
|
|
97
92
|
requestType: "json",
|
|
@@ -113,15 +108,27 @@ class Products {
|
|
|
113
108
|
case 400:
|
|
114
109
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
115
110
|
case 401:
|
|
116
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
111
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
112
|
+
unrecognizedObjectKeys: "passthrough",
|
|
113
|
+
allowUnrecognizedUnionMembers: true,
|
|
114
|
+
allowUnrecognizedEnumValues: true,
|
|
115
|
+
skipValidation: true,
|
|
116
|
+
breadcrumbsPrefix: ["response"],
|
|
117
|
+
}));
|
|
117
118
|
case 403:
|
|
118
119
|
throw new Webflow.ForbiddenError(_response.error.body);
|
|
119
120
|
case 404:
|
|
120
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
121
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
122
|
+
unrecognizedObjectKeys: "passthrough",
|
|
123
|
+
allowUnrecognizedUnionMembers: true,
|
|
124
|
+
allowUnrecognizedEnumValues: true,
|
|
125
|
+
skipValidation: true,
|
|
126
|
+
breadcrumbsPrefix: ["response"],
|
|
127
|
+
}));
|
|
121
128
|
case 409:
|
|
122
129
|
throw new Webflow.ConflictError(_response.error.body);
|
|
123
130
|
case 429:
|
|
124
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
131
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
125
132
|
unrecognizedObjectKeys: "passthrough",
|
|
126
133
|
allowUnrecognizedUnionMembers: true,
|
|
127
134
|
allowUnrecognizedEnumValues: true,
|
|
@@ -129,7 +136,13 @@ class Products {
|
|
|
129
136
|
breadcrumbsPrefix: ["response"],
|
|
130
137
|
}));
|
|
131
138
|
case 500:
|
|
132
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
139
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
140
|
+
unrecognizedObjectKeys: "passthrough",
|
|
141
|
+
allowUnrecognizedUnionMembers: true,
|
|
142
|
+
allowUnrecognizedEnumValues: true,
|
|
143
|
+
skipValidation: true,
|
|
144
|
+
breadcrumbsPrefix: ["response"],
|
|
145
|
+
}));
|
|
133
146
|
default:
|
|
134
147
|
throw new errors.WebflowError({
|
|
135
148
|
statusCode: _response.error.statusCode,
|
|
@@ -144,7 +157,7 @@ class Products {
|
|
|
144
157
|
body: _response.error.rawBody,
|
|
145
158
|
});
|
|
146
159
|
case "timeout":
|
|
147
|
-
throw new errors.WebflowTimeoutError();
|
|
160
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/products.");
|
|
148
161
|
case "unknown":
|
|
149
162
|
throw new errors.WebflowError({
|
|
150
163
|
message: _response.error.errorMessage,
|
|
@@ -153,13 +166,19 @@ class Products {
|
|
|
153
166
|
});
|
|
154
167
|
}
|
|
155
168
|
/**
|
|
156
|
-
*
|
|
169
|
+
* Create a new product and SKU.
|
|
170
|
+
*
|
|
171
|
+
* When you create a product, you will always create a SKU, since a Product Item must have, at minimum, a single SKU.
|
|
157
172
|
*
|
|
158
|
-
*
|
|
173
|
+
* To create a Product with multiple SKUs - for example a T-shirt in sizes small, medium and large:
|
|
159
174
|
*
|
|
160
|
-
*
|
|
175
|
+
* - Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants).
|
|
176
|
+
* - A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`.
|
|
177
|
+
* - Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created.
|
|
178
|
+
* - In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue.
|
|
179
|
+
* - After you've created your product, you can create additional SKUs using the [Create SKU endpoint.](/data/reference/ecommerce/products-sk-us/create-sku)
|
|
161
180
|
*
|
|
162
|
-
* Upon creation, the default product type will be `Advanced
|
|
181
|
+
* Upon creation, the default product type will be `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer.
|
|
163
182
|
*
|
|
164
183
|
* Required scope | `ecommerce:write`
|
|
165
184
|
*
|
|
@@ -184,18 +203,14 @@ class Products {
|
|
|
184
203
|
const _response = yield core.fetcher({
|
|
185
204
|
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)}/products`),
|
|
186
205
|
method: "POST",
|
|
187
|
-
headers: {
|
|
188
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
189
|
-
"X-Fern-Language": "JavaScript",
|
|
190
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
191
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
192
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
193
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
194
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
195
|
-
},
|
|
206
|
+
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),
|
|
196
207
|
contentType: "application/json",
|
|
197
208
|
requestType: "json",
|
|
198
|
-
body: serializers.ProductSkuCreate.jsonOrThrow(request, {
|
|
209
|
+
body: serializers.ProductSkuCreate.jsonOrThrow(request, {
|
|
210
|
+
unrecognizedObjectKeys: "passthrough",
|
|
211
|
+
allowUnrecognizedUnionMembers: true,
|
|
212
|
+
allowUnrecognizedEnumValues: true,
|
|
213
|
+
}),
|
|
199
214
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
200
215
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
201
216
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -214,15 +229,27 @@ class Products {
|
|
|
214
229
|
case 400:
|
|
215
230
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
216
231
|
case 401:
|
|
217
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
232
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
233
|
+
unrecognizedObjectKeys: "passthrough",
|
|
234
|
+
allowUnrecognizedUnionMembers: true,
|
|
235
|
+
allowUnrecognizedEnumValues: true,
|
|
236
|
+
skipValidation: true,
|
|
237
|
+
breadcrumbsPrefix: ["response"],
|
|
238
|
+
}));
|
|
218
239
|
case 403:
|
|
219
240
|
throw new Webflow.ForbiddenError(_response.error.body);
|
|
220
241
|
case 404:
|
|
221
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
242
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
243
|
+
unrecognizedObjectKeys: "passthrough",
|
|
244
|
+
allowUnrecognizedUnionMembers: true,
|
|
245
|
+
allowUnrecognizedEnumValues: true,
|
|
246
|
+
skipValidation: true,
|
|
247
|
+
breadcrumbsPrefix: ["response"],
|
|
248
|
+
}));
|
|
222
249
|
case 409:
|
|
223
250
|
throw new Webflow.ConflictError(_response.error.body);
|
|
224
251
|
case 429:
|
|
225
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
252
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
226
253
|
unrecognizedObjectKeys: "passthrough",
|
|
227
254
|
allowUnrecognizedUnionMembers: true,
|
|
228
255
|
allowUnrecognizedEnumValues: true,
|
|
@@ -230,7 +257,13 @@ class Products {
|
|
|
230
257
|
breadcrumbsPrefix: ["response"],
|
|
231
258
|
}));
|
|
232
259
|
case 500:
|
|
233
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
260
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
261
|
+
unrecognizedObjectKeys: "passthrough",
|
|
262
|
+
allowUnrecognizedUnionMembers: true,
|
|
263
|
+
allowUnrecognizedEnumValues: true,
|
|
264
|
+
skipValidation: true,
|
|
265
|
+
breadcrumbsPrefix: ["response"],
|
|
266
|
+
}));
|
|
234
267
|
default:
|
|
235
268
|
throw new errors.WebflowError({
|
|
236
269
|
statusCode: _response.error.statusCode,
|
|
@@ -245,7 +278,7 @@ class Products {
|
|
|
245
278
|
body: _response.error.rawBody,
|
|
246
279
|
});
|
|
247
280
|
case "timeout":
|
|
248
|
-
throw new errors.WebflowTimeoutError();
|
|
281
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/products.");
|
|
249
282
|
case "unknown":
|
|
250
283
|
throw new errors.WebflowError({
|
|
251
284
|
message: _response.error.errorMessage,
|
|
@@ -254,7 +287,8 @@ class Products {
|
|
|
254
287
|
});
|
|
255
288
|
}
|
|
256
289
|
/**
|
|
257
|
-
* Retrieve a single product by its
|
|
290
|
+
* Retrieve a single product by its ID. All of its SKUs will also be
|
|
291
|
+
* retrieved.
|
|
258
292
|
*
|
|
259
293
|
* Required scope | `ecommerce:read`
|
|
260
294
|
*
|
|
@@ -279,15 +313,7 @@ class Products {
|
|
|
279
313
|
const _response = yield core.fetcher({
|
|
280
314
|
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)}/products/${encodeURIComponent(productId)}`),
|
|
281
315
|
method: "GET",
|
|
282
|
-
headers: {
|
|
283
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
284
|
-
"X-Fern-Language": "JavaScript",
|
|
285
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
286
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
287
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
288
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
289
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
290
|
-
},
|
|
316
|
+
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),
|
|
291
317
|
contentType: "application/json",
|
|
292
318
|
requestType: "json",
|
|
293
319
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -308,15 +334,27 @@ class Products {
|
|
|
308
334
|
case 400:
|
|
309
335
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
310
336
|
case 401:
|
|
311
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
337
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
338
|
+
unrecognizedObjectKeys: "passthrough",
|
|
339
|
+
allowUnrecognizedUnionMembers: true,
|
|
340
|
+
allowUnrecognizedEnumValues: true,
|
|
341
|
+
skipValidation: true,
|
|
342
|
+
breadcrumbsPrefix: ["response"],
|
|
343
|
+
}));
|
|
312
344
|
case 403:
|
|
313
345
|
throw new Webflow.ForbiddenError(_response.error.body);
|
|
314
346
|
case 404:
|
|
315
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
347
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
348
|
+
unrecognizedObjectKeys: "passthrough",
|
|
349
|
+
allowUnrecognizedUnionMembers: true,
|
|
350
|
+
allowUnrecognizedEnumValues: true,
|
|
351
|
+
skipValidation: true,
|
|
352
|
+
breadcrumbsPrefix: ["response"],
|
|
353
|
+
}));
|
|
316
354
|
case 409:
|
|
317
355
|
throw new Webflow.ConflictError(_response.error.body);
|
|
318
356
|
case 429:
|
|
319
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
357
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
320
358
|
unrecognizedObjectKeys: "passthrough",
|
|
321
359
|
allowUnrecognizedUnionMembers: true,
|
|
322
360
|
allowUnrecognizedEnumValues: true,
|
|
@@ -324,7 +362,13 @@ class Products {
|
|
|
324
362
|
breadcrumbsPrefix: ["response"],
|
|
325
363
|
}));
|
|
326
364
|
case 500:
|
|
327
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
365
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
366
|
+
unrecognizedObjectKeys: "passthrough",
|
|
367
|
+
allowUnrecognizedUnionMembers: true,
|
|
368
|
+
allowUnrecognizedEnumValues: true,
|
|
369
|
+
skipValidation: true,
|
|
370
|
+
breadcrumbsPrefix: ["response"],
|
|
371
|
+
}));
|
|
328
372
|
default:
|
|
329
373
|
throw new errors.WebflowError({
|
|
330
374
|
statusCode: _response.error.statusCode,
|
|
@@ -339,7 +383,7 @@ class Products {
|
|
|
339
383
|
body: _response.error.rawBody,
|
|
340
384
|
});
|
|
341
385
|
case "timeout":
|
|
342
|
-
throw new errors.WebflowTimeoutError();
|
|
386
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/products/{product_id}.");
|
|
343
387
|
case "unknown":
|
|
344
388
|
throw new errors.WebflowError({
|
|
345
389
|
message: _response.error.errorMessage,
|
|
@@ -348,7 +392,9 @@ class Products {
|
|
|
348
392
|
});
|
|
349
393
|
}
|
|
350
394
|
/**
|
|
351
|
-
*
|
|
395
|
+
* Update an existing Product.
|
|
396
|
+
*
|
|
397
|
+
* Updating an existing Product will set the product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer.
|
|
352
398
|
*
|
|
353
399
|
* Required scope | `ecommerce:write`
|
|
354
400
|
*
|
|
@@ -374,18 +420,14 @@ class Products {
|
|
|
374
420
|
const _response = yield core.fetcher({
|
|
375
421
|
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)}/products/${encodeURIComponent(productId)}`),
|
|
376
422
|
method: "PATCH",
|
|
377
|
-
headers: {
|
|
378
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
379
|
-
"X-Fern-Language": "JavaScript",
|
|
380
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
381
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
382
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
383
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
384
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
385
|
-
},
|
|
423
|
+
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),
|
|
386
424
|
contentType: "application/json",
|
|
387
425
|
requestType: "json",
|
|
388
|
-
body: serializers.ProductSkuUpdate.jsonOrThrow(request, {
|
|
426
|
+
body: serializers.ProductSkuUpdate.jsonOrThrow(request, {
|
|
427
|
+
unrecognizedObjectKeys: "passthrough",
|
|
428
|
+
allowUnrecognizedUnionMembers: true,
|
|
429
|
+
allowUnrecognizedEnumValues: true,
|
|
430
|
+
}),
|
|
389
431
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
390
432
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
391
433
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -404,15 +446,27 @@ class Products {
|
|
|
404
446
|
case 400:
|
|
405
447
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
406
448
|
case 401:
|
|
407
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
449
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
450
|
+
unrecognizedObjectKeys: "passthrough",
|
|
451
|
+
allowUnrecognizedUnionMembers: true,
|
|
452
|
+
allowUnrecognizedEnumValues: true,
|
|
453
|
+
skipValidation: true,
|
|
454
|
+
breadcrumbsPrefix: ["response"],
|
|
455
|
+
}));
|
|
408
456
|
case 403:
|
|
409
457
|
throw new Webflow.ForbiddenError(_response.error.body);
|
|
410
458
|
case 404:
|
|
411
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
459
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
460
|
+
unrecognizedObjectKeys: "passthrough",
|
|
461
|
+
allowUnrecognizedUnionMembers: true,
|
|
462
|
+
allowUnrecognizedEnumValues: true,
|
|
463
|
+
skipValidation: true,
|
|
464
|
+
breadcrumbsPrefix: ["response"],
|
|
465
|
+
}));
|
|
412
466
|
case 409:
|
|
413
467
|
throw new Webflow.ConflictError(_response.error.body);
|
|
414
468
|
case 429:
|
|
415
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
469
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
416
470
|
unrecognizedObjectKeys: "passthrough",
|
|
417
471
|
allowUnrecognizedUnionMembers: true,
|
|
418
472
|
allowUnrecognizedEnumValues: true,
|
|
@@ -420,7 +474,13 @@ class Products {
|
|
|
420
474
|
breadcrumbsPrefix: ["response"],
|
|
421
475
|
}));
|
|
422
476
|
case 500:
|
|
423
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
477
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
478
|
+
unrecognizedObjectKeys: "passthrough",
|
|
479
|
+
allowUnrecognizedUnionMembers: true,
|
|
480
|
+
allowUnrecognizedEnumValues: true,
|
|
481
|
+
skipValidation: true,
|
|
482
|
+
breadcrumbsPrefix: ["response"],
|
|
483
|
+
}));
|
|
424
484
|
default:
|
|
425
485
|
throw new errors.WebflowError({
|
|
426
486
|
statusCode: _response.error.statusCode,
|
|
@@ -435,7 +495,7 @@ class Products {
|
|
|
435
495
|
body: _response.error.rawBody,
|
|
436
496
|
});
|
|
437
497
|
case "timeout":
|
|
438
|
-
throw new errors.WebflowTimeoutError();
|
|
498
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /sites/{site_id}/products/{product_id}.");
|
|
439
499
|
case "unknown":
|
|
440
500
|
throw new errors.WebflowError({
|
|
441
501
|
message: _response.error.errorMessage,
|
|
@@ -444,9 +504,9 @@ class Products {
|
|
|
444
504
|
});
|
|
445
505
|
}
|
|
446
506
|
/**
|
|
447
|
-
* Create additional SKUs to
|
|
507
|
+
* Create additional SKUs to manage every [option and variant of your Product.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants)
|
|
448
508
|
*
|
|
449
|
-
* Creating
|
|
509
|
+
* Creating SKUs through the API will set the product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer.
|
|
450
510
|
*
|
|
451
511
|
* Required scope | `ecommerce:write`
|
|
452
512
|
*
|
|
@@ -474,18 +534,14 @@ class Products {
|
|
|
474
534
|
const _response = yield core.fetcher({
|
|
475
535
|
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)}/products/${encodeURIComponent(productId)}/skus`),
|
|
476
536
|
method: "POST",
|
|
477
|
-
headers: {
|
|
478
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
479
|
-
"X-Fern-Language": "JavaScript",
|
|
480
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
481
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
482
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
483
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
484
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
485
|
-
},
|
|
537
|
+
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),
|
|
486
538
|
contentType: "application/json",
|
|
487
539
|
requestType: "json",
|
|
488
|
-
body: serializers.ProductsCreateSkuRequest.jsonOrThrow(request, {
|
|
540
|
+
body: serializers.ProductsCreateSkuRequest.jsonOrThrow(request, {
|
|
541
|
+
unrecognizedObjectKeys: "passthrough",
|
|
542
|
+
allowUnrecognizedUnionMembers: true,
|
|
543
|
+
allowUnrecognizedEnumValues: true,
|
|
544
|
+
}),
|
|
489
545
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
490
546
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
491
547
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -504,15 +560,27 @@ class Products {
|
|
|
504
560
|
case 400:
|
|
505
561
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
506
562
|
case 401:
|
|
507
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
563
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
564
|
+
unrecognizedObjectKeys: "passthrough",
|
|
565
|
+
allowUnrecognizedUnionMembers: true,
|
|
566
|
+
allowUnrecognizedEnumValues: true,
|
|
567
|
+
skipValidation: true,
|
|
568
|
+
breadcrumbsPrefix: ["response"],
|
|
569
|
+
}));
|
|
508
570
|
case 403:
|
|
509
571
|
throw new Webflow.ForbiddenError(_response.error.body);
|
|
510
572
|
case 404:
|
|
511
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
573
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
574
|
+
unrecognizedObjectKeys: "passthrough",
|
|
575
|
+
allowUnrecognizedUnionMembers: true,
|
|
576
|
+
allowUnrecognizedEnumValues: true,
|
|
577
|
+
skipValidation: true,
|
|
578
|
+
breadcrumbsPrefix: ["response"],
|
|
579
|
+
}));
|
|
512
580
|
case 409:
|
|
513
581
|
throw new Webflow.ConflictError(_response.error.body);
|
|
514
582
|
case 429:
|
|
515
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
583
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
516
584
|
unrecognizedObjectKeys: "passthrough",
|
|
517
585
|
allowUnrecognizedUnionMembers: true,
|
|
518
586
|
allowUnrecognizedEnumValues: true,
|
|
@@ -520,7 +588,13 @@ class Products {
|
|
|
520
588
|
breadcrumbsPrefix: ["response"],
|
|
521
589
|
}));
|
|
522
590
|
case 500:
|
|
523
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
591
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
592
|
+
unrecognizedObjectKeys: "passthrough",
|
|
593
|
+
allowUnrecognizedUnionMembers: true,
|
|
594
|
+
allowUnrecognizedEnumValues: true,
|
|
595
|
+
skipValidation: true,
|
|
596
|
+
breadcrumbsPrefix: ["response"],
|
|
597
|
+
}));
|
|
524
598
|
default:
|
|
525
599
|
throw new errors.WebflowError({
|
|
526
600
|
statusCode: _response.error.statusCode,
|
|
@@ -535,7 +609,7 @@ class Products {
|
|
|
535
609
|
body: _response.error.rawBody,
|
|
536
610
|
});
|
|
537
611
|
case "timeout":
|
|
538
|
-
throw new errors.WebflowTimeoutError();
|
|
612
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/products/{product_id}/skus.");
|
|
539
613
|
case "unknown":
|
|
540
614
|
throw new errors.WebflowError({
|
|
541
615
|
message: _response.error.errorMessage,
|
|
@@ -544,7 +618,9 @@ class Products {
|
|
|
544
618
|
});
|
|
545
619
|
}
|
|
546
620
|
/**
|
|
547
|
-
*
|
|
621
|
+
* Update a specified SKU.
|
|
622
|
+
*
|
|
623
|
+
* Updating an existing SKU will set the Product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer.
|
|
548
624
|
*
|
|
549
625
|
* Required scope | `ecommerce:write`
|
|
550
626
|
*
|
|
@@ -573,18 +649,14 @@ class Products {
|
|
|
573
649
|
const _response = yield core.fetcher({
|
|
574
650
|
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)}/products/${encodeURIComponent(productId)}/skus/${encodeURIComponent(skuId)}`),
|
|
575
651
|
method: "PATCH",
|
|
576
|
-
headers: {
|
|
577
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
578
|
-
"X-Fern-Language": "JavaScript",
|
|
579
|
-
"X-Fern-SDK-Name": "webflow-api",
|
|
580
|
-
"X-Fern-SDK-Version": "2.4.0",
|
|
581
|
-
"User-Agent": "webflow-api/2.4.0",
|
|
582
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
583
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
584
|
-
},
|
|
652
|
+
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),
|
|
585
653
|
contentType: "application/json",
|
|
586
654
|
requestType: "json",
|
|
587
|
-
body: serializers.ProductsUpdateSkuRequest.jsonOrThrow(request, {
|
|
655
|
+
body: serializers.ProductsUpdateSkuRequest.jsonOrThrow(request, {
|
|
656
|
+
unrecognizedObjectKeys: "passthrough",
|
|
657
|
+
allowUnrecognizedUnionMembers: true,
|
|
658
|
+
allowUnrecognizedEnumValues: true,
|
|
659
|
+
}),
|
|
588
660
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
589
661
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
590
662
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -603,15 +675,27 @@ class Products {
|
|
|
603
675
|
case 400:
|
|
604
676
|
throw new Webflow.BadRequestError(_response.error.body);
|
|
605
677
|
case 401:
|
|
606
|
-
throw new Webflow.UnauthorizedError(_response.error.body
|
|
678
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
679
|
+
unrecognizedObjectKeys: "passthrough",
|
|
680
|
+
allowUnrecognizedUnionMembers: true,
|
|
681
|
+
allowUnrecognizedEnumValues: true,
|
|
682
|
+
skipValidation: true,
|
|
683
|
+
breadcrumbsPrefix: ["response"],
|
|
684
|
+
}));
|
|
607
685
|
case 403:
|
|
608
686
|
throw new Webflow.ForbiddenError(_response.error.body);
|
|
609
687
|
case 404:
|
|
610
|
-
throw new Webflow.NotFoundError(_response.error.body
|
|
688
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
689
|
+
unrecognizedObjectKeys: "passthrough",
|
|
690
|
+
allowUnrecognizedUnionMembers: true,
|
|
691
|
+
allowUnrecognizedEnumValues: true,
|
|
692
|
+
skipValidation: true,
|
|
693
|
+
breadcrumbsPrefix: ["response"],
|
|
694
|
+
}));
|
|
611
695
|
case 409:
|
|
612
696
|
throw new Webflow.ConflictError(_response.error.body);
|
|
613
697
|
case 429:
|
|
614
|
-
throw new Webflow.TooManyRequestsError(serializers.
|
|
698
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
615
699
|
unrecognizedObjectKeys: "passthrough",
|
|
616
700
|
allowUnrecognizedUnionMembers: true,
|
|
617
701
|
allowUnrecognizedEnumValues: true,
|
|
@@ -619,7 +703,13 @@ class Products {
|
|
|
619
703
|
breadcrumbsPrefix: ["response"],
|
|
620
704
|
}));
|
|
621
705
|
case 500:
|
|
622
|
-
throw new Webflow.InternalServerError(_response.error.body
|
|
706
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
707
|
+
unrecognizedObjectKeys: "passthrough",
|
|
708
|
+
allowUnrecognizedUnionMembers: true,
|
|
709
|
+
allowUnrecognizedEnumValues: true,
|
|
710
|
+
skipValidation: true,
|
|
711
|
+
breadcrumbsPrefix: ["response"],
|
|
712
|
+
}));
|
|
623
713
|
default:
|
|
624
714
|
throw new errors.WebflowError({
|
|
625
715
|
statusCode: _response.error.statusCode,
|
|
@@ -634,7 +724,7 @@ class Products {
|
|
|
634
724
|
body: _response.error.rawBody,
|
|
635
725
|
});
|
|
636
726
|
case "timeout":
|
|
637
|
-
throw new errors.WebflowTimeoutError();
|
|
727
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /sites/{site_id}/products/{product_id}/skus/{sku_id}.");
|
|
638
728
|
case "unknown":
|
|
639
729
|
throw new errors.WebflowError({
|
|
640
730
|
message: _response.error.errorMessage,
|
|
@@ -16,13 +16,24 @@ export declare namespace Scripts {
|
|
|
16
16
|
maxRetries?: number;
|
|
17
17
|
/** A hook to abort the request. */
|
|
18
18
|
abortSignal?: AbortSignal;
|
|
19
|
+
/** Additional headers to include in the request. */
|
|
20
|
+
headers?: Record<string, string>;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
export declare class Scripts {
|
|
22
24
|
protected readonly _options: Scripts.Options;
|
|
23
25
|
constructor(_options: Scripts.Options);
|
|
24
26
|
/**
|
|
25
|
-
* List of scripts registered to a Site.
|
|
27
|
+
* List of scripts registered to a Site.
|
|
28
|
+
*
|
|
29
|
+
* In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered
|
|
30
|
+
* to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate
|
|
31
|
+
* `custom_code` endpoints.
|
|
32
|
+
* Additionally, Scripts can be remotely hosted, or registered as inline snippets.
|
|
33
|
+
*
|
|
34
|
+
* <blockquote class="callout callout_info" theme="📘">Access to this endpoint requires a bearer token from a <a href="https://developers.webflow.com/data/docs/getting-started-data-clients">Data Client App</a>.</blockquote>
|
|
35
|
+
*
|
|
36
|
+
* Required scope | `custom_code:read`
|
|
26
37
|
*
|
|
27
38
|
* @param {string} siteId - Unique identifier for a Site
|
|
28
39
|
* @param {Scripts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -38,7 +49,16 @@ export declare class Scripts {
|
|
|
38
49
|
*/
|
|
39
50
|
list(siteId: string, requestOptions?: Scripts.RequestOptions): Promise<Webflow.RegisteredScriptList>;
|
|
40
51
|
/**
|
|
41
|
-
* Add a script to a Site's Custom Code registry.
|
|
52
|
+
* Add a script to a Site's Custom Code registry.
|
|
53
|
+
*
|
|
54
|
+
* In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered
|
|
55
|
+
* to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate
|
|
56
|
+
* `custom_code` endpoints.
|
|
57
|
+
* Additionally, Scripts can be remotely hosted, or registered as inline snippets.
|
|
58
|
+
*
|
|
59
|
+
* <blockquote class="callout callout_info" theme="📘">Access to this endpoint requires a bearer token from a <a href="https://developers.webflow.com/data/docs/getting-started-data-clients">Data Client App</a>.</blockquote>
|
|
60
|
+
*
|
|
61
|
+
* Required scope | `custom_code:write`
|
|
42
62
|
*
|
|
43
63
|
* @param {string} siteId - Unique identifier for a Site
|
|
44
64
|
* @param {Webflow.CustomCodeHostedRequest} request
|
|
@@ -60,7 +80,15 @@ export declare class Scripts {
|
|
|
60
80
|
*/
|
|
61
81
|
registerHosted(siteId: string, request: Webflow.CustomCodeHostedRequest, requestOptions?: Scripts.RequestOptions): Promise<Webflow.CustomCodeHostedResponse>;
|
|
62
82
|
/**
|
|
63
|
-
* Add a script to a Site's Custom Code registry. Inline scripts can be between 1 and 2000 characters.
|
|
83
|
+
* Add a script to a Site's Custom Code registry. Inline scripts can be between 1 and 2000 characters.
|
|
84
|
+
*
|
|
85
|
+
* In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered
|
|
86
|
+
* to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate
|
|
87
|
+
* `custom_code` endpoints.
|
|
88
|
+
*
|
|
89
|
+
* <blockquote class="callout callout_info" theme="📘">Access to this endpoint requires a bearer token from a <a href="https://developers.webflow.com/data/docs/getting-started-data-clients">Data Client App</a>.</blockquote>
|
|
90
|
+
*
|
|
91
|
+
* Required scope | `custom_code:write`
|
|
64
92
|
*
|
|
65
93
|
* @param {string} siteId - Unique identifier for a Site
|
|
66
94
|
* @param {Webflow.CustomCodeInlineRequest} request
|