From 5ce7d69016e357bc3ce5fb5a188da7a857f93dd5 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:53:56 +0000 Subject: [PATCH] SDK regeneration --- .github/workflows/ci.yml | 37 +- .npmignore | 4 +- .prettierrc.yml | 2 - biome.json | 74 + jest.config.mjs | 29 +- package.json | 31 +- reference.md | 2192 +++---- src/BaseClient.ts | 30 + src/Client.ts | 58 +- src/api/errors/BadRequestError.ts | 6 +- src/api/errors/ConflictError.ts | 6 +- src/api/errors/ForbiddenError.ts | 6 +- src/api/errors/InternalServerError.ts | 8 +- src/api/errors/NotFoundError.ts | 8 +- src/api/errors/TooManyRequestsError.ts | 8 +- src/api/errors/UnauthorizedError.ts | 8 +- src/api/errors/index.ts | 8 +- src/api/index.ts | 2 +- .../resources/accessGroups/client/Client.ts | 61 +- .../resources/accessGroups/client/index.ts | 1 - .../requests/AccessGroupsListRequest.ts | 14 +- .../accessGroups/client/requests/index.ts | 2 +- src/api/resources/accessGroups/index.ts | 2 +- .../types/AccessGroupsListRequestSort.ts | 13 +- src/api/resources/assets/client/Client.ts | 199 +- src/api/resources/assets/client/index.ts | 1 - .../requests/AssetsCreateFolderRequest.ts | 4 +- .../client/requests/AssetsCreateRequest.ts | 4 +- .../client/requests/AssetsListRequest.ts | 12 +- .../client/requests/AssetsUpdateRequest.ts | 4 +- .../resources/assets/client/requests/index.ts | 8 +- .../resources/collections/client/Client.ts | 114 +- src/api/resources/collections/client/index.ts | 1 - .../requests/CollectionsCreateRequest.ts | 6 +- .../collections/client/requests/index.ts | 2 +- src/api/resources/collections/index.ts | 2 +- .../resources/fields/client/Client.ts | 94 +- .../resources/fields/client/index.ts | 1 - .../fields/client/requests/FieldUpdate.ts | 4 +- .../resources/fields/client/requests/index.ts | 2 +- .../resources/collections/resources/index.ts | 4 +- .../resources/items/client/Client.ts | 645 ++- .../resources/items/client/index.ts | 1 - .../CreateBulkCollectionItemRequestBody.ts | 10 +- .../requests/ItemsCreateItemLiveRequest.ts | 54 +- .../client/requests/ItemsCreateItemRequest.ts | 54 +- .../requests/ItemsDeleteItemLiveRequest.ts | 8 +- .../client/requests/ItemsDeleteItemRequest.ts | 8 +- .../requests/ItemsDeleteItemsLiveRequest.ts | 6 +- .../requests/ItemsDeleteItemsRequest.ts | 6 +- .../requests/ItemsGetItemLiveRequest.ts | 8 +- .../client/requests/ItemsGetItemRequest.ts | 8 +- .../requests/ItemsListItemsLiveRequest.ts | 38 +- .../client/requests/ItemsListItemsRequest.ts | 38 +- .../requests/ItemsUpdateItemLiveRequest.ts | 46 +- .../client/requests/ItemsUpdateItemRequest.ts | 46 +- .../requests/ItemsUpdateItemsLiveRequest.ts | 54 +- .../requests/ItemsUpdateItemsRequest.ts | 30 +- .../resources/items/client/requests/index.ts | 30 +- .../collections/resources/items/index.ts | 2 +- ...eBulkCollectionItemRequestBodyFieldData.ts | 6 +- ...kCollectionItemRequestBodyFieldDataItem.ts | 4 +- .../resources/items/types/ItemIDs.ts | 4 +- .../items/types/ItemIDsWithLocales.ts | 6 +- .../types/ItemsCreateItemLiveRequestBody.ts | 6 +- .../items/types/ItemsCreateItemRequestBody.ts | 6 +- .../ItemsDeleteItemsLiveRequestItemsItem.ts | 4 +- .../types/ItemsDeleteItemsRequestItemsItem.ts | 4 +- .../types/ItemsListItemsLiveRequestSortBy.ts | 7 +- .../ItemsListItemsLiveRequestSortOrder.ts | 7 +- .../types/ItemsListItemsRequestSortBy.ts | 7 +- .../types/ItemsListItemsRequestSortOrder.ts | 7 +- .../items/types/ItemsPublishItemRequest.ts | 6 +- .../ItemsPublishItemRequestItemsItemsItem.ts | 4 +- .../items/types/ItemsPublishItemResponse.ts | 4 +- .../items/types/ItemsUpdateItemsResponse.ts | 6 +- .../resources/items/types/MultipleItems.ts | 6 +- .../items/types/MultipleLiveItems.ts | 6 +- .../resources/items/types/SingleCmsItem.ts | 4 +- .../resources/items/types/index.ts | 26 +- src/api/resources/components/client/Client.ts | 169 +- src/api/resources/components/client/index.ts | 1 - .../client/requests/ComponentDomWrite.ts | 10 +- .../requests/ComponentPropertiesWrite.ts | 10 +- .../requests/ComponentsGetContentRequest.ts | 16 +- .../ComponentsGetPropertiesRequest.ts | 16 +- .../client/requests/ComponentsListRequest.ts | 16 +- .../components/client/requests/index.ts | 10 +- src/api/resources/components/index.ts | 2 +- .../types/ComponentDomWriteNodesItem.ts | 6 +- .../ComponentPropertiesWritePropertiesItem.ts | 4 +- .../types/ComponentsUpdateContentResponse.ts | 4 +- .../ComponentsUpdatePropertiesResponse.ts | 4 +- src/api/resources/components/types/index.ts | 2 +- src/api/resources/ecommerce/client/Client.ts | 54 +- src/api/resources/forms/client/Client.ts | 164 +- src/api/resources/forms/client/index.ts | 1 - .../forms/client/requests/FormsListRequest.ts | 12 +- .../requests/FormsListSubmissionsRequest.ts | 12 +- .../requests/FormsUpdateSubmissionRequest.ts | 4 +- .../resources/forms/client/requests/index.ts | 6 +- src/api/resources/index.ts | 58 +- src/api/resources/inventory/client/Client.ts | 74 +- src/api/resources/inventory/client/index.ts | 1 - .../client/requests/InventoryUpdateRequest.ts | 6 +- .../inventory/client/requests/index.ts | 2 +- src/api/resources/inventory/index.ts | 2 +- .../types/EcommInventoryChangedPayload.ts | 6 +- .../InventoryUpdateRequestInventoryType.ts | 11 +- src/api/resources/inventory/types/index.ts | 2 +- src/api/resources/orders/client/Client.ts | 161 +- src/api/resources/orders/client/index.ts | 1 - .../client/requests/OrdersListRequest.ts | 18 +- .../client/requests/OrdersRefundRequest.ts | 6 +- .../requests/OrdersUpdateFulfillRequest.ts | 4 +- .../client/requests/OrdersUpdateRequest.ts | 4 +- .../resources/orders/client/requests/index.ts | 8 +- src/api/resources/orders/index.ts | 2 +- .../orders/types/OrdersListRequestStatus.ts | 12 +- .../orders/types/OrdersRefundRequestReason.ts | 10 +- src/api/resources/pages/client/Client.ts | 157 +- src/api/resources/pages/client/index.ts | 1 - .../pages/client/requests/PageDomWrite.ts | 10 +- .../client/requests/PageMetadataWrite.ts | 6 +- .../client/requests/PagesGetContentRequest.ts | 12 +- .../requests/PagesGetMetadataRequest.ts | 4 +- .../pages/client/requests/PagesListRequest.ts | 12 +- .../resources/pages/client/requests/index.ts | 10 +- src/api/resources/pages/index.ts | 2 +- .../pages/resources/scripts/client/Client.ts | 94 +- .../pages/types/PageDomWriteNodesItem.ts | 6 +- .../pages/types/PageMetadataWriteOpenGraph.ts | 4 +- .../pages/types/PageMetadataWriteSeo.ts | 4 +- .../types/UpdateStaticContentResponse.ts | 4 +- src/api/resources/pages/types/index.ts | 4 +- src/api/resources/products/client/Client.ts | 159 +- src/api/resources/products/client/index.ts | 1 - .../client/requests/ProductSkuCreate.ts | 6 +- .../client/requests/ProductSkuUpdate.ts | 6 +- .../requests/ProductsCreateSkuRequest.ts | 6 +- .../client/requests/ProductsListRequest.ts | 12 +- .../requests/ProductsUpdateSkuRequest.ts | 6 +- .../products/client/requests/index.ts | 10 +- src/api/resources/products/index.ts | 2 +- .../products/types/ProductSkuCreateProduct.ts | 6 +- .../products/types/ProductSkuCreateSku.ts | 6 +- .../types/ProductsCreateSkuResponse.ts | 6 +- src/api/resources/scripts/client/Client.ts | 94 +- src/api/resources/scripts/client/index.ts | 1 - .../requests/CustomCodeHostedRequest.ts | 4 +- .../requests/CustomCodeInlineRequest.ts | 4 +- .../scripts/client/requests/index.ts | 4 +- src/api/resources/sites/client/Client.ts | 182 +- src/api/resources/sites/client/index.ts | 1 - .../client/requests/SitesCreateRequest.ts | 4 +- .../client/requests/SitesPublishRequest.ts | 4 +- .../client/requests/SitesUpdateRequest.ts | 4 +- .../resources/sites/client/requests/index.ts | 6 +- src/api/resources/sites/index.ts | 4 +- .../resources/activityLogs/client/Client.ts | 59 +- .../resources/activityLogs/client/index.ts | 1 - .../requests/ActivityLogsListRequest.ts | 12 +- .../activityLogs/client/requests/index.ts | 2 +- .../sites/resources/comments/client/Client.ts | 138 +- .../sites/resources/comments/client/index.ts | 1 - .../CommentsGetCommentThreadRequest.ts | 22 +- .../CommentsListCommentRepliesRequest.ts | 22 +- .../CommentsListCommentThreadsRequest.ts | 22 +- .../comments/client/requests/index.ts | 6 +- .../sites/resources/comments/index.ts | 2 +- .../CommentsGetCommentThreadRequestSortBy.ts | 7 +- ...ommentsGetCommentThreadRequestSortOrder.ts | 7 +- ...CommentsListCommentRepliesRequestSortBy.ts | 7 +- ...mentsListCommentRepliesRequestSortOrder.ts | 7 +- ...CommentsListCommentThreadsRequestSortBy.ts | 7 +- ...mentsListCommentThreadsRequestSortOrder.ts | 7 +- .../sites/resources/comments/types/index.ts | 4 +- .../sites/resources/forms/client/Client.ts | 146 +- .../sites/resources/forms/client/index.ts | 1 - .../FormsListSubmissionsBySiteRequest.ts | 16 +- .../requests/FormsListSubmissionsRequest.ts | 12 +- .../requests/FormsUpdateSubmissionRequest.ts | 4 +- .../resources/forms/client/requests/index.ts | 6 +- src/api/resources/sites/resources/index.ts | 18 +- .../sites/resources/plans/client/Client.ts | 54 +- .../resources/redirects/client/Client.ts | 114 +- .../resources/robotsTxt/client/Client.ts | 114 +- .../sites/resources/scripts/client/Client.ts | 119 +- .../sites/resources/scripts/client/index.ts | 1 - .../ScriptsListCustomCodeBlocksRequest.ts | 12 +- .../scripts/client/requests/index.ts | 2 +- .../resources/wellKnown/client/Client.ts | 74 +- .../sites/resources/wellKnown/client/index.ts | 1 - .../client/requests/WellKnownDeleteRequest.ts | 4 +- .../client/requests/WellKnownFile.ts | 6 +- .../wellKnown/client/requests/index.ts | 4 +- .../sites/resources/wellKnown/index.ts | 2 +- .../types/WellKnownFileContentType.ts | 10 +- .../sites/types/SitesPublishResponse.ts | 6 +- src/api/resources/token/client/Client.ts | 70 +- src/api/resources/users/client/Client.ts | 141 +- src/api/resources/users/client/index.ts | 1 - .../client/requests/UsersInviteRequest.ts | 4 +- .../users/client/requests/UsersListRequest.ts | 14 +- .../resources/users/client/requests/index.ts | 4 +- src/api/resources/users/index.ts | 2 +- .../users/types/UserAccountAddedPayload.ts | 6 +- .../types/UserAccountAddedPayloadPayload.ts | 6 +- .../UserAccountAddedPayloadPayloadData.ts | 4 +- .../users/types/UserAccountDeletedPayload.ts | 6 +- .../types/UserAccountDeletedPayloadPayload.ts | 6 +- .../UserAccountDeletedPayloadPayloadData.ts | 4 +- .../users/types/UserAccountUpdatedPayload.ts | 6 +- .../types/UserAccountUpdatedPayloadPayload.ts | 6 +- .../UserAccountUpdatedPayloadPayloadData.ts | 4 +- .../users/types/UsersListRequestSort.ts | 36 +- src/api/resources/users/types/index.ts | 16 +- src/api/resources/webhooks/client/Client.ts | 114 +- src/api/resources/workspaces/client/Client.ts | 16 +- src/api/resources/workspaces/index.ts | 2 +- .../resources/auditLogs/client/Client.ts | 79 +- .../resources/auditLogs/client/index.ts | 1 - .../AuditLogsGetWorkspaceAuditLogsRequest.ts | 30 +- .../auditLogs/client/requests/index.ts | 2 +- .../workspaces/resources/auditLogs/index.ts | 2 +- ...gsGetWorkspaceAuditLogsRequestEventType.ts | 12 +- ...gsGetWorkspaceAuditLogsRequestSortOrder.ts | 7 +- .../resources/auditLogs/types/index.ts | 2 +- .../resources/workspaces/resources/index.ts | 2 +- src/api/types/AccessGroup.ts | 4 +- src/api/types/AccessGroupList.ts | 6 +- src/api/types/Application.ts | 4 +- src/api/types/Asset.ts | 6 +- src/api/types/AssetFolder.ts | 4 +- src/api/types/AssetFolderList.ts | 6 +- src/api/types/AssetUpload.ts | 6 +- src/api/types/AssetUploadUploadDetails.ts | 4 +- src/api/types/AssetVariant.ts | 4 +- src/api/types/Assets.ts | 6 +- src/api/types/Authorization.ts | 6 +- src/api/types/AuthorizationAuthorization.ts | 6 +- .../AuthorizationAuthorizationAuthorizedTo.ts | 4 +- src/api/types/AuthorizedUser.ts | 4 +- src/api/types/BadRequestErrorBody.ts | 6 +- src/api/types/BulkCollectionItem.ts | 6 +- src/api/types/BulkCollectionItemFieldData.ts | 4 +- src/api/types/Collection.ts | 6 +- src/api/types/CollectionItem.ts | 6 +- src/api/types/CollectionItemChanged.ts | 6 +- src/api/types/CollectionItemCreated.ts | 6 +- src/api/types/CollectionItemFieldData.ts | 4 +- src/api/types/CollectionItemList.ts | 6 +- .../types/CollectionItemListNoPagination.ts | 6 +- src/api/types/CollectionItemListPagination.ts | 4 +- src/api/types/CollectionItemPatchSingle.ts | 6 +- .../CollectionItemPatchSingleFieldData.ts | 4 +- src/api/types/CollectionItemPostSingle.ts | 6 +- .../CollectionItemPostSingleFieldData.ts | 4 +- src/api/types/CollectionItemPublished.ts | 6 +- src/api/types/CollectionItemRemoved.ts | 6 +- src/api/types/CollectionItemRemovedPayload.ts | 6 +- .../CollectionItemRemovedPayloadFieldData.ts | 4 +- src/api/types/CollectionItemUnpublished.ts | 6 +- .../types/CollectionItemUnpublishedPayload.ts | 6 +- ...llectionItemUnpublishedPayloadFieldData.ts | 4 +- src/api/types/CollectionItemWithIdInput.ts | 6 +- .../CollectionItemWithIdInputFieldData.ts | 4 +- src/api/types/CollectionList.ts | 6 +- src/api/types/CollectionListArrayItem.ts | 4 +- src/api/types/Comment.ts | 6 +- src/api/types/CommentPayload.ts | 6 +- src/api/types/CommentPayloadAuthor.ts | 4 +- .../types/CommentPayloadMentionedUsersItem.ts | 4 +- src/api/types/CommentReply.ts | 6 +- src/api/types/CommentReplyAuthor.ts | 4 +- src/api/types/CommentReplyList.ts | 6 +- src/api/types/CommentReplyListPagination.ts | 4 +- .../types/CommentReplyMentionedUsersItem.ts | 4 +- src/api/types/CommentThread.ts | 6 +- src/api/types/CommentThreadAuthor.ts | 4 +- src/api/types/CommentThreadList.ts | 6 +- src/api/types/CommentThreadListPagination.ts | 4 +- .../types/CommentThreadMentionedUsersItem.ts | 4 +- src/api/types/Component.ts | 4 +- src/api/types/ComponentDom.ts | 6 +- ...onentInstanceNodePropertyOverridesWrite.ts | 6 +- ...ertyOverridesWritePropertyOverridesItem.ts | 4 +- src/api/types/ComponentList.ts | 6 +- src/api/types/ComponentNode.ts | 6 +- src/api/types/ComponentProperties.ts | 6 +- src/api/types/ComponentProperty.ts | 6 +- src/api/types/ComponentPropertyType.ts | 10 +- src/api/types/Conflict.ts | 4 +- src/api/types/ConflictErrorBody.ts | 6 +- src/api/types/CustomCodeBlock.ts | 6 +- src/api/types/CustomCodeBlockType.ts | 10 +- src/api/types/CustomCodeHostedResponse.ts | 4 +- src/api/types/CustomCodeInlineResponse.ts | 4 +- src/api/types/CustomRole.ts | 4 +- src/api/types/CustomRoleAuditLogItem.ts | 6 +- .../CustomRoleAuditLogItemEventSubType.ts | 7 +- src/api/types/Dom.ts | 6 +- src/api/types/Domain.ts | 4 +- src/api/types/Domains.ts | 6 +- src/api/types/DuplicateUserEmail.ts | 4 +- src/api/types/EcommerceSettings.ts | 4 +- src/api/types/ErrorCode.ts | 39 +- src/api/types/Error_.ts | 6 +- src/api/types/Field.ts | 6 +- src/api/types/FieldCreate.ts | 6 +- src/api/types/FieldType.ts | 27 +- src/api/types/FieldValidations.ts | 6 +- .../FieldValidationsAdditionalProperties.ts | 6 +- ...dditionalPropertiesAdditionalProperties.ts | 4 +- src/api/types/ForbiddenErrorBody.ts | 6 +- src/api/types/Form.ts | 6 +- src/api/types/FormField.ts | 6 +- src/api/types/FormFieldValue.ts | 6 +- src/api/types/FormFieldValueType.ts | 10 +- src/api/types/FormList.ts | 6 +- src/api/types/FormResponseSettings.ts | 4 +- src/api/types/FormSubmission.ts | 4 +- src/api/types/FormSubmissionList.ts | 6 +- src/api/types/FormSubmissionTrigger.ts | 6 +- src/api/types/FormSubmissionTriggerPayload.ts | 6 +- .../FormSubmissionTriggerPayloadSchemaItem.ts | 6 +- ...issionTriggerPayloadSchemaItemFieldType.ts | 16 +- src/api/types/ImageNode.ts | 6 +- src/api/types/ImageNodeImage.ts | 4 +- src/api/types/InvalidDomain.ts | 4 +- src/api/types/InvalidScopes.ts | 4 +- src/api/types/InventoryItem.ts | 6 +- src/api/types/InventoryItemInventoryType.ts | 10 +- .../ItemsListItemsLiveRequestLastPublished.ts | 4 +- .../ItemsListItemsRequestLastPublished.ts | 4 +- src/api/types/ListCustomCodeBlocks.ts | 6 +- src/api/types/Locale.ts | 4 +- src/api/types/Locales.ts | 6 +- src/api/types/Metadata.ts | 6 +- src/api/types/MetadataOptionsItem.ts | 4 +- src/api/types/NewOrder.ts | 6 +- src/api/types/NoDomains.ts | 4 +- src/api/types/Node.ts | 6 +- src/api/types/NotEnterprisePlanSite.ts | 4 +- src/api/types/NotEnterprisePlanWorkspace.ts | 4 +- src/api/types/OptionField.ts | 6 +- src/api/types/Order.ts | 6 +- src/api/types/OrderAddress.ts | 6 +- src/api/types/OrderAddressJapanType.ts | 10 +- src/api/types/OrderAddressType.ts | 10 +- src/api/types/OrderBillingAddress.ts | 6 +- src/api/types/OrderBillingAddressJapanType.ts | 11 +- src/api/types/OrderBillingAddressType.ts | 10 +- src/api/types/OrderCustomerInfo.ts | 4 +- src/api/types/OrderDisputeLastStatus.ts | 18 +- src/api/types/OrderDownloadFilesItem.ts | 4 +- src/api/types/OrderList.ts | 6 +- src/api/types/OrderMetadata.ts | 4 +- src/api/types/OrderPrice.ts | 4 +- src/api/types/OrderPurchasedItem.ts | 6 +- .../types/OrderPurchasedItemVariantImage.ts | 6 +- .../OrderPurchasedItemVariantImageFile.ts | 6 +- ...rchasedItemVariantImageFileVariantsItem.ts | 4 +- src/api/types/OrderShippingAddress.ts | 6 +- .../types/OrderShippingAddressJapanType.ts | 11 +- src/api/types/OrderShippingAddressType.ts | 10 +- src/api/types/OrderStatus.ts | 10 +- src/api/types/OrderTotals.ts | 6 +- src/api/types/OrderTotalsExtrasItem.ts | 6 +- src/api/types/OrderTotalsExtrasItemType.ts | 10 +- src/api/types/Page.ts | 6 +- src/api/types/PageCreatedWebhook.ts | 6 +- src/api/types/PageCreatedWebhookPayload.ts | 4 +- src/api/types/PageDeletedWebhook.ts | 6 +- src/api/types/PageDeletedWebhookPayload.ts | 4 +- src/api/types/PageList.ts | 6 +- src/api/types/PageMetadataUpdatedWebhook.ts | 6 +- .../PageMetadataUpdatedWebhookPayload.ts | 4 +- src/api/types/PageOpenGraph.ts | 4 +- src/api/types/PageSeo.ts | 4 +- src/api/types/Pagination.ts | 4 +- src/api/types/Payload.ts | 6 +- src/api/types/PayloadFieldData.ts | 4 +- src/api/types/PaypalDetails.ts | 4 +- src/api/types/Product.ts | 6 +- src/api/types/ProductAndSkUs.ts | 6 +- src/api/types/ProductAndSkUsList.ts | 6 +- src/api/types/ProductFieldData.ts | 6 +- .../types/ProductFieldDataEcProductType.ts | 15 +- src/api/types/ProductFieldDataTaxCategory.ts | 40 +- src/api/types/PublishStatus.ts | 10 +- src/api/types/Redirect.ts | 4 +- src/api/types/Redirects.ts | 6 +- src/api/types/ReferenceField.ts | 6 +- src/api/types/ReferenceFieldMetadata.ts | 4 +- src/api/types/ReferenceFieldType.ts | 10 +- src/api/types/RegisteredScriptList.ts | 6 +- src/api/types/Robots.ts | 6 +- src/api/types/RobotsRulesItem.ts | 4 +- src/api/types/ScriptApply.ts | 6 +- src/api/types/ScriptApplyList.ts | 6 +- src/api/types/ScriptApplyLocation.ts | 10 +- src/api/types/Scripts.ts | 6 +- src/api/types/SearchButtonNode.ts | 4 +- src/api/types/SearchButtonNodeWrite.ts | 4 +- src/api/types/Select.ts | 6 +- src/api/types/SelectNode.ts | 6 +- src/api/types/SelectNodeChoicesItem.ts | 4 +- src/api/types/SelectNodeWriteChoicesItem.ts | 4 +- src/api/types/SingleLocaleCreatedPayload.ts | 6 +- .../SingleLocaleCreatedPayloadFieldData.ts | 4 +- src/api/types/Site.ts | 6 +- src/api/types/SiteActivityLogItem.ts | 6 +- src/api/types/SiteActivityLogItemEvent.ts | 48 +- .../SiteActivityLogItemResourceOperation.ts | 16 +- src/api/types/SiteActivityLogItemUser.ts | 4 +- src/api/types/SiteActivityLogResponse.ts | 6 +- src/api/types/SiteDataCollectionType.ts | 10 +- src/api/types/SiteMembership.ts | 6 +- src/api/types/SiteMembershipAuditLogItem.ts | 6 +- .../SiteMembershipAuditLogItemEventSubType.ts | 11 +- src/api/types/SitePlan.ts | 6 +- src/api/types/SitePlanId.ts | 22 +- src/api/types/SitePlanName.ts | 16 +- src/api/types/SitePublish.ts | 6 +- src/api/types/SitePublishPayload.ts | 4 +- src/api/types/Sites.ts | 6 +- src/api/types/Sku.ts | 6 +- src/api/types/SkuFieldData.ts | 6 +- src/api/types/SkuFieldDataCompareAtPrice.ts | 4 +- .../types/SkuFieldDataEcSkuBillingMethod.ts | 11 +- .../SkuFieldDataEcSkuSubscriptionPlan.ts | 6 +- ...uFieldDataEcSkuSubscriptionPlanInterval.ts | 11 +- ...FieldDataEcSkuSubscriptionPlanPlansItem.ts | 6 +- ...ataEcSkuSubscriptionPlanPlansItemStatus.ts | 11 +- src/api/types/SkuFieldDataPrice.ts | 4 +- src/api/types/SkuPropertyList.ts | 6 +- src/api/types/SkuPropertyListEnumItem.ts | 4 +- src/api/types/SkuValueList.ts | 4 +- src/api/types/StaticField.ts | 6 +- src/api/types/StaticFieldType.ts | 23 +- src/api/types/StripeCard.ts | 6 +- src/api/types/StripeCardBrand.ts | 17 +- src/api/types/StripeCardExpires.ts | 4 +- src/api/types/StripeDetails.ts | 4 +- src/api/types/SubmitButtonNode.ts | 4 +- src/api/types/SubmitButtonNodeWrite.ts | 4 +- src/api/types/Text.ts | 4 +- src/api/types/TextInputNode.ts | 4 +- src/api/types/TextInputNodeWrite.ts | 4 +- src/api/types/TextNode.ts | 6 +- src/api/types/TextNodeText.ts | 4 +- src/api/types/TextNodeWrite.ts | 4 +- src/api/types/TriggerType.ts | 27 +- src/api/types/UpdatedOrder.ts | 6 +- src/api/types/User.ts | 6 +- src/api/types/UserAccess.ts | 6 +- src/api/types/UserAccessAuditLogItem.ts | 6 +- .../UserAccessAuditLogItemEventSubType.ts | 7 +- src/api/types/UserAccessGroupsItem.ts | 6 +- src/api/types/UserAccessGroupsItemType.ts | 6 +- src/api/types/UserData.ts | 6 +- src/api/types/UserDataData.ts | 4 +- src/api/types/UserLimitReached.ts | 4 +- src/api/types/UserList.ts | 6 +- src/api/types/UserStatus.ts | 10 +- src/api/types/UsersNotEnabled.ts | 4 +- src/api/types/Webhook.ts | 6 +- src/api/types/WebhookFilter.ts | 4 +- src/api/types/WebhookList.ts | 6 +- src/api/types/WorkspaceAuditLogItem.ts | 6 +- src/api/types/WorkspaceAuditLogItemActor.ts | 4 +- ...ItemPayloadSiteMembershipGranularAccess.ts | 4 +- ...AuditLogItemPayloadSiteMembershipMethod.ts | 13 +- ...ceAuditLogItemPayloadSiteMembershipSite.ts | 4 +- ...tLogItemPayloadSiteMembershipTargetUser.ts | 4 +- ...ditLogItemPayloadSiteMembershipUserType.ts | 7 +- ...paceAuditLogItemPayloadUserAccessMethod.ts | 7 +- ...LogItemPayloadWorkspaceInvitationMethod.ts | 7 +- ...temPayloadWorkspaceInvitationTargetUser.ts | 4 +- ...yloadWorkspaceInvitationTargetUsersItem.ts | 4 +- ...gItemPayloadWorkspaceInvitationUserType.ts | 7 +- ...LogItemPayloadWorkspaceMembershipMethod.ts | 7 +- ...temPayloadWorkspaceMembershipTargetUser.ts | 4 +- ...gItemPayloadWorkspaceMembershipUserType.ts | 7 +- .../types/WorkspaceAuditLogItemWorkspace.ts | 4 +- src/api/types/WorkspaceAuditLogResponse.ts | 6 +- src/api/types/WorkspaceInvitation.ts | 6 +- .../types/WorkspaceInvitationAuditLogItem.ts | 6 +- ...spaceInvitationAuditLogItemEventSubType.ts | 13 +- src/api/types/WorkspaceMembership.ts | 6 +- .../types/WorkspaceMembershipAuditLogItem.ts | 6 +- ...spaceMembershipAuditLogItemEventSubType.ts | 7 +- src/api/types/index.ts | 476 +- src/core/auth/AuthProvider.ts | 5 + src/core/auth/AuthRequest.ts | 9 + src/core/auth/BasicAuth.ts | 9 +- src/core/auth/index.ts | 2 + src/core/base64.ts | 27 + src/core/fetcher/APIResponse.ts | 2 +- src/core/fetcher/BinaryResponse.ts | 36 + src/core/fetcher/EndpointMetadata.ts | 13 + src/core/fetcher/EndpointSupplier.ts | 14 + src/core/fetcher/Fetcher.ts | 24 +- src/core/fetcher/HttpResponsePromise.ts | 2 +- src/core/fetcher/ResponseWithBody.ts | 7 + src/core/fetcher/createRequestUrl.ts | 12 +- src/core/fetcher/getErrorResponseBody.ts | 33 + src/core/fetcher/getFetchFn.ts | 4 +- src/core/fetcher/getResponseBody.ts | 67 +- src/core/fetcher/index.ts | 11 +- src/core/fetcher/makeRequest.ts | 4 +- src/core/fetcher/requestWithRetries.ts | 58 +- .../Node18UniversalStreamWrapper.ts | 12 +- .../stream-wrappers/NodePre18StreamWrapper.ts | 2 +- .../stream-wrappers/UndiciStreamWrapper.ts | 9 +- src/core/headers.ts | 18 +- src/core/index.ts | 4 +- src/core/schemas/Schema.ts | 2 +- src/core/schemas/builders/bigint/bigint.ts | 4 +- src/core/schemas/builders/date/date.ts | 4 +- src/core/schemas/builders/enum/enum.ts | 2 +- src/core/schemas/builders/index.ts | 28 +- src/core/schemas/builders/lazy/index.ts | 2 +- src/core/schemas/builders/lazy/lazy.ts | 4 +- src/core/schemas/builders/lazy/lazyObject.ts | 10 +- src/core/schemas/builders/list/list.ts | 4 +- .../builders/literals/booleanLiteral.ts | 2 +- src/core/schemas/builders/literals/index.ts | 2 +- .../builders/literals/stringLiteral.ts | 2 +- .../object-like/getObjectLikeUtils.ts | 6 +- .../schemas/builders/object-like/types.ts | 10 +- src/core/schemas/builders/object/index.ts | 4 +- src/core/schemas/builders/object/object.ts | 14 +- .../object/objectWithoutOptionalProperties.ts | 7 +- src/core/schemas/builders/object/property.ts | 2 +- src/core/schemas/builders/object/types.ts | 37 +- src/core/schemas/builders/primitives/any.ts | 7 +- .../schemas/builders/primitives/boolean.ts | 4 +- .../schemas/builders/primitives/number.ts | 4 +- .../schemas/builders/primitives/string.ts | 4 +- .../schemas/builders/primitives/unknown.ts | 7 +- src/core/schemas/builders/record/record.ts | 8 +- src/core/schemas/builders/record/types.ts | 4 +- .../builders/schema-utils/JsonError.ts | 2 +- .../builders/schema-utils/ParseError.ts | 2 +- .../builders/schema-utils/getSchemaUtils.ts | 2 +- .../schemas/builders/schema-utils/index.ts | 2 +- .../schema-utils/stringifyValidationErrors.ts | 2 +- src/core/schemas/builders/set/set.ts | 6 +- .../builders/undiscriminated-union/types.ts | 2 +- .../undiscriminatedUnion.ts | 13 +- src/core/schemas/builders/union/index.ts | 2 +- src/core/schemas/builders/union/types.ts | 4 +- src/core/schemas/builders/union/union.ts | 20 +- src/core/schemas/index.ts | 2 +- .../utils/createIdentitySchemaCreator.ts | 4 +- src/core/schemas/utils/maybeSkipValidation.ts | 4 +- src/core/url/encodePathParam.ts | 18 + src/core/url/index.ts | 3 + src/core/url/join.ts | 80 + src/core/url/qs.ts | 74 + src/environments.ts | 4 +- src/errors/WebflowError.ts | 8 +- src/errors/WebflowTimeoutError.ts | 4 +- .../types/AccessGroupsListRequestSort.ts | 8 +- .../requests/AssetsCreateFolderRequest.ts | 8 +- .../client/requests/AssetsCreateRequest.ts | 8 +- .../client/requests/AssetsUpdateRequest.ts | 8 +- .../resources/assets/client/requests/index.ts | 2 +- .../requests/CollectionsCreateRequest.ts | 8 +- .../resources/collections/index.ts | 2 +- .../fields/client/requests/FieldUpdate.ts | 8 +- .../resources/collections/resources/index.ts | 4 +- .../CreateBulkCollectionItemRequestBody.ts | 8 +- .../requests/ItemsDeleteItemsLiveRequest.ts | 8 +- .../requests/ItemsDeleteItemsRequest.ts | 8 +- .../requests/ItemsUpdateItemsLiveRequest.ts | 8 +- .../requests/ItemsUpdateItemsRequest.ts | 8 +- .../resources/items/client/requests/index.ts | 6 +- .../collections/resources/items/index.ts | 2 +- ...eBulkCollectionItemRequestBodyFieldData.ts | 10 +- ...kCollectionItemRequestBodyFieldDataItem.ts | 8 +- .../resources/items/types/ItemIDs.ts | 8 +- .../items/types/ItemIDsWithLocales.ts | 8 +- .../types/ItemsCreateItemLiveRequestBody.ts | 8 +- .../items/types/ItemsCreateItemRequestBody.ts | 8 +- .../ItemsDeleteItemsLiveRequestItemsItem.ts | 8 +- .../types/ItemsDeleteItemsRequestItemsItem.ts | 8 +- .../types/ItemsListItemsLiveRequestSortBy.ts | 8 +- .../ItemsListItemsLiveRequestSortOrder.ts | 8 +- .../types/ItemsListItemsRequestSortBy.ts | 8 +- .../types/ItemsListItemsRequestSortOrder.ts | 8 +- .../items/types/ItemsPublishItemRequest.ts | 8 +- .../ItemsPublishItemRequestItemsItemsItem.ts | 8 +- .../items/types/ItemsPublishItemResponse.ts | 8 +- .../items/types/ItemsUpdateItemsResponse.ts | 8 +- .../resources/items/types/MultipleItems.ts | 8 +- .../items/types/MultipleLiveItems.ts | 8 +- .../resources/items/types/SingleCmsItem.ts | 8 +- .../resources/items/types/index.ts | 26 +- .../client/requests/ComponentDomWrite.ts | 8 +- .../requests/ComponentPropertiesWrite.ts | 8 +- .../resources/components/index.ts | 2 +- .../types/ComponentDomWriteNodesItem.ts | 14 +- .../ComponentPropertiesWritePropertiesItem.ts | 8 +- .../types/ComponentsUpdateContentResponse.ts | 8 +- .../ComponentsUpdatePropertiesResponse.ts | 8 +- .../resources/components/types/index.ts | 2 +- .../requests/FormsUpdateSubmissionRequest.ts | 8 +- src/serialization/resources/index.ts | 48 +- .../client/requests/InventoryUpdateRequest.ts | 8 +- .../resources/inventory/index.ts | 2 +- .../types/EcommInventoryChangedPayload.ts | 8 +- .../InventoryUpdateRequestInventoryType.ts | 8 +- .../resources/inventory/types/index.ts | 2 +- .../client/requests/OrdersRefundRequest.ts | 8 +- .../requests/OrdersUpdateFulfillRequest.ts | 8 +- .../client/requests/OrdersUpdateRequest.ts | 8 +- .../resources/orders/client/requests/index.ts | 4 +- src/serialization/resources/orders/index.ts | 2 +- .../orders/types/OrdersListRequestStatus.ts | 8 +- .../orders/types/OrdersRefundRequestReason.ts | 8 +- .../pages/client/requests/PageDomWrite.ts | 8 +- .../client/requests/PageMetadataWrite.ts | 10 +- .../resources/pages/client/requests/index.ts | 2 +- src/serialization/resources/pages/index.ts | 2 +- .../pages/types/PageDomWriteNodesItem.ts | 14 +- .../pages/types/PageMetadataWriteOpenGraph.ts | 8 +- .../pages/types/PageMetadataWriteSeo.ts | 8 +- .../types/UpdateStaticContentResponse.ts | 8 +- .../resources/pages/types/index.ts | 4 +- .../client/requests/ProductSkuCreate.ts | 8 +- .../client/requests/ProductSkuUpdate.ts | 10 +- .../requests/ProductsCreateSkuRequest.ts | 8 +- .../requests/ProductsUpdateSkuRequest.ts | 8 +- src/serialization/resources/products/index.ts | 2 +- .../products/types/ProductSkuCreateProduct.ts | 8 +- .../products/types/ProductSkuCreateSku.ts | 8 +- .../types/ProductsCreateSkuResponse.ts | 8 +- .../requests/CustomCodeHostedRequest.ts | 8 +- .../requests/CustomCodeInlineRequest.ts | 8 +- .../client/requests/SitesCreateRequest.ts | 8 +- .../client/requests/SitesPublishRequest.ts | 8 +- .../client/requests/SitesUpdateRequest.ts | 8 +- .../resources/sites/client/requests/index.ts | 2 +- src/serialization/resources/sites/index.ts | 4 +- .../CommentsGetCommentThreadRequestSortBy.ts | 8 +- ...ommentsGetCommentThreadRequestSortOrder.ts | 8 +- ...CommentsListCommentRepliesRequestSortBy.ts | 8 +- ...mentsListCommentRepliesRequestSortOrder.ts | 8 +- ...CommentsListCommentThreadsRequestSortBy.ts | 8 +- ...mentsListCommentThreadsRequestSortOrder.ts | 8 +- .../sites/resources/comments/types/index.ts | 4 +- .../requests/FormsUpdateSubmissionRequest.ts | 8 +- .../resources/sites/resources/index.ts | 6 +- .../client/requests/WellKnownDeleteRequest.ts | 8 +- .../client/requests/WellKnownFile.ts | 8 +- .../wellKnown/client/requests/index.ts | 2 +- .../sites/resources/wellKnown/index.ts | 2 +- .../types/WellKnownFileContentType.ts | 8 +- .../sites/types/SitesPublishResponse.ts | 8 +- .../client/requests/UsersInviteRequest.ts | 8 +- src/serialization/resources/users/index.ts | 2 +- .../users/types/UserAccountAddedPayload.ts | 8 +- .../types/UserAccountAddedPayloadPayload.ts | 12 +- .../UserAccountAddedPayloadPayloadData.ts | 8 +- .../users/types/UserAccountDeletedPayload.ts | 8 +- .../types/UserAccountDeletedPayloadPayload.ts | 12 +- .../UserAccountDeletedPayloadPayloadData.ts | 8 +- .../users/types/UserAccountUpdatedPayload.ts | 8 +- .../types/UserAccountUpdatedPayloadPayload.ts | 12 +- .../UserAccountUpdatedPayloadPayloadData.ts | 8 +- .../users/types/UsersListRequestSort.ts | 8 +- .../resources/users/types/index.ts | 16 +- ...gsGetWorkspaceAuditLogsRequestEventType.ts | 8 +- ...gsGetWorkspaceAuditLogsRequestSortOrder.ts | 8 +- .../resources/auditLogs/types/index.ts | 2 +- src/serialization/types/AccessGroup.ts | 8 +- src/serialization/types/AccessGroupList.ts | 8 +- src/serialization/types/Application.ts | 8 +- src/serialization/types/Asset.ts | 8 +- src/serialization/types/AssetFolder.ts | 8 +- src/serialization/types/AssetFolderList.ts | 8 +- src/serialization/types/AssetUpload.ts | 8 +- .../types/AssetUploadUploadDetails.ts | 8 +- src/serialization/types/AssetVariant.ts | 8 +- src/serialization/types/Assets.ts | 8 +- src/serialization/types/Authorization.ts | 10 +- .../types/AuthorizationAuthorization.ts | 8 +- .../AuthorizationAuthorizationAuthorizedTo.ts | 8 +- src/serialization/types/AuthorizedUser.ts | 8 +- .../types/BadRequestErrorBody.ts | 8 +- src/serialization/types/BulkCollectionItem.ts | 8 +- .../types/BulkCollectionItemFieldData.ts | 8 +- src/serialization/types/Collection.ts | 8 +- src/serialization/types/CollectionItem.ts | 8 +- .../types/CollectionItemChanged.ts | 8 +- .../types/CollectionItemCreated.ts | 8 +- .../types/CollectionItemFieldData.ts | 8 +- src/serialization/types/CollectionItemList.ts | 8 +- .../types/CollectionItemListNoPagination.ts | 8 +- .../types/CollectionItemListPagination.ts | 8 +- .../types/CollectionItemPatchSingle.ts | 8 +- .../CollectionItemPatchSingleFieldData.ts | 8 +- .../types/CollectionItemPostSingle.ts | 8 +- .../CollectionItemPostSingleFieldData.ts | 8 +- .../types/CollectionItemPublished.ts | 8 +- .../types/CollectionItemRemoved.ts | 8 +- .../types/CollectionItemRemovedPayload.ts | 8 +- .../CollectionItemRemovedPayloadFieldData.ts | 8 +- .../types/CollectionItemUnpublished.ts | 8 +- .../types/CollectionItemUnpublishedPayload.ts | 8 +- ...llectionItemUnpublishedPayloadFieldData.ts | 8 +- .../types/CollectionItemWithIdInput.ts | 8 +- .../CollectionItemWithIdInputFieldData.ts | 8 +- src/serialization/types/CollectionList.ts | 8 +- .../types/CollectionListArrayItem.ts | 8 +- src/serialization/types/Comment.ts | 8 +- src/serialization/types/CommentPayload.ts | 8 +- .../types/CommentPayloadAuthor.ts | 8 +- .../types/CommentPayloadMentionedUsersItem.ts | 8 +- src/serialization/types/CommentReply.ts | 8 +- src/serialization/types/CommentReplyAuthor.ts | 8 +- src/serialization/types/CommentReplyList.ts | 8 +- .../types/CommentReplyListPagination.ts | 8 +- .../types/CommentReplyMentionedUsersItem.ts | 8 +- src/serialization/types/CommentThread.ts | 8 +- .../types/CommentThreadAuthor.ts | 8 +- src/serialization/types/CommentThreadList.ts | 8 +- .../types/CommentThreadListPagination.ts | 8 +- .../types/CommentThreadMentionedUsersItem.ts | 8 +- src/serialization/types/Component.ts | 8 +- src/serialization/types/ComponentDom.ts | 8 +- ...onentInstanceNodePropertyOverridesWrite.ts | 8 +- ...ertyOverridesWritePropertyOverridesItem.ts | 8 +- src/serialization/types/ComponentList.ts | 8 +- src/serialization/types/ComponentNode.ts | 8 +- .../types/ComponentProperties.ts | 8 +- src/serialization/types/ComponentProperty.ts | 8 +- .../types/ComponentPropertyType.ts | 8 +- src/serialization/types/Conflict.ts | 8 +- src/serialization/types/ConflictErrorBody.ts | 8 +- src/serialization/types/CustomCodeBlock.ts | 9 +- .../types/CustomCodeBlockType.ts | 8 +- .../types/CustomCodeHostedResponse.ts | 8 +- .../types/CustomCodeInlineResponse.ts | 8 +- src/serialization/types/CustomRole.ts | 8 +- .../types/CustomRoleAuditLogItem.ts | 10 +- .../CustomRoleAuditLogItemEventSubType.ts | 8 +- src/serialization/types/Dom.ts | 8 +- src/serialization/types/Domain.ts | 8 +- src/serialization/types/Domains.ts | 8 +- src/serialization/types/DuplicateUserEmail.ts | 8 +- src/serialization/types/EcommerceSettings.ts | 8 +- src/serialization/types/ErrorCode.ts | 8 +- src/serialization/types/Error_.ts | 8 +- src/serialization/types/Field.ts | 8 +- src/serialization/types/FieldCreate.ts | 10 +- src/serialization/types/FieldType.ts | 8 +- src/serialization/types/FieldValidations.ts | 8 +- .../FieldValidationsAdditionalProperties.ts | 8 +- ...dditionalPropertiesAdditionalProperties.ts | 8 +- src/serialization/types/ForbiddenErrorBody.ts | 8 +- src/serialization/types/Form.ts | 9 +- src/serialization/types/FormField.ts | 8 +- src/serialization/types/FormFieldValue.ts | 8 +- src/serialization/types/FormFieldValueType.ts | 8 +- src/serialization/types/FormList.ts | 8 +- .../types/FormResponseSettings.ts | 8 +- src/serialization/types/FormSubmission.ts | 8 +- src/serialization/types/FormSubmissionList.ts | 8 +- .../types/FormSubmissionTrigger.ts | 8 +- .../types/FormSubmissionTriggerPayload.ts | 8 +- .../FormSubmissionTriggerPayloadSchemaItem.ts | 8 +- ...issionTriggerPayloadSchemaItemFieldType.ts | 8 +- src/serialization/types/ImageNode.ts | 8 +- src/serialization/types/ImageNodeImage.ts | 8 +- src/serialization/types/InvalidDomain.ts | 8 +- src/serialization/types/InvalidScopes.ts | 8 +- src/serialization/types/InventoryItem.ts | 8 +- .../types/InventoryItemInventoryType.ts | 8 +- .../ItemsListItemsLiveRequestLastPublished.ts | 8 +- .../ItemsListItemsRequestLastPublished.ts | 8 +- .../types/ListCustomCodeBlocks.ts | 8 +- src/serialization/types/Locale.ts | 8 +- src/serialization/types/Locales.ts | 8 +- src/serialization/types/Metadata.ts | 8 +- .../types/MetadataOptionsItem.ts | 8 +- src/serialization/types/NewOrder.ts | 8 +- src/serialization/types/NoDomains.ts | 8 +- src/serialization/types/Node.ts | 16 +- .../types/NotEnterprisePlanSite.ts | 8 +- .../types/NotEnterprisePlanWorkspace.ts | 8 +- src/serialization/types/OptionField.ts | 8 +- src/serialization/types/Order.ts | 26 +- src/serialization/types/OrderAddress.ts | 10 +- .../types/OrderAddressJapanType.ts | 8 +- src/serialization/types/OrderAddressType.ts | 8 +- .../types/OrderBillingAddress.ts | 10 +- .../types/OrderBillingAddressJapanType.ts | 8 +- .../types/OrderBillingAddressType.ts | 8 +- src/serialization/types/OrderCustomerInfo.ts | 8 +- .../types/OrderDisputeLastStatus.ts | 8 +- .../types/OrderDownloadFilesItem.ts | 8 +- src/serialization/types/OrderList.ts | 8 +- src/serialization/types/OrderMetadata.ts | 8 +- src/serialization/types/OrderPrice.ts | 8 +- src/serialization/types/OrderPurchasedItem.ts | 8 +- .../types/OrderPurchasedItemVariantImage.ts | 8 +- .../OrderPurchasedItemVariantImageFile.ts | 8 +- ...rchasedItemVariantImageFileVariantsItem.ts | 8 +- .../types/OrderShippingAddress.ts | 10 +- .../types/OrderShippingAddressJapanType.ts | 8 +- .../types/OrderShippingAddressType.ts | 8 +- src/serialization/types/OrderStatus.ts | 8 +- src/serialization/types/OrderTotals.ts | 8 +- .../types/OrderTotalsExtrasItem.ts | 10 +- .../types/OrderTotalsExtrasItemType.ts | 8 +- src/serialization/types/Page.ts | 10 +- src/serialization/types/PageCreatedWebhook.ts | 8 +- .../types/PageCreatedWebhookPayload.ts | 8 +- src/serialization/types/PageDeletedWebhook.ts | 8 +- .../types/PageDeletedWebhookPayload.ts | 8 +- src/serialization/types/PageList.ts | 8 +- .../types/PageMetadataUpdatedWebhook.ts | 8 +- .../PageMetadataUpdatedWebhookPayload.ts | 8 +- src/serialization/types/PageOpenGraph.ts | 8 +- src/serialization/types/PageSeo.ts | 8 +- src/serialization/types/Pagination.ts | 8 +- src/serialization/types/Payload.ts | 8 +- src/serialization/types/PayloadFieldData.ts | 8 +- src/serialization/types/PaypalDetails.ts | 8 +- src/serialization/types/Product.ts | 8 +- src/serialization/types/ProductAndSkUs.ts | 8 +- src/serialization/types/ProductAndSkUsList.ts | 10 +- src/serialization/types/ProductFieldData.ts | 12 +- .../types/ProductFieldDataEcProductType.ts | 8 +- .../types/ProductFieldDataTaxCategory.ts | 8 +- src/serialization/types/PublishStatus.ts | 8 +- src/serialization/types/Redirect.ts | 8 +- src/serialization/types/Redirects.ts | 10 +- src/serialization/types/ReferenceField.ts | 10 +- .../types/ReferenceFieldMetadata.ts | 8 +- src/serialization/types/ReferenceFieldType.ts | 8 +- .../types/RegisteredScriptList.ts | 8 +- src/serialization/types/Robots.ts | 8 +- src/serialization/types/RobotsRulesItem.ts | 8 +- src/serialization/types/ScriptApply.ts | 8 +- src/serialization/types/ScriptApplyList.ts | 8 +- .../types/ScriptApplyLocation.ts | 8 +- src/serialization/types/Scripts.ts | 8 +- src/serialization/types/SearchButtonNode.ts | 8 +- .../types/SearchButtonNodeWrite.ts | 8 +- src/serialization/types/Select.ts | 8 +- src/serialization/types/SelectNode.ts | 8 +- .../types/SelectNodeChoicesItem.ts | 8 +- .../types/SelectNodeWriteChoicesItem.ts | 8 +- .../types/SingleLocaleCreatedPayload.ts | 8 +- .../SingleLocaleCreatedPayloadFieldData.ts | 8 +- src/serialization/types/Site.ts | 8 +- .../types/SiteActivityLogItem.ts | 8 +- .../types/SiteActivityLogItemEvent.ts | 8 +- .../SiteActivityLogItemResourceOperation.ts | 8 +- .../types/SiteActivityLogItemUser.ts | 8 +- .../types/SiteActivityLogResponse.ts | 10 +- .../types/SiteDataCollectionType.ts | 8 +- src/serialization/types/SiteMembership.ts | 12 +- .../types/SiteMembershipAuditLogItem.ts | 10 +- .../SiteMembershipAuditLogItemEventSubType.ts | 8 +- src/serialization/types/SitePlan.ts | 8 +- src/serialization/types/SitePlanId.ts | 8 +- src/serialization/types/SitePlanName.ts | 8 +- src/serialization/types/SitePublish.ts | 8 +- src/serialization/types/SitePublishPayload.ts | 8 +- src/serialization/types/Sites.ts | 8 +- src/serialization/types/Sku.ts | 8 +- src/serialization/types/SkuFieldData.ts | 12 +- .../types/SkuFieldDataCompareAtPrice.ts | 8 +- .../types/SkuFieldDataEcSkuBillingMethod.ts | 8 +- .../SkuFieldDataEcSkuSubscriptionPlan.ts | 8 +- ...uFieldDataEcSkuSubscriptionPlanInterval.ts | 8 +- ...FieldDataEcSkuSubscriptionPlanPlansItem.ts | 8 +- ...ataEcSkuSubscriptionPlanPlansItemStatus.ts | 8 +- src/serialization/types/SkuFieldDataPrice.ts | 8 +- src/serialization/types/SkuPropertyList.ts | 8 +- .../types/SkuPropertyListEnumItem.ts | 8 +- src/serialization/types/SkuValueList.ts | 8 +- src/serialization/types/StaticField.ts | 8 +- src/serialization/types/StaticFieldType.ts | 8 +- src/serialization/types/StripeCard.ts | 8 +- src/serialization/types/StripeCardBrand.ts | 8 +- src/serialization/types/StripeCardExpires.ts | 8 +- src/serialization/types/StripeDetails.ts | 8 +- src/serialization/types/SubmitButtonNode.ts | 8 +- .../types/SubmitButtonNodeWrite.ts | 8 +- src/serialization/types/Text.ts | 8 +- src/serialization/types/TextInputNode.ts | 8 +- src/serialization/types/TextInputNodeWrite.ts | 8 +- src/serialization/types/TextNode.ts | 8 +- src/serialization/types/TextNodeText.ts | 8 +- src/serialization/types/TextNodeWrite.ts | 8 +- src/serialization/types/TriggerType.ts | 8 +- src/serialization/types/UpdatedOrder.ts | 8 +- src/serialization/types/User.ts | 10 +- src/serialization/types/UserAccess.ts | 8 +- .../types/UserAccessAuditLogItem.ts | 10 +- .../UserAccessAuditLogItemEventSubType.ts | 8 +- .../types/UserAccessGroupsItem.ts | 8 +- .../types/UserAccessGroupsItemType.ts | 8 +- src/serialization/types/UserData.ts | 8 +- src/serialization/types/UserDataData.ts | 8 +- src/serialization/types/UserLimitReached.ts | 8 +- src/serialization/types/UserList.ts | 8 +- src/serialization/types/UserStatus.ts | 8 +- src/serialization/types/UsersNotEnabled.ts | 8 +- src/serialization/types/Webhook.ts | 8 +- src/serialization/types/WebhookFilter.ts | 8 +- src/serialization/types/WebhookList.ts | 10 +- .../types/WorkspaceAuditLogItem.ts | 16 +- .../types/WorkspaceAuditLogItemActor.ts | 8 +- ...ItemPayloadSiteMembershipGranularAccess.ts | 8 +- ...AuditLogItemPayloadSiteMembershipMethod.ts | 8 +- ...ceAuditLogItemPayloadSiteMembershipSite.ts | 8 +- ...tLogItemPayloadSiteMembershipTargetUser.ts | 8 +- ...ditLogItemPayloadSiteMembershipUserType.ts | 8 +- ...paceAuditLogItemPayloadUserAccessMethod.ts | 8 +- ...LogItemPayloadWorkspaceInvitationMethod.ts | 8 +- ...temPayloadWorkspaceInvitationTargetUser.ts | 8 +- ...yloadWorkspaceInvitationTargetUsersItem.ts | 8 +- ...gItemPayloadWorkspaceInvitationUserType.ts | 8 +- ...LogItemPayloadWorkspaceMembershipMethod.ts | 8 +- ...temPayloadWorkspaceMembershipTargetUser.ts | 8 +- ...gItemPayloadWorkspaceMembershipUserType.ts | 8 +- .../types/WorkspaceAuditLogItemWorkspace.ts | 8 +- .../types/WorkspaceAuditLogResponse.ts | 10 +- .../types/WorkspaceInvitation.ts | 12 +- .../types/WorkspaceInvitationAuditLogItem.ts | 10 +- ...spaceInvitationAuditLogItemEventSubType.ts | 8 +- .../types/WorkspaceMembership.ts | 10 +- .../types/WorkspaceMembershipAuditLogItem.ts | 10 +- ...spaceMembershipAuditLogItemEventSubType.ts | 8 +- src/serialization/types/index.ts | 476 +- src/version.ts | 2 +- tests/mock-server/MockServer.ts | 2 +- tests/mock-server/MockServerPool.ts | 10 +- tests/mock-server/mockEndpointBuilder.ts | 36 +- tests/mock-server/withHeaders.ts | 2 +- tests/mock-server/withJson.ts | 24 +- tests/tsconfig.json | 2 +- tests/unit/auth/BasicAuth.test.ts | 36 + tests/unit/base64.test.ts | 53 + tests/unit/fetcher/Fetcher.test.ts | 30 +- .../unit/fetcher/HttpResponsePromise.test.ts | 2 +- tests/unit/fetcher/createRequestUrl.test.ts | 109 + tests/unit/fetcher/getFetchFn.test.ts | 4 +- tests/unit/fetcher/getRequestBody.test.ts | 14 +- tests/unit/fetcher/getResponseBody.test.ts | 3 +- tests/unit/fetcher/requestWithRetries.test.ts | 103 + .../Node18UniversalStreamWrapper.test.ts | 2 +- .../NodePre18StreamWrapper.test.ts | 4 +- .../chooseStreamWrapper.test.ts | 2 +- tests/unit/schemas/lazy/lazy.test.ts | 2 +- .../schema-utils/getSchemaUtils.test.ts | 6 +- tests/unit/schemas/utils/itSchema.ts | 6 +- tests/unit/schemas/utils/itValidate.ts | 2 +- tests/unit/url/join.test.ts | 120 + tests/unit/url/qs.test.ts | 187 + tests/wire/.gitkeep | 0 tests/wire/accessGroups.test.ts | 135 +- tests/wire/assets.test.ts | 875 ++- tests/wire/collections.test.ts | 480 +- tests/wire/collections/fields.test.ts | 512 +- tests/wire/collections/items.test.ts | 5118 +++++++++++++++-- tests/wire/components.test.ts | 764 ++- tests/wire/ecommerce.test.ts | 156 +- tests/wire/forms.test.ts | 845 ++- tests/wire/inventory.test.ts | 326 +- tests/wire/orders.test.ts | 922 ++- tests/wire/pages.test.ts | 645 ++- tests/wire/pages/scripts.test.ts | 355 +- tests/wire/products.test.ts | 1096 +++- tests/wire/scripts.test.ts | 408 +- tests/wire/sites.test.ts | 722 ++- tests/wire/sites/activityLogs.test.ts | 93 +- tests/wire/sites/comments.test.ts | 328 +- tests/wire/sites/forms.test.ts | 696 ++- tests/wire/sites/plans.test.ts | 114 +- tests/wire/sites/redirects.test.ts | 445 +- tests/wire/sites/robotsTxt.test.ts | 450 +- tests/wire/sites/scripts.test.ts | 440 +- tests/wire/sites/wellKnown.test.ts | 246 +- tests/wire/token.test.ts | 68 +- tests/wire/users.test.ts | 695 ++- tests/wire/webhooks.test.ts | 440 +- tests/wire/workspaces/auditLogs.test.ts | 120 +- tsconfig.json | 2 + yarn.lock | 335 +- 998 files changed, 23946 insertions(+), 9002 deletions(-) delete mode 100644 .prettierrc.yml create mode 100644 biome.json create mode 100644 src/BaseClient.ts create mode 100644 src/core/auth/AuthProvider.ts create mode 100644 src/core/auth/AuthRequest.ts create mode 100644 src/core/base64.ts create mode 100644 src/core/fetcher/BinaryResponse.ts create mode 100644 src/core/fetcher/EndpointMetadata.ts create mode 100644 src/core/fetcher/EndpointSupplier.ts create mode 100644 src/core/fetcher/ResponseWithBody.ts create mode 100644 src/core/fetcher/getErrorResponseBody.ts create mode 100644 src/core/url/encodePathParam.ts create mode 100644 src/core/url/index.ts create mode 100644 src/core/url/join.ts create mode 100644 src/core/url/qs.ts create mode 100644 tests/unit/base64.test.ts create mode 100644 tests/unit/url/join.test.ts create mode 100644 tests/unit/url/qs.test.ts create mode 100644 tests/wire/.gitkeep diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9424323c..c39c7866 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,13 @@ jobs: uses: actions/checkout@v4 - name: Set up node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 + + - name: Install dependencies + run: yarn install - name: Compile - run: yarn && yarn build + run: yarn build test: runs-on: ubuntu-latest @@ -24,34 +27,42 @@ jobs: uses: actions/checkout@v4 - name: Set up node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 - - name: Compile - run: yarn && yarn test + - name: Install dependencies + run: yarn install + + - name: Test + run: yarn test publish: needs: [ compile, test ] if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-latest + permissions: + id-token: write # Required for OIDC steps: - name: Checkout repo uses: actions/checkout@v4 + - name: Set up node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 + - name: Install dependencies run: yarn install + - name: Build run: yarn build - name: Publish to npm run: | - npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} + publish() { # use latest npm to ensure OIDC support + npx -y npm@latest publish "$@" + } if [[ ${GITHUB_REF} == *alpha* ]]; then - npm publish --access public --tag alpha + publish --access public --tag alpha elif [[ ${GITHUB_REF} == *beta* ]]; then - npm publish --access public --tag beta + publish --access public --tag beta else - npm publish --access public - fi - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + publish --access public + fi \ No newline at end of file diff --git a/.npmignore b/.npmignore index 6db0876c..c0c40ac1 100644 --- a/.npmignore +++ b/.npmignore @@ -5,5 +5,7 @@ tests .github .fernignore .prettierrc.yml +biome.json tsconfig.json -yarn.lock \ No newline at end of file +yarn.lock +pnpm-lock.yaml \ No newline at end of file diff --git a/.prettierrc.yml b/.prettierrc.yml deleted file mode 100644 index 0c06786b..00000000 --- a/.prettierrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -tabWidth: 4 -printWidth: 120 diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..a777468e --- /dev/null +++ b/biome.json @@ -0,0 +1,74 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.3.1/schema.json", + "root": true, + "vcs": { + "enabled": false + }, + "files": { + "ignoreUnknown": true, + "includes": [ + "**", + "!!dist", + "!!**/dist", + "!!lib", + "!!**/lib", + "!!_tmp_*", + "!!**/_tmp_*", + "!!*.tmp", + "!!**/*.tmp", + "!!.tmp/", + "!!**/.tmp/", + "!!*.log", + "!!**/*.log", + "!!**/.DS_Store", + "!!**/Thumbs.db" + ] + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 4, + "lineWidth": 120 + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + }, + "linter": { + "rules": { + "style": { + "useNodejsImportProtocol": "off" + }, + "suspicious": { + "noAssignInExpressions": "warn", + "noUselessEscapeInString": { + "level": "warn", + "fix": "none", + "options": {} + }, + "noThenProperty": "warn", + "useIterableCallbackReturn": "warn", + "noShadowRestrictedNames": "warn", + "noTsIgnore": { + "level": "warn", + "fix": "none", + "options": {} + }, + "noConfusingVoidType": { + "level": "warn", + "fix": "none", + "options": {} + } + } + } + } +} diff --git a/jest.config.mjs b/jest.config.mjs index 3ad4cdb8..d4960c28 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -2,8 +2,29 @@ export default { preset: "ts-jest", testEnvironment: "node", - moduleNameMapper: { - "^(\.{1,2}/.*)\.js$": "$1", - }, - setupFilesAfterEnv: ["/tests/mock-server/setup.ts"], + projects: [ + { + displayName: "unit", + preset: "ts-jest", + testEnvironment: "node", + moduleNameMapper: { + "^(\.{1,2}/.*)\.js$": "$1", + }, + roots: ["/tests"], + testPathIgnorePatterns: ["/tests/wire/"], + setupFilesAfterEnv: [], + }, + { + displayName: "wire", + preset: "ts-jest", + testEnvironment: "node", + moduleNameMapper: { + "^(\.{1,2}/.*)\.js$": "$1", + }, + roots: ["/tests/wire"], + setupFilesAfterEnv: ["/tests/mock-server/setup.ts"], + }, + ], + workerThreads: false, + passWithNoTests: true, }; diff --git a/package.json b/package.json index dfd4fa7f..7fa06d3c 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,31 @@ { "name": "webflow-api", - "version": "3.2.2", + "version": "3.3.0", "private": false, - "repository": "https://github.com/webflow/js-webflow-api", + "repository": "github:webflow/js-webflow-api", "main": "./index.js", "types": "./index.d.ts", "scripts": { - "format": "prettier . --write --ignore-unknown", + "format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", "build": "tsc", "prepack": "cp -rv dist/. .", - "test": "jest tests/unit --passWithNoTests", - "test:wire": "jest tests/wire --passWithNoTests", - "wire:test": "yarn test:wire" + "test": "jest --config jest.config.mjs", + "test:unit": "jest --selectProjects unit", + "test:wire": "jest --selectProjects wire" }, "dependencies": { - "url-join": "4.0.1", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "formdata-node": "^6.0.3", "node-fetch": "^2.7.0", - "qs": "^6.13.1", "readable-stream": "^4.5.2", - "js-base64": "3.7.7", "crypto-browserify": "^3.12.1" }, "devDependencies": { - "@types/url-join": "4.0.1", - "@types/qs": "^6.9.17", "@types/node-fetch": "^2.6.12", "@types/readable-stream": "^4.0.18", "webpack": "^5.97.1", @@ -37,17 +37,22 @@ "jest-environment-jsdom": "^29.7.0", "msw": "2.11.2", "@types/node": "^18.19.70", - "prettier": "^3.4.2", "typescript": "~5.7.2", + "@biomejs/biome": "2.3.1", "jest-fetch-mock": "^3.0.3" }, "browser": { "fs": false, "os": false, "path": false, + "stream": false, "crypto": false }, "packageManager": "yarn@1.22.22", + "engines": { + "node": ">=18.0.0" + }, + "sideEffects": false, "resolutions": { "pbkdf2": "^3.1.3", "@types/babel__traverse": "7.20.6" diff --git a/reference.md b/reference.md index 5e2b11dc..b5bdce51 100644 --- a/reference.md +++ b/reference.md @@ -1,7 +1,5 @@ # Reference - ## Token -
client.token.authorizedBy() -> Webflow.AuthorizedUser
@@ -17,7 +15,6 @@ Information about the Authorized User Required Scope | `authorized_user:read` -
@@ -33,8 +30,8 @@ Required Scope | `authorized_user:read` ```typescript await client.token.authorizedBy(); -``` +``` @@ -48,13 +45,14 @@ await client.token.authorizedBy();
-**requestOptions:** `Token.RequestOptions` - +**requestOptions:** `Token.RequestOptions` +
+
@@ -74,7 +72,6 @@ await client.token.authorizedBy(); Information about the authorization token Access to this endpoint requires a bearer token from a [Data Client App](/data/docs/getting-started-data-clients). - @@ -90,8 +87,8 @@ Information about the authorization token ```typescript await client.token.introspect(); -``` +``` @@ -105,19 +102,19 @@ await client.token.introspect();
-**requestOptions:** `Token.RequestOptions` - +**requestOptions:** `Token.RequestOptions` +
+ ## Sites -
client.sites.create(workspaceId, { ...params }) -> Webflow.Site
@@ -130,12 +127,11 @@ await client.token.introspect();
-Create a site. +Create a site. This endpoint requires an Enterprise workspace. Required scope | `workspace:write` -
@@ -151,10 +147,10 @@ Required scope | `workspace:write` ```typescript await client.sites.create("580e63e98c9a982ac9b8b741", { - name: "The Hitchhiker's Guide to the Galaxy", + name: "The Hitchhiker's Guide to the Galaxy" }); -``` +```
@@ -169,28 +165,29 @@ await client.sites.create("580e63e98c9a982ac9b8b741", {
**workspaceId:** `string` — Unique identifier for a Workspace - +
-**request:** `Webflow.SitesCreateRequest` - +**request:** `Webflow.SitesCreateRequest` +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
+
@@ -210,7 +207,6 @@ await client.sites.create("580e63e98c9a982ac9b8b741", { List of all sites the provided access token is able to access. Required scope | `sites:read` - @@ -226,8 +222,8 @@ Required scope | `sites:read` ```typescript await client.sites.list(); -``` +``` @@ -241,13 +237,14 @@ await client.sites.list();
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
+ @@ -267,7 +264,6 @@ await client.sites.list(); Get details of a site. Required scope | `sites:read` - @@ -283,8 +279,8 @@ Required scope | `sites:read` ```typescript await client.sites.get("580e63e98c9a982ac9b8b741"); -``` +``` @@ -299,20 +295,21 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
+ @@ -329,12 +326,11 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
-Delete a site. +Delete a site. This endpoint requires an Enterprise workspace. Required scope | `sites:write` -
@@ -350,8 +346,8 @@ Required scope | `sites:write` ```typescript await client.sites.delete("580e63e98c9a982ac9b8b741"); -``` +``` @@ -366,20 +362,21 @@ await client.sites.delete("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
+ @@ -396,12 +393,11 @@ await client.sites.delete("580e63e98c9a982ac9b8b741");
-Update a site. +Update a site. This endpoint requires an Enterprise workspace. Required scope | `sites:write` -
@@ -417,8 +413,8 @@ Required scope | `sites:write` ```typescript await client.sites.update("580e63e98c9a982ac9b8b741"); -``` +``` @@ -433,28 +429,29 @@ await client.sites.update("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.SitesUpdateRequest` - +**request:** `Webflow.SitesUpdateRequest` +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
+ @@ -474,7 +471,6 @@ await client.sites.update("580e63e98c9a982ac9b8b741"); Get a list of all custom domains related to site. Required scope | `sites:read` - @@ -490,8 +486,8 @@ Required scope | `sites:read` ```typescript await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741"); -``` +``` @@ -506,20 +502,21 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
+ @@ -536,14 +533,13 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
-Publishes a site to one or more more domains. +Publishes a site to one or more more domains. To publish to a specific custom domain, use the domain IDs from the [Get Custom Domains](/data/reference/sites/get-custom-domain) endpoint. This endpoint has a specific rate limit of one successful publish queue per minute. Required scope | `sites:write` -
@@ -560,10 +556,10 @@ Required scope | `sites:write` ```typescript await client.sites.publish("580e63e98c9a982ac9b8b741", { customDomains: ["660c6449dd97ebc7346ac629", "660c6449dd97ebc7346ac62f"], - publishToWebflowSubdomain: false, + publishToWebflowSubdomain: false }); -``` +``` @@ -578,34 +574,34 @@ await client.sites.publish("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.SitesPublishRequest` - +**request:** `Webflow.SitesPublishRequest` +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
+ ## Collections -
client.collections.list(siteId) -> Webflow.CollectionList
@@ -621,7 +617,6 @@ await client.sites.publish("580e63e98c9a982ac9b8b741", { List of all Collections within a Site. Required scope | `cms:read` -
@@ -637,8 +632,8 @@ Required scope | `cms:read` ```typescript await client.collections.list("580e63e98c9a982ac9b8b741"); -``` +``` @@ -653,20 +648,21 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Collections.RequestOptions` - +**requestOptions:** `Collections.RequestOptions` +
+
@@ -688,7 +684,6 @@ Create a Collection for a site with collection fields. Each collection includes the required _name_ and _slug_ fields, which are generated automatically. You can update the `displayName` of these fields, but the slug for them cannot be changed. Fields slugs are automatically converted to lowercase. Spaces in slugs are replaced with hyphens. Required scope | `cms:write` - @@ -707,32 +702,28 @@ await client.collections.create("580e63e98c9a982ac9b8b741", { displayName: "Blog Posts", singularName: "Blog Post", slug: "posts", - fields: [ - { + fields: [{ isRequired: true, type: "PlainText", displayName: "Title", - helpText: "The title of the blog post", - }, - { + helpText: "The title of the blog post" + }, { isRequired: true, type: "RichText", displayName: "Content", - helpText: "The content of the blog post", - }, - { + helpText: "The content of the blog post" + }, { isRequired: true, type: "Reference", displayName: "Author", helpText: "The author of the blog post", metadata: { - collectionId: "23cc2d952d4e4631ffd4345d2743db4e", - }, - }, - ], + collectionId: "23cc2d952d4e4631ffd4345d2743db4e" + } + }] }); -``` +``` @@ -747,28 +738,29 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.CollectionsCreateRequest` - +**request:** `Webflow.CollectionsCreateRequest` +
-**requestOptions:** `Collections.RequestOptions` - +**requestOptions:** `Collections.RequestOptions` +
+ @@ -788,7 +780,6 @@ await client.collections.create("580e63e98c9a982ac9b8b741", { Get the full details of a collection from its ID. Required scope | `cms:read` - @@ -804,8 +795,8 @@ Required scope | `cms:read` ```typescript await client.collections.get("580e63fc8c9a982ac9b8b745"); -``` +``` @@ -820,20 +811,21 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
**collectionId:** `string` — Unique identifier for a Collection - +
-**requestOptions:** `Collections.RequestOptions` - +**requestOptions:** `Collections.RequestOptions` +
+ @@ -853,7 +845,6 @@ await client.collections.get("580e63fc8c9a982ac9b8b745"); Delete a collection using its ID. Required scope | `cms:write` - @@ -869,8 +860,8 @@ Required scope | `cms:write` ```typescript await client.collections.delete("580e63fc8c9a982ac9b8b745"); -``` +``` @@ -885,26 +876,26 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
**collectionId:** `string` — Unique identifier for a Collection - +
-**requestOptions:** `Collections.RequestOptions` - +**requestOptions:** `Collections.RequestOptions` +
+ ## Pages -
client.pages.list(siteId, { ...params }) -> Webflow.PageList
@@ -920,7 +911,6 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745"); List of all pages for a site. Required scope | `pages:read` -
@@ -938,10 +928,10 @@ Required scope | `pages:read` await client.pages.list("580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", limit: 1.1, - offset: 1.1, + offset: 1.1 }); -``` +``` @@ -956,28 +946,29 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.PagesListRequest` - +**request:** `Webflow.PagesListRequest` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
+
@@ -997,7 +988,6 @@ await client.pages.list("580e63e98c9a982ac9b8b741", { Get metadata information for a single page. Required scope | `pages:read` - @@ -1013,10 +1003,10 @@ Required scope | `pages:read` ```typescript await client.pages.getMetadata("63c720f9347c2139b248e552", { - localeId: "65427cf400e02b306eaa04a0", + localeId: "65427cf400e02b306eaa04a0" }); -``` +``` @@ -1031,28 +1021,29 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.PagesGetMetadataRequest` - +**request:** `Webflow.PagesGetMetadataRequest` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
+ @@ -1072,7 +1063,6 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", { Update Page-level metadata, including SEO and Open Graph fields. Required scope | `pages:write` - @@ -1093,18 +1083,17 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", { slug: "guide-to-the-galaxy", seo: { title: "The Ultimate Hitchhiker's Guide to the Galaxy", - description: - "Everything you need to know about the galaxy, from avoiding Vogon poetry to the importance of towels.", + description: "Everything you need to know about the galaxy, from avoiding Vogon poetry to the importance of towels." }, openGraph: { title: "Explore the Cosmos with The Ultimate Guide", titleCopied: false, description: "Dive deep into the mysteries of the universe with your guide to everything galactic.", - descriptionCopied: false, - }, + descriptionCopied: false + } }); -``` +``` @@ -1119,28 +1108,29 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.PageMetadataWrite` - +**request:** `Webflow.PageMetadataWrite` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
+ @@ -1159,10 +1149,9 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", { Get text and component instance content from a static page. -Localization +Localization Required scope | `pages:read` - @@ -1180,10 +1169,10 @@ Required scope | `pages:read` await client.pages.getContent("63c720f9347c2139b248e552", { localeId: "65427cf400e02b306eaa04a0", limit: 1.1, - offset: 1.1, + offset: 1.1 }); -``` +``` @@ -1198,28 +1187,29 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.PagesGetContentRequest` - +**request:** `Webflow.PagesGetContentRequest` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
+ @@ -1239,7 +1229,6 @@ await client.pages.getContent("63c720f9347c2139b248e552", { This endpoint updates content on a static page in **secondary locales**. It supports updating up to 1000 nodes in a single request. Before making updates: - 1. Use the [get page content](/data/reference/pages-and-components/pages/get-content) endpoint to identify available content nodes and their types. 2. If the page has component instances, retrieve the component's properties that you'll override using the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint. 3. DOM elements may include a `data-w-id` attribute. This attribute is used by Webflow to maintain custom attributes and links across locales. Always include the original `data-w-id` value in your update requests to ensure consistent behavior across all locales. @@ -1249,7 +1238,6 @@ Before making updates: Required scope | `pages:write` - @@ -1266,54 +1254,41 @@ Required scope | `pages:write` ```typescript await client.pages.updateStaticContent("63c720f9347c2139b248e552", { localeId: "localeId", - nodes: [ - { + nodes: [{ nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - text: "

The Hitchhiker's Guide to the Galaxy

", - }, - { + text: "

The Hitchhiker's Guide to the Galaxy

" + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad627", - text: "

Don't Panic!

Always know where your towel is.

", - }, - { + text: "

Don't Panic!

Always know where your towel is.

" + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad635", - choices: [ - { + choices: [{ value: "choice-1", - text: "First choice", - }, - { + text: "First choice" + }, { value: "choice-2", - text: "Second choice", - }, - ], - }, - { + text: "Second choice" + }] + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad642", - placeholder: "Enter something here...", - }, - { + placeholder: "Enter something here..." + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad671", value: "Submit", - waitingText: "Submitting...", - }, - { + waitingText: "Submitting..." + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", - propertyOverrides: [ - { + propertyOverrides: [{ propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0", - text: "

Time is an illusion

", - }, - { + text: "

Time is an illusion

" + }, { propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f1", - text: "Life, the Universe and Everything", - }, - ], - }, - ], + text: "Life, the Universe and Everything" + }] + }] }); -``` +``` @@ -1328,34 +1303,34 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.PageDomWrite` - +**request:** `Webflow.PageDomWrite` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
+ ## Components -
client.components.list(siteId, { ...params }) -> Webflow.ComponentList
@@ -1371,7 +1346,6 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", { List of all components for a site. Required scope | `components:read` -
@@ -1389,10 +1363,10 @@ Required scope | `components:read` await client.components.list("580e63e98c9a982ac9b8b741", { branchId: "68026fa68ef6dc744c75b833", limit: 1.1, - offset: 1.1, + offset: 1.1 }); -``` +``` @@ -1407,28 +1381,29 @@ await client.components.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.ComponentsListRequest` - +**request:** `Webflow.ComponentsListRequest` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
+
@@ -1451,7 +1426,6 @@ To retrieve dynamic content set by component properties, use the [get component If you do not provide a Locale ID in your request, the response will return any content that can be localized from the Primary locale. Required scope | `components:read` - @@ -1470,10 +1444,10 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62 localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", limit: 1.1, - offset: 1.1, + offset: 1.1 }); -``` +``` @@ -1488,7 +1462,7 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62
**siteId:** `string` — Unique identifier for a Site - +
@@ -1496,28 +1470,29 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62
**componentId:** `string` — Unique identifier for a Component - +
-**request:** `Webflow.ComponentsGetContentRequest` - +**request:** `Webflow.ComponentsGetContentRequest` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
+ @@ -1537,7 +1512,6 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62 This endpoint updates content within a component defintion for **secondary locales**. It supports updating up to 1000 nodes in a single request. Before making updates: - 1. Use the [get component content](/data/reference/pages-and-components/components/get-content) endpoint to identify available content nodes and their types. 2. If your component definition has a component instance nested within it, retrieve the nested component instance's properties that you'll override using the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint. 3. DOM elements may include a `data-w-id` attribute. This attribute is used by Webflow to maintain custom attributes and links across locales. Always include the original `data-w-id` value in your update requests to ensure consistent behavior across all locales. @@ -1547,7 +1521,6 @@ Before making updates: Required scope | `components:write` - @@ -1565,54 +1538,41 @@ Required scope | `components:write` await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", - nodes: [ - { + nodes: [{ nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - text: "

The Hitchhiker's Guide to the Galaxy

", - }, - { + text: "

The Hitchhiker's Guide to the Galaxy

" + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad627", - text: "

Don't Panic!

Always know where your towel is.

", - }, - { + text: "

Don't Panic!

Always know where your towel is.

" + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad635", - choices: [ - { + choices: [{ value: "choice-1", - text: "First choice", - }, - { + text: "First choice" + }, { value: "choice-2", - text: "Second choice", - }, - ], - }, - { + text: "Second choice" + }] + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad642", - placeholder: "Enter something here...", - }, - { + placeholder: "Enter something here..." + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad671", value: "Submit", - waitingText: "Submitting...", - }, - { + waitingText: "Submitting..." + }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", - propertyOverrides: [ - { + propertyOverrides: [{ propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0", - text: "

Time is an illusion

", - }, - { + text: "

Time is an illusion

" + }, { propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f1", - text: "Life, the Universe and Everything", - }, - ], - }, - ], + text: "Life, the Universe and Everything" + }] + }] }); -``` +``` @@ -1627,7 +1587,7 @@ await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72
**siteId:** `string` — Unique identifier for a Site - +
@@ -1635,28 +1595,29 @@ await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72
**componentId:** `string` — Unique identifier for a Component - +
-**request:** `Webflow.ComponentDomWrite` - +**request:** `Webflow.ComponentDomWrite` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
+ @@ -1678,7 +1639,6 @@ Get the default property values of a component definition. If you do not include a `localeId` in your request, the response will return any properties that can be localized from the Primary locale. Required scope | `components:read` - @@ -1697,10 +1657,10 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72 localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", limit: 1.1, - offset: 1.1, + offset: 1.1 }); -``` +``` @@ -1715,7 +1675,7 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72
**siteId:** `string` — Unique identifier for a Site - +
@@ -1723,28 +1683,29 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72
**componentId:** `string` — Unique identifier for a Component - +
-**request:** `Webflow.ComponentsGetPropertiesRequest` - +**request:** `Webflow.ComponentsGetPropertiesRequest` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
+ @@ -1764,14 +1725,12 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72 Update the default property values of a component definition in a specificed locale. Before making updates: - 1. Use the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint to identify properties that can be updated in a secondary locale. 2. Rich Text properties may include a `data-w-id` attribute. This attribute is used by Webflow to maintain links across locales. Always include the original `data-w-id` value in your update requests to ensure consistent behavior across all locales. The request requires a secondary locale ID. If a `localeId` is missing, the request will not be processed and will result in an error. Required scope | `components:write` - @@ -1789,19 +1748,16 @@ Required scope | `components:write` await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", - properties: [ - { + properties: [{ propertyId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - text: "The Hitchhiker\u2019s Guide to the Galaxy", - }, - { + text: "The Hitchhiker\u2019s Guide to the Galaxy" + }, { propertyId: "a245c12d-995b-55ee-5ec7-aa36a6cad627", - text: "

Dont Panic!

Always know where your towel is.

", - }, - ], + text: "

Dont Panic!

Always know where your towel is.

" + }] }); -``` +``` @@ -1816,7 +1772,7 @@ await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-e
**siteId:** `string` — Unique identifier for a Site - +
@@ -1824,34 +1780,34 @@ await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-e
**componentId:** `string` — Unique identifier for a Component - +
-**request:** `Webflow.ComponentPropertiesWrite` - +**request:** `Webflow.ComponentPropertiesWrite` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
+ ## Scripts -
client.scripts.list(siteId) -> Webflow.RegisteredScriptList
@@ -1871,7 +1827,6 @@ Get a list of scripts that have been registered to a site. A site can have a max Required scope | `custom_code:read` -
@@ -1887,8 +1842,8 @@ Required scope | `custom_code:read` ```typescript await client.scripts.list("580e63e98c9a982ac9b8b741"); -``` +``` @@ -1903,20 +1858,21 @@ await client.scripts.list("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+
@@ -1940,7 +1896,6 @@ Register a hosted script to a site. Required scope | `custom_code:write` - @@ -1959,10 +1914,10 @@ await client.scripts.registerHosted("580e63e98c9a982ac9b8b741", { hostedLocation: "hostedLocation", integrityHash: "integrityHash", version: "version", - displayName: "displayName", + displayName: "displayName" }); -``` +``` @@ -1977,28 +1932,29 @@ await client.scripts.registerHosted("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.CustomCodeHostedRequest` - +**request:** `Webflow.CustomCodeHostedRequest` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+ @@ -2022,7 +1978,6 @@ Register an inline script to a site. Inline scripts are limited to 2000 characte Required scope | `custom_code:write` - @@ -2040,10 +1995,10 @@ Required scope | `custom_code:write` await client.scripts.registerInline("580e63e98c9a982ac9b8b741", { sourceCode: "alert('hello world');", version: "0.0.1", - displayName: "Alert", + displayName: "Alert" }); -``` +``` @@ -2058,34 +2013,34 @@ await client.scripts.registerInline("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.CustomCodeInlineRequest` - +**request:** `Webflow.CustomCodeInlineRequest` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+ ## Assets -
client.assets.list(siteId, { ...params }) -> Webflow.Assets
@@ -2101,7 +2056,6 @@ await client.scripts.registerInline("580e63e98c9a982ac9b8b741", { List of assets uploaded to a site Required scope | `assets:read` -
@@ -2118,10 +2072,10 @@ Required scope | `assets:read` ```typescript await client.assets.list("580e63e98c9a982ac9b8b741", { offset: 1.1, - limit: 1.1, + limit: 1.1 }); -``` +``` @@ -2136,28 +2090,29 @@ await client.assets.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.AssetsListRequest` - +**request:** `Webflow.AssetsListRequest` +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
+
@@ -2174,16 +2129,18 @@ await client.assets.list("580e63e98c9a982ac9b8b741", {
-The first step in uploading an asset to a site. +The first step in uploading an asset to a site. + This endpoint generates a response with the following information: `uploadUrl` and `uploadDetails`. -Use these properties in the header of a [POST request to Amazson s3](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) to complete the upload. -To learn more about how to upload assets to Webflow, see our [assets guide](/data/docs/working-with-assets). +Use these properties in the header of a [POST request to Amazson s3](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) to complete the upload. -Required scope | `assets:write` +To learn more about how to upload assets to Webflow, see our [assets guide](/data/docs/working-with-assets). + + Required scope | `assets:write`
@@ -2200,10 +2157,10 @@ Required scope | `assets:write` ```typescript await client.assets.create("580e63e98c9a982ac9b8b741", { fileName: "file.png", - fileHash: "3c7d87c9575702bc3b1e991f4d3c638e", + fileHash: "3c7d87c9575702bc3b1e991f4d3c638e" }); -``` +``` @@ -2218,28 +2175,29 @@ await client.assets.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.AssetsCreateRequest` - +**request:** `Webflow.AssetsCreateRequest` +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
+ @@ -2259,7 +2217,6 @@ await client.assets.create("580e63e98c9a982ac9b8b741", { Get details about an asset Required scope | `assets:read` - @@ -2275,8 +2232,8 @@ Required scope | `assets:read` ```typescript await client.assets.get("580e63fc8c9a982ac9b8b745"); -``` +``` @@ -2291,20 +2248,21 @@ await client.assets.get("580e63fc8c9a982ac9b8b745");
**assetId:** `string` — Unique identifier for an Asset on a site - +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
+ @@ -2324,7 +2282,6 @@ await client.assets.get("580e63fc8c9a982ac9b8b745"); Delete an Asset Required Scope: `assets: write` - @@ -2340,8 +2297,8 @@ Required Scope: `assets: write` ```typescript await client.assets.delete("580e63fc8c9a982ac9b8b745"); -``` +``` @@ -2356,20 +2313,21 @@ await client.assets.delete("580e63fc8c9a982ac9b8b745");
**assetId:** `string` — Unique identifier for an Asset on a site - +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
+ @@ -2389,7 +2347,6 @@ await client.assets.delete("580e63fc8c9a982ac9b8b745"); Update details of an Asset. Required scope | `assets:write` - @@ -2405,8 +2362,8 @@ Required scope | `assets:write` ```typescript await client.assets.update("580e63fc8c9a982ac9b8b745"); -``` +``` @@ -2421,28 +2378,29 @@ await client.assets.update("580e63fc8c9a982ac9b8b745");
**assetId:** `string` — Unique identifier for an Asset on a site - +
-**request:** `Webflow.AssetsUpdateRequest` - +**request:** `Webflow.AssetsUpdateRequest` +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
+ @@ -2462,7 +2420,6 @@ await client.assets.update("580e63fc8c9a982ac9b8b745"); List Asset Folders within a given site Required scope | `assets:read` - @@ -2478,8 +2435,8 @@ Required scope | `assets:read` ```typescript await client.assets.listFolders("580e63e98c9a982ac9b8b741"); -``` +``` @@ -2494,20 +2451,21 @@ await client.assets.listFolders("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
+ @@ -2527,7 +2485,6 @@ await client.assets.listFolders("580e63e98c9a982ac9b8b741"); Create an Asset Folder within a given site Required scope | `assets:write` - @@ -2543,10 +2500,10 @@ Required scope | `assets:write` ```typescript await client.assets.createFolder("580e63e98c9a982ac9b8b741", { - displayName: "my asset folder", + displayName: "my asset folder" }); -``` +``` @@ -2561,28 +2518,29 @@ await client.assets.createFolder("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.AssetsCreateFolderRequest` - +**request:** `Webflow.AssetsCreateFolderRequest` +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
+ @@ -2602,7 +2560,6 @@ await client.assets.createFolder("580e63e98c9a982ac9b8b741", { Get details about a specific Asset Folder Required scope | `assets:read` - @@ -2618,8 +2575,8 @@ Required scope | `assets:read` ```typescript await client.assets.getFolder("6390c49774a71f0e3c1a08ee"); -``` +``` @@ -2634,26 +2591,26 @@ await client.assets.getFolder("6390c49774a71f0e3c1a08ee");
**assetFolderId:** `string` — Unique identifier for an Asset Folder - +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
+ ## Webhooks -
client.webhooks.list(siteId) -> Webflow.WebhookList
@@ -2669,7 +2626,6 @@ await client.assets.getFolder("6390c49774a71f0e3c1a08ee"); List all App-created Webhooks registered for a given site Required scope | `sites:read` -
@@ -2685,8 +2641,8 @@ Required scope | `sites:read` ```typescript await client.webhooks.list("580e63e98c9a982ac9b8b741"); -``` +``` @@ -2701,20 +2657,21 @@ await client.webhooks.list("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Webhooks.RequestOptions` - +**requestOptions:** `Webhooks.RequestOptions` +
+
@@ -2737,7 +2694,6 @@ Limit of 75 registrations per `triggerType`, per site. Access to this endpoint requires a bearer token from a [Data Client App](/data/docs/getting-started-data-clients). Required scope | `sites:write` - @@ -2759,10 +2715,10 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", { workspaceId: "4f4e46fd476ea8c507000001", siteId: "562ac0395358780a1f5e6fbd", lastTriggered: new Date("2023-02-08T23:59:28.000Z"), - createdOn: new Date("2022-11-08T23:59:28.000Z"), + createdOn: new Date("2022-11-08T23:59:28.000Z") }); -``` +``` @@ -2777,28 +2733,29 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Webhook` - +**request:** `Webflow.Webhook` +
-**requestOptions:** `Webhooks.RequestOptions` - +**requestOptions:** `Webhooks.RequestOptions` +
+ @@ -2818,7 +2775,6 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", { Get a specific Webhook instance Required scope: `sites:read` - @@ -2834,8 +2790,8 @@ Required scope: `sites:read` ```typescript await client.webhooks.get("580e64008c9a982ac9b8b754"); -``` +``` @@ -2850,20 +2806,21 @@ await client.webhooks.get("580e64008c9a982ac9b8b754");
**webhookId:** `string` — Unique identifier for a Webhook - +
-**requestOptions:** `Webhooks.RequestOptions` - +**requestOptions:** `Webhooks.RequestOptions` +
+ @@ -2883,7 +2840,6 @@ await client.webhooks.get("580e64008c9a982ac9b8b754"); Remove a Webhook Required scope: `sites:read` - @@ -2899,8 +2855,8 @@ Required scope: `sites:read` ```typescript await client.webhooks.delete("580e64008c9a982ac9b8b754"); -``` +``` @@ -2915,26 +2871,26 @@ await client.webhooks.delete("580e64008c9a982ac9b8b754");
**webhookId:** `string` — Unique identifier for a Webhook - +
-**requestOptions:** `Webhooks.RequestOptions` - +**requestOptions:** `Webhooks.RequestOptions` +
+ ## Forms -
client.forms.list(siteId, { ...params }) -> Webflow.FormList
@@ -2950,7 +2906,6 @@ await client.webhooks.delete("580e64008c9a982ac9b8b754"); List forms for a given site. Required scope | `forms:read` -
@@ -2967,10 +2922,10 @@ Required scope | `forms:read` ```typescript await client.forms.list("580e63e98c9a982ac9b8b741", { limit: 1.1, - offset: 1.1, + offset: 1.1 }); -``` +``` @@ -2985,28 +2940,29 @@ await client.forms.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.FormsListRequest` - +**request:** `Webflow.FormsListRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+
@@ -3026,7 +2982,6 @@ await client.forms.list("580e63e98c9a982ac9b8b741", { Get information about a given form. Required scope | `forms:read` - @@ -3042,8 +2997,8 @@ Required scope | `forms:read` ```typescript await client.forms.get("580e63e98c9a982ac9b8b741"); -``` +``` @@ -3058,20 +3013,21 @@ await client.forms.get("580e63e98c9a982ac9b8b741");
**formId:** `string` — Unique identifier for a Form - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ @@ -3097,7 +3053,6 @@ List form submissions for a given form Required scope | `forms:read` - @@ -3114,10 +3069,10 @@ Required scope | `forms:read` ```typescript await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", { offset: 1.1, - limit: 1.1, + limit: 1.1 }); -``` +``` @@ -3132,28 +3087,29 @@ await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", {
**formId:** `string` — Unique identifier for a Form - +
-**request:** `Webflow.FormsListSubmissionsRequest` - +**request:** `Webflow.FormsListSubmissionsRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ @@ -3173,7 +3129,6 @@ await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", { Get information about a given form submissio. Required scope | `forms:read` - @@ -3189,8 +3144,8 @@ Required scope | `forms:read` ```typescript await client.forms.getSubmission("580e63e98c9a982ac9b8b741"); -``` +``` @@ -3205,20 +3160,21 @@ await client.forms.getSubmission("580e63e98c9a982ac9b8b741");
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ @@ -3237,8 +3193,8 @@ await client.forms.getSubmission("580e63e98c9a982ac9b8b741"); Delete a form submission -Required scope | `forms:write` +Required scope | `forms:write` @@ -3254,8 +3210,8 @@ Required scope | `forms:write` ```typescript await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741"); -``` +``` @@ -3270,20 +3226,21 @@ await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741");
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ @@ -3303,7 +3260,6 @@ await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741"); Update hidden fields on a form submission Required scope | `forms:write` - @@ -3319,8 +3275,8 @@ Required scope | `forms:write` ```typescript await client.forms.updateSubmission("580e63e98c9a982ac9b8b741"); -``` +``` @@ -3335,34 +3291,34 @@ await client.forms.updateSubmission("580e63e98c9a982ac9b8b741");
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**request:** `Webflow.FormsUpdateSubmissionRequest` - +**request:** `Webflow.FormsUpdateSubmissionRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ ## Users -
client.users.list(siteId, { ...params }) -> Webflow.UserList
@@ -3378,7 +3334,6 @@ await client.forms.updateSubmission("580e63e98c9a982ac9b8b741"); Get a list of users for a site Required scope | `users:read` -
@@ -3396,10 +3351,10 @@ Required scope | `users:read` await client.users.list("580e63e98c9a982ac9b8b741", { offset: 1.1, limit: 1.1, - sort: "CreatedOn", + sort: "CreatedOn" }); -``` +``` @@ -3414,28 +3369,29 @@ await client.users.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.UsersListRequest` - +**request:** `Webflow.UsersListRequest` +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
+
@@ -3455,7 +3411,6 @@ await client.users.list("580e63e98c9a982ac9b8b741", { Get a User by ID Required scope | `users:read` - @@ -3471,8 +3426,8 @@ Required scope | `users:read` ```typescript await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); -``` +``` @@ -3487,7 +3442,7 @@ await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
@@ -3495,20 +3450,21 @@ await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741");
**userId:** `string` — Unique identifier for a User - +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
+ @@ -3528,7 +3484,6 @@ await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); Delete a User by ID Required scope | `users:write` - @@ -3544,8 +3499,8 @@ Required scope | `users:write` ```typescript await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); -``` +``` @@ -3560,7 +3515,7 @@ await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
**siteId:** `string` — Unique identifier for a Site - +
@@ -3568,20 +3523,21 @@ await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
**userId:** `string` — Unique identifier for a User - +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
+ @@ -3598,13 +3554,12 @@ await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
-Update a User by ID +Update a User by ID -Required scope | `users:write` + Required scope | `users:write` The email and password fields cannot be updated using this endpoint -
@@ -3627,15 +3582,13 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741" createdOn: new Date("2022-05-20T13:46:12.000Z"), lastLogin: new Date("2022-05-20T13:46:12.000Z"), status: "verified", - accessGroups: [ - { + accessGroups: [{ slug: "webflowers", - type: "admin", - }, - ], + type: "admin" + }] }); -``` +``` @@ -3650,7 +3603,7 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
**siteId:** `string` — Unique identifier for a Site - +
@@ -3658,28 +3611,29 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
**userId:** `string` — Unique identifier for a User - +
-**request:** `Webflow.User` - +**request:** `Webflow.User` +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
+ @@ -3696,12 +3650,11 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
-Create and invite a user with an email address. +Create and invite a user with an email address. -The user will be sent and invite via email, which they will need to accept in order to join paid any paid access group. +The user will be sent and invite via email, which they will need to accept in order to join paid any paid access group. Required scope | `users:write` -
@@ -3718,10 +3671,10 @@ Required scope | `users:write` ```typescript await client.users.invite("580e63e98c9a982ac9b8b741", { email: "some.one@home.com", - accessGroups: ["accessGroups"], + accessGroups: ["accessGroups"] }); -``` +``` @@ -3736,34 +3689,34 @@ await client.users.invite("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.UsersInviteRequest` - +**request:** `Webflow.UsersInviteRequest` +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
+ ## AccessGroups -
client.accessGroups.list(siteId, { ...params }) -> Webflow.AccessGroupList
@@ -3779,7 +3732,6 @@ await client.users.invite("580e63e98c9a982ac9b8b741", { Get a list of access groups for a site Required scope | `users:read` -
@@ -3797,10 +3749,10 @@ Required scope | `users:read` await client.accessGroups.list("580e63e98c9a982ac9b8b741", { offset: 1.1, limit: 1.1, - sort: "CreatedOn", + sort: "CreatedOn" }); -``` +``` @@ -3815,34 +3767,34 @@ await client.accessGroups.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.AccessGroupsListRequest` - +**request:** `Webflow.AccessGroupsListRequest` +
-**requestOptions:** `AccessGroups.RequestOptions` - +**requestOptions:** `AccessGroups.RequestOptions` +
+
## Products -
client.products.list(siteId, { ...params }) -> Webflow.ProductAndSkUsList
@@ -3855,13 +3807,12 @@ await client.accessGroups.list("580e63e98c9a982ac9b8b741", {
-Retrieve all products for a site. +Retrieve all products for a site. Use `limit` and `offset` to page through all products with subsequent requests. All SKUs for each product will also be fetched and returned. The `limit`, `offset` and `total` values represent Products only and do not include any SKUs. Required scope | `ecommerce:read` -
@@ -3878,10 +3829,10 @@ Required scope | `ecommerce:read` ```typescript await client.products.list("580e63e98c9a982ac9b8b741", { offset: 1.1, - limit: 1.1, + limit: 1.1 }); -``` +```
@@ -3896,28 +3847,29 @@ await client.products.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.ProductsListRequest` - +**request:** `Webflow.ProductsListRequest` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
+
@@ -3937,15 +3889,13 @@ await client.products.list("580e63e98c9a982ac9b8b741", { Create a new ecommerce product and defaultSKU. A product, at minimum, must have a single SKU. To create a product with multiple SKUs: - -- First, create a list of `sku-properties`, also known as [product options](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). For example, a T-shirt product may have a "color" `sku-property`, with a list of enum values: red, yellow, and blue, another `sku-property` may be "size", with a list of enum values: small, medium, and large. -- Once, a product is created with a list of `sku-properties`, Webflow will create a **default SKU**, which is always a combination of the first `enum` values of each `sku-property`. (e.g. Small - Red - T-Shirt) -- After creation, you can create additional SKUs for the product, using the [Create SKUs endpoint.](/data/reference/ecommerce/products/create-sku) + - First, create a list of `sku-properties`, also known as [product options](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). For example, a T-shirt product may have a "color" `sku-property`, with a list of enum values: red, yellow, and blue, another `sku-property` may be "size", with a list of enum values: small, medium, and large. + - Once, a product is created with a list of `sku-properties`, Webflow will create a **default SKU**, which is always a combination of the first `enum` values of each `sku-property`. (e.g. Small - Red - T-Shirt) + - After creation, you can create additional SKUs for the product, using the [Create SKUs endpoint.](/data/reference/ecommerce/products/create-sku) Upon creation, the default product type will be `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` - @@ -3967,51 +3917,40 @@ await client.products.create("580e63e98c9a982ac9b8b741", { name: "Colorful T-shirt", slug: "colorful-t-shirt", description: "Our best-selling t-shirt available in multiple colors and sizes", - skuProperties: [ - { + skuProperties: [{ id: "color", name: "Color", - enum: [ - { + "enum": [{ id: "red", name: "Red", - slug: "red", - }, - { + slug: "red" + }, { id: "yellow", name: "Yellow", - slug: "yellow", - }, - { + slug: "yellow" + }, { id: "blue", name: "Blue", - slug: "blue", - }, - ], - }, - { + slug: "blue" + }] + }, { id: "size", name: "Size", - enum: [ - { + "enum": [{ id: "small", name: "Small", - slug: "small", - }, - { + slug: "small" + }, { id: "medium", name: "Medium", - slug: "medium", - }, - { + slug: "medium" + }, { id: "large", name: "Large", - slug: "large", - }, - ], - }, - ], - }, + slug: "large" + }] + }] + } }, sku: { fieldData: { @@ -4020,15 +3959,14 @@ await client.products.create("580e63e98c9a982ac9b8b741", { price: { value: 2499, unit: "USD", - currency: "USD", + currency: "USD" }, - mainImage: - "https://rocketamp-sample-store.myshopify.com/cdn/shop/products/Gildan_2000_Antique_Cherry_Red_Front_1024x1024.jpg?v=1527232987", - }, - }, + mainImage: "https://rocketamp-sample-store.myshopify.com/cdn/shop/products/Gildan_2000_Antique_Cherry_Red_Front_1024x1024.jpg?v=1527232987" + } + } }); -``` +``` @@ -4043,28 +3981,29 @@ await client.products.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.ProductSkuCreate` - +**request:** `Webflow.ProductSkuCreate` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
+ @@ -4085,7 +4024,6 @@ Retrieve a single product by its ID. All of its SKUs will also be retrieved. Required scope | `ecommerce:read` - @@ -4101,8 +4039,8 @@ Required scope | `ecommerce:read` ```typescript await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"); -``` +``` @@ -4117,7 +4055,7 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
**siteId:** `string` — Unique identifier for a Site - +
@@ -4125,20 +4063,21 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
**productId:** `string` — Unique identifier for a Product - +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
+ @@ -4160,7 +4099,6 @@ Update an existing Product. 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. Required scope | `ecommerce:write` - @@ -4176,8 +4114,8 @@ Required scope | `ecommerce:write` ```typescript await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"); -``` +``` @@ -4192,7 +4130,7 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
**siteId:** `string` — Unique identifier for a Site - +
@@ -4200,28 +4138,29 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
**productId:** `string` — Unique identifier for a Product - +
-**request:** `Webflow.ProductSkuUpdate` - +**request:** `Webflow.ProductSkuUpdate` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
+ @@ -4243,7 +4182,6 @@ Create additional SKUs to manage every [option and variant of your Product.](htt 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. Required scope | `ecommerce:write` - @@ -4259,8 +4197,7 @@ Required scope | `ecommerce:write` ```typescript await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745", { - skus: [ - { + skus: [{ id: "66072fb71b89448912e2681c", cmsLocaleId: "653ad57de882f528b32e810e", lastPublished: new Date("2023-03-17T18:47:35.000Z"), @@ -4272,14 +4209,13 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b price: { value: 2499, unit: "USD", - currency: "USD", - }, - }, - }, - ], + currency: "USD" + } + } + }] }); -``` +``` @@ -4294,7 +4230,7 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**siteId:** `string` — Unique identifier for a Site - +
@@ -4302,28 +4238,29 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**productId:** `string` — Unique identifier for a Product - +
-**request:** `Webflow.ProductsCreateSkuRequest` - +**request:** `Webflow.ProductsCreateSkuRequest` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
+ @@ -4345,7 +4282,6 @@ Update a specified SKU. 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. Required scope | `ecommerce:write` - @@ -4373,13 +4309,13 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b price: { value: 2499, unit: "USD", - currency: "USD", - }, - }, - }, + currency: "USD" + } + } + } }); -``` +``` @@ -4394,7 +4330,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**siteId:** `string` — Unique identifier for a Site - +
@@ -4402,7 +4338,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**productId:** `string` — Unique identifier for a Product - +
@@ -4410,34 +4346,34 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**skuId:** `string` — Unique identifier for a SKU - +
-**request:** `Webflow.ProductsUpdateSkuRequest` - +**request:** `Webflow.ProductsUpdateSkuRequest` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
+ ## Orders -
client.orders.list(siteId, { ...params }) -> Webflow.OrderList
@@ -4453,7 +4389,6 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b List all orders created for a given site. Required scope | `ecommerce:read` -
@@ -4471,10 +4406,10 @@ Required scope | `ecommerce:read` await client.orders.list("580e63e98c9a982ac9b8b741", { status: "pending", offset: 1.1, - limit: 1.1, + limit: 1.1 }); -``` +``` @@ -4489,28 +4424,29 @@ await client.orders.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.OrdersListRequest` - +**request:** `Webflow.OrdersListRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+
@@ -4531,7 +4467,6 @@ Retrieve a single product by its ID. All of its SKUs will also be retrieved. Required scope | `ecommerce:read` - @@ -4547,8 +4482,8 @@ Required scope | `ecommerce:read` ```typescript await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); -``` +``` @@ -4563,7 +4498,7 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
**siteId:** `string` — Unique identifier for a Site - +
@@ -4571,20 +4506,21 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
**orderId:** `string` — Unique identifier for an Order - +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -4606,7 +4542,6 @@ and/or `shippingTracking` for a given order. All three fields can be updated simultaneously or independently. Required scope | `ecommerce:write` - @@ -4622,8 +4557,8 @@ Required scope | `ecommerce:write` ```typescript await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); -``` +``` @@ -4638,7 +4573,7 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
**siteId:** `string` — Unique identifier for a Site - +
@@ -4646,28 +4581,29 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
**orderId:** `string` — Unique identifier for an Order - +
-**request:** `Webflow.OrdersUpdateRequest` - +**request:** `Webflow.OrdersUpdateRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -4687,7 +4623,6 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415 Updates an order's status to fulfilled Required scope | `ecommerce:write` - @@ -4703,8 +4638,8 @@ Required scope | `ecommerce:write` ```typescript await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); -``` +``` @@ -4719,7 +4654,7 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407
**siteId:** `string` — Unique identifier for a Site - +
@@ -4727,28 +4662,29 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407
**orderId:** `string` — Unique identifier for an Order - +
-**request:** `Webflow.OrdersUpdateFulfillRequest` - +**request:** `Webflow.OrdersUpdateFulfillRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -4768,7 +4704,6 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407 Updates an order's status to unfulfilled Required scope | `ecommerce:write` - @@ -4784,8 +4719,8 @@ Required scope | `ecommerce:write` ```typescript await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); -``` +``` @@ -4800,7 +4735,7 @@ await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e14704
**siteId:** `string` — Unique identifier for a Site - +
@@ -4808,20 +4743,21 @@ await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e14704
**orderId:** `string` — Unique identifier for an Order - +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -4842,7 +4778,6 @@ This API will reverse a Stripe charge and refund an order back to a customer. It will also set the order's status to `refunded`. Required scope | `ecommerce:write` - @@ -4858,8 +4793,8 @@ Required scope | `ecommerce:write` ```typescript await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); -``` +``` @@ -4874,7 +4809,7 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
**siteId:** `string` — Unique identifier for a Site - +
@@ -4882,34 +4817,34 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
**orderId:** `string` — Unique identifier for an Order - +
-**request:** `Webflow.OrdersRefundRequest` - +**request:** `Webflow.OrdersRefundRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ ## Inventory -
client.inventory.list(skuCollectionId, skuId) -> Webflow.InventoryItem
@@ -4925,7 +4860,6 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415 List the current inventory levels for a particular SKU item. Required scope | `ecommerce:read` -
@@ -4941,8 +4875,8 @@ Required scope | `ecommerce:read` ```typescript await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc415"); -``` +``` @@ -4957,7 +4891,7 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
**skuCollectionId:** `string` — Unique identifier for a SKU collection. Use the List Collections API to find this ID. - +
@@ -4965,20 +4899,21 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
**skuId:** `string` — Unique identifier for a SKU - +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+
@@ -4995,15 +4930,13 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
-Updates the current inventory levels for a particular SKU item. +Updates the current inventory levels for a particular SKU item. -Updates may be given in one or two methods, absolutely or incrementally. - -- Absolute updates are done by setting `quantity` directly. +Updates may be given in one or two methods, absolutely or incrementally. +- Absolute updates are done by setting `quantity` directly. - Incremental updates are by specifying the inventory delta in `updateQuantity` which is then added to the `quantity` stored on the server. Required scope | `ecommerce:write` -
@@ -5019,10 +4952,10 @@ Required scope | `ecommerce:write` ```typescript await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc415", { - inventoryType: "infinite", + inventoryType: "infinite" }); -``` +``` @@ -5037,7 +4970,7 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc
**skuCollectionId:** `string` — Unique identifier for a SKU collection. Use the List Collections API to find this ID. - +
@@ -5045,34 +4978,34 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc
**skuId:** `string` — Unique identifier for a SKU - +
-**request:** `Webflow.InventoryUpdateRequest` - +**request:** `Webflow.InventoryUpdateRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ ## Ecommerce -
client.ecommerce.getSettings(siteId) -> Webflow.EcommerceSettings
@@ -5088,7 +5021,6 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc Retrieve ecommerce settings for a site. Required scope | `ecommerce:read` -
@@ -5104,8 +5036,8 @@ Required scope | `ecommerce:read` ```typescript await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741"); -``` +``` @@ -5120,26 +5052,26 @@ await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Ecommerce.RequestOptions` - +**requestOptions:** `Ecommerce.RequestOptions` +
+
## Collections Fields -
client.collections.fields.create(collectionId, { ...params }) -> Webflow.FieldCreate
@@ -5159,7 +5091,6 @@ Field validation is currently not available through the API. Bulk creation of fields is not supported with this endpoint. To add multiple fields at once, include them when you [create the collection.](/data/v2.0.0/reference/cms/collections/create) Required scope | `cms:write` -
@@ -5180,10 +5111,10 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { isRequired: false, type: "RichText", displayName: "Post Body", - helpText: "Add the body of your post here", + helpText: "Add the body of your post here" }); -``` +``` @@ -5198,28 +5129,29 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.FieldCreate` - +**request:** `Webflow.FieldCreate` +
-**requestOptions:** `Fields.RequestOptions` - +**requestOptions:** `Fields.RequestOptions` +
+
@@ -5239,7 +5171,6 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { Delete a custom field in a collection. This endpoint does not currently support bulk deletion. Required scope | `cms:write` - @@ -5255,8 +5186,8 @@ Required scope | `cms:write` ```typescript await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745"); -``` +``` @@ -5271,7 +5202,7 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -5279,20 +5210,21 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
**fieldId:** `string` — Unique identifier for a Field in a collection - +
-**requestOptions:** `Fields.RequestOptions` - +**requestOptions:** `Fields.RequestOptions` +
+ @@ -5312,7 +5244,6 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a Update a custom field in a collection. Required scope | `cms:write` - @@ -5330,10 +5261,10 @@ Required scope | `cms:write` await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745", { isRequired: false, displayName: "Post Body", - helpText: "Add the body of your post here", + helpText: "Add the body of your post here" }); -``` +``` @@ -5348,7 +5279,7 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -5356,34 +5287,34 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
**fieldId:** `string` — Unique identifier for a Field in a collection - +
-**request:** `Webflow.collections.FieldUpdate` - +**request:** `Webflow.collections.FieldUpdate` +
-**requestOptions:** `Fields.RequestOptions` - +**requestOptions:** `Fields.RequestOptions` +
+ ## Collections Items -
client.collections.items.listItems(collectionId, { ...params }) -> Webflow.CollectionItemList
@@ -5399,7 +5330,6 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a List of all Items within a Collection. Required scope | `CMS:read` -
@@ -5421,10 +5351,10 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", { name: "name", slug: "slug", sortBy: "lastPublished", - sortOrder: "asc", + sortOrder: "asc" }); -``` +``` @@ -5439,28 +5369,29 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsListItemsRequest` - +**request:** `Webflow.collections.ItemsListItemsRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+
@@ -5479,10 +5410,10 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", { Create Item(s) in a Collection. + To create items across multiple locales, please use [this endpoint.](/data/reference/cms/collection-items/staged-items/create-items) Required scope | `CMS:write` - @@ -5505,11 +5436,45 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", { fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - }, - }, + "plain-text": "Don't Panic.", + "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + "fileId": "62b720ef280c7a7a3be8cabe", + "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + }, + "image-gallery": [ + { + "fileId": "62b720ef280c7a7a3be8cabd", + "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + }, + { + "fileId": "62b720ef280c7a7a3be8cabe", + "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + } + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: [ + "62b720ef280c7a7a3be8cab1", + "62b720ef280c7a7a3be8cab2" + ], + "downloadable-asset": { + "fileId": "62b720ef280c7a7a3be8cab3", + "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + } + } + } }); -``` +``` @@ -5524,28 +5489,29 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsCreateItemRequest` - +**request:** `Webflow.collections.ItemsCreateItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -5567,7 +5533,6 @@ Delete Items from a Collection. Items will only be deleted in the primary locale unless a `cmsLocaleId` is included in the request. Required scope | `CMS:write` - @@ -5583,14 +5548,12 @@ Required scope | `CMS:write` ```typescript await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", { - items: [ - { - id: "580e64008c9a982ac9b8b754", - }, - ], + items: [{ + id: "580e64008c9a982ac9b8b754" + }] }); -``` +``` @@ -5605,28 +5568,29 @@ await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsDeleteItemsRequest` - +**request:** `Webflow.collections.ItemsDeleteItemsRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -5650,7 +5614,6 @@ The limit for this endpoint is 100 items. Items will only be updated in the primary locale, unless a `cmsLocaleId` is included in the request. Required scope | `CMS:write` - @@ -5667,43 +5630,42 @@ Required scope | `CMS:write` ```typescript await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { skipInvalidFiles: true, - items: [ - { + items: [{ id: "66f6ed9576ddacf3149d5ea6", cmsLocaleId: "66f6e966c9e1dc700a857ca5", fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas", - }, - }, - { + featured: false + } + }, { id: "66f6ed9576ddacf3149d5ea6", cmsLocaleId: "66f6e966c9e1dc700a857ca4", fieldData: { name: "No Entrar en P\u00E1nico", slug: "no-entrar-en-panico", - }, - }, - { + featured: false + } + }, { id: "66f6ed9576ddacf3149d5eaa", cmsLocaleId: "66f6e966c9e1dc700a857ca5", fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci", - }, - }, - { + featured: false + } + }, { id: "66f6ed9576ddacf3149d5eaa", cmsLocaleId: "66f6e966c9e1dc700a857ca4", fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias", - }, - }, - ], + featured: false + } + }] }); -``` +``` @@ -5718,28 +5680,29 @@ await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsUpdateItemsRequest` - +**request:** `Webflow.collections.ItemsUpdateItemsRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -5763,7 +5726,6 @@ List all published items in a collection. Required scope | `CMS:read` - @@ -5785,10 +5747,10 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { name: "name", slug: "slug", sortBy: "lastPublished", - sortOrder: "asc", + sortOrder: "asc" }); -``` +``` @@ -5803,28 +5765,29 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsListItemsLiveRequest` - +**request:** `Webflow.collections.ItemsListItemsLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -5843,10 +5806,11 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { Create item(s) in a collection that will be immediately published to the live site. + To create items across multiple locales, [please use this endpoint.](/data/reference/cms/collection-items/staged-items/create-items) -Required scope | `CMS:write` +Required scope | `CMS:write` @@ -5869,11 +5833,45 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - }, - }, + "plain-text": "Don't Panic.", + "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + "fileId": "62b720ef280c7a7a3be8cabe", + "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + }, + "image-gallery": [ + { + "fileId": "62b720ef280c7a7a3be8cabd", + "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + }, + { + "fileId": "62b720ef280c7a7a3be8cabe", + "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + } + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: [ + "62b720ef280c7a7a3be8cab1", + "62b720ef280c7a7a3be8cab2" + ], + "downloadable-asset": { + "fileId": "62b720ef280c7a7a3be8cab3", + "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + } + } + } }); -``` +``` @@ -5888,28 +5886,29 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsCreateItemLiveRequest` - +**request:** `Webflow.collections.ItemsCreateItemLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -5926,12 +5925,11 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
-Unpublish up to 100 items from the live site and set the `isDraft` property to `true`. +Unpublish up to 100 items from the live site and set the `isDraft` property to `true`. Items will only be unpublished in the primary locale unless a `cmsLocaleId` is included in the request. Required scope | `CMS:write` -
@@ -5947,14 +5945,12 @@ Required scope | `CMS:write` ```typescript await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", { - items: [ - { - id: "580e64008c9a982ac9b8b754", - }, - ], + items: [{ + id: "580e64008c9a982ac9b8b754" + }] }); -``` +``` @@ -5969,28 +5965,29 @@ await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsDeleteItemsLiveRequest` - +**request:** `Webflow.collections.ItemsDeleteItemsLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6012,7 +6009,6 @@ Update a single published item or multiple published items (up to 100) in a Coll Items will only be updated in the primary locale, unless a `cmsLocaleId` is included in the request. Required scope | `CMS:write` - @@ -6029,43 +6025,42 @@ Required scope | `CMS:write` ```typescript await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { skipInvalidFiles: true, - items: [ - { + items: [{ id: "66f6ed9576ddacf3149d5ea6", cmsLocaleId: "66f6e966c9e1dc700a857ca5", fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas", - }, - }, - { + featured: false + } + }, { id: "66f6ed9576ddacf3149d5ea6", cmsLocaleId: "66f6e966c9e1dc700a857ca4", fieldData: { name: "No Entrar en P\u00E1nico", slug: "no-entrar-en-panico", - }, - }, - { + featured: false + } + }, { id: "66f6ed9576ddacf3149d5eaa", cmsLocaleId: "66f6e966c9e1dc700a857ca5", fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci", - }, - }, - { + featured: false + } + }, { id: "66f6ed9576ddacf3149d5eaa", cmsLocaleId: "66f6e966c9e1dc700a857ca4", fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias", - }, - }, - ], + featured: false + } + }] }); -``` +``` @@ -6080,28 +6075,29 @@ await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsUpdateItemsLiveRequest` - +**request:** `Webflow.collections.ItemsUpdateItemsLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6126,7 +6122,6 @@ Create an item or multiple items in a CMS Collection across multiple correspondi Required scope | `CMS:write` - @@ -6148,11 +6143,11 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { isDraft: false, fieldData: { name: "Don\u2019t Panic", - slug: "dont-panic", - }, + slug: "dont-panic" + } }); -``` +``` @@ -6167,28 +6162,29 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.CreateBulkCollectionItemRequestBody` - +**request:** `Webflow.collections.CreateBulkCollectionItemRequestBody` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6208,7 +6204,6 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { Get details of a selected Collection Item. Required scope | `CMS:read` - @@ -6224,10 +6219,10 @@ Required scope | `CMS:read` ```typescript await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754", { - cmsLocaleId: "cmsLocaleId", + cmsLocaleId: "cmsLocaleId" }); -``` +``` @@ -6242,7 +6237,7 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6250,28 +6245,29 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsGetItemRequest` - +**request:** `Webflow.collections.ItemsGetItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6288,10 +6284,9 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-Delete an item from a collection. +Delete an item from a collection. Required scope | `CMS:write` -
@@ -6307,10 +6302,10 @@ Required scope | `CMS:write` ```typescript await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754", { - cmsLocaleId: "cmsLocaleId", + cmsLocaleId: "cmsLocaleId" }); -``` +``` @@ -6325,7 +6320,7 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6333,28 +6328,29 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsDeleteItemRequest` - +**request:** `Webflow.collections.ItemsDeleteItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6374,7 +6370,6 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008 Update a selected Item in a Collection. Required scope | `CMS:write` - @@ -6397,11 +6392,45 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008 fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - }, - }, + "plain-text": "Don't Panic.", + "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + "fileId": "62b720ef280c7a7a3be8cabe", + "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + }, + "image-gallery": [ + { + "fileId": "62b720ef280c7a7a3be8cabd", + "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + }, + { + "fileId": "62b720ef280c7a7a3be8cabe", + "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + } + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: [ + "62b720ef280c7a7a3be8cab1", + "62b720ef280c7a7a3be8cab2" + ], + "downloadable-asset": { + "fileId": "62b720ef280c7a7a3be8cab3", + "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + } + } + } }); -``` +``` @@ -6416,7 +6445,7 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6424,28 +6453,29 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsUpdateItemRequest` - +**request:** `Webflow.collections.ItemsUpdateItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6469,7 +6499,6 @@ Get details of a selected Collection live Item. Required scope | `CMS:read` - @@ -6485,10 +6514,10 @@ Required scope | `CMS:read` ```typescript await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754", { - cmsLocaleId: "cmsLocaleId", + cmsLocaleId: "cmsLocaleId" }); -``` +``` @@ -6503,7 +6532,7 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6511,28 +6540,29 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsGetItemLiveRequest` - +**request:** `Webflow.collections.ItemsGetItemLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6549,12 +6579,11 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
-Unpublish a live item from the site and set the `isDraft` property to `true`. +Unpublish a live item from the site and set the `isDraft` property to `true`. For bulk unpublishing, please use [this endpoint.](/data/v2.0.0/reference/cms/collection-items/live-items/delete-items-live) Required scope | `CMS:write` -
@@ -6570,10 +6599,10 @@ Required scope | `CMS:write` ```typescript await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754", { - cmsLocaleId: "cmsLocaleId", + cmsLocaleId: "cmsLocaleId" }); -``` +``` @@ -6588,7 +6617,7 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6596,28 +6625,29 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsDeleteItemLiveRequest` - +**request:** `Webflow.collections.ItemsDeleteItemLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6637,7 +6667,6 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6 Update a selected live Item in a Collection. The updates for this Item will be published to the live site. Required scope | `CMS:write` - @@ -6660,11 +6689,45 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6 fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - }, - }, + "plain-text": "Don't Panic.", + "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + "fileId": "62b720ef280c7a7a3be8cabe", + "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + }, + "image-gallery": [ + { + "fileId": "62b720ef280c7a7a3be8cabd", + "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + }, + { + "fileId": "62b720ef280c7a7a3be8cabe", + "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + } + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: [ + "62b720ef280c7a7a3be8cab1", + "62b720ef280c7a7a3be8cab2" + ], + "downloadable-asset": { + "fileId": "62b720ef280c7a7a3be8cab3", + "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + } + } + } }); -``` +``` @@ -6679,7 +6742,7 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6687,28 +6750,29 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsUpdateItemLiveRequest` - +**request:** `Webflow.collections.ItemsUpdateItemLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ @@ -6728,7 +6792,6 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6 Publish an item or multiple items. Required scope | `cms:write` - @@ -6744,10 +6807,10 @@ Required scope | `cms:write` ```typescript await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { - itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], + itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"] }); -``` +``` @@ -6762,34 +6825,34 @@ await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.ItemsPublishItemRequest` - +**request:** `Webflow.ItemsPublishItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
+ ## Pages Scripts -
client.pages.scripts.getCustomCode(pageId) -> Webflow.ScriptApplyList
@@ -6802,10 +6865,9 @@ await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", {
-Get all scripts applied to a page. +Get all scripts applied to a page. Required scope | `custom_code:read` -
@@ -6821,8 +6883,8 @@ Required scope | `custom_code:read` ```typescript await client.pages.scripts.getCustomCode("63c720f9347c2139b248e552"); -``` +```
@@ -6837,20 +6899,21 @@ await client.pages.scripts.getCustomCode("63c720f9347c2139b248e552");
**pageId:** `string` — Unique identifier for a Page - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+
@@ -6874,7 +6937,6 @@ Apply registered scripts to a page. If you have multiple scripts your App needs Required scope | `custom_code:write` - @@ -6890,24 +6952,21 @@ Required scope | `custom_code:write` ```typescript await client.pages.scripts.upsertCustomCode("63c720f9347c2139b248e552", { - scripts: [ - { + scripts: [{ id: "cms_slider", location: "header", version: "1.0.0", attributes: { - "my-attribute": "some-value", - }, - }, - { + "my-attribute": "some-value" + } + }, { id: "alert", location: "header", - version: "0.0.1", - }, - ], + version: "0.0.1" + }] }); -``` +``` @@ -6922,28 +6981,29 @@ await client.pages.scripts.upsertCustomCode("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.ScriptApplyList` - +**request:** `Webflow.ScriptApplyList` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+ @@ -6967,7 +7027,6 @@ To remove individual scripts applied by the App, use the [Add/Update Custom Code Access to this endpoint requires a bearer token obtained from an [OAuth Code Grant Flow](/data/reference/oauth-app). Required scope | `custom_code:write` - @@ -6983,8 +7042,8 @@ Required scope | `custom_code:write` ```typescript await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552"); -``` +``` @@ -6999,26 +7058,26 @@ await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552");
**pageId:** `string` — Unique identifier for a Page - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+ ## Sites Redirects -
client.sites.redirects.list(siteId) -> Webflow.Redirects
@@ -7038,7 +7097,6 @@ Use this endpoint to review, audit, or manage the redirection rules that control This endpoint requires an Enterprise workspace. Required scope: `sites:read` -
@@ -7054,8 +7112,8 @@ Required scope: `sites:read` ```typescript await client.sites.redirects.list("580e63e98c9a982ac9b8b741"); -``` +``` @@ -7070,20 +7128,21 @@ await client.sites.redirects.list("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Redirects.RequestOptions` - +**requestOptions:** `Redirects.RequestOptions` +
+
@@ -7107,7 +7166,6 @@ This endpoint allows you to define a source path (`fromUrl`) and its correspondi This endpoint requires an Enterprise workspace. Required scope: `sites:write` - @@ -7125,10 +7183,10 @@ Required scope: `sites:write` await client.sites.redirects.create("580e63e98c9a982ac9b8b741", { id: "42e1a2b7aa1a13f768a0042a", fromUrl: "/mostly-harmless", - toUrl: "/earth", + toUrl: "/earth" }); -``` +``` @@ -7143,28 +7201,29 @@ await client.sites.redirects.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Redirect` - +**request:** `Webflow.Redirect` +
-**requestOptions:** `Redirects.RequestOptions` - +**requestOptions:** `Redirects.RequestOptions` +
+ @@ -7188,7 +7247,6 @@ This is useful for cleaning up outdated or unnecessary redirects, ensuring that This endpoint requires an Enterprise workspace. Required scope: `sites:write` - @@ -7204,8 +7262,8 @@ Required scope: `sites:write` ```typescript await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35ed19500e6"); -``` +``` @@ -7220,7 +7278,7 @@ await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
**siteId:** `string` — Unique identifier for a Site - +
@@ -7228,20 +7286,21 @@ await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
**redirectId:** `string` — Unique identifier site rediect - +
-**requestOptions:** `Redirects.RequestOptions` - +**requestOptions:** `Redirects.RequestOptions` +
+ @@ -7263,7 +7322,6 @@ Update a 301 redirection rule from a site. This endpoint requires an Enterprise workspace. Required scope: `sites:write` - @@ -7281,10 +7339,10 @@ Required scope: `sites:write` await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35ed19500e6", { id: "42e1a2b7aa1a13f768a0042a", fromUrl: "/mostly-harmless", - toUrl: "/earth", + toUrl: "/earth" }); -``` +``` @@ -7299,7 +7357,7 @@ await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
**siteId:** `string` — Unique identifier for a Site - +
@@ -7307,34 +7365,34 @@ await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
**redirectId:** `string` — Unique identifier site rediect - +
-**request:** `Webflow.Redirect` - +**request:** `Webflow.Redirect` +
-**requestOptions:** `Redirects.RequestOptions` - +**requestOptions:** `Redirects.RequestOptions` +
+ ## Sites Plans -
client.sites.plans.getSitePlan(siteId) -> Webflow.SitePlan
@@ -7352,7 +7410,6 @@ Get site plan details for the specified Site. This endpoint requires an Enterprise workspace. Required scope | `sites:read` -
@@ -7368,8 +7425,8 @@ Required scope | `sites:read` ```typescript await client.sites.plans.getSitePlan("580e63e98c9a982ac9b8b741"); -``` +``` @@ -7384,26 +7441,26 @@ await client.sites.plans.getSitePlan("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Plans.RequestOptions` - +**requestOptions:** `Plans.RequestOptions` +
+
## Sites RobotsTxt -
client.sites.robotsTxt.get(siteId) -> Webflow.Robots
@@ -7421,7 +7478,6 @@ Retrieve the robots.txt configuration for various user agents. This endpoint requires an Enterprise workspace. Required scope: `site_config:read` -
@@ -7437,8 +7493,8 @@ Required scope: `site_config:read` ```typescript await client.sites.robotsTxt.get("580e63e98c9a982ac9b8b741"); -``` +``` @@ -7453,20 +7509,21 @@ await client.sites.robotsTxt.get("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `RobotsTxt.RequestOptions` - +**requestOptions:** `RobotsTxt.RequestOptions` +
+
@@ -7488,7 +7545,6 @@ Replace the `robots.txt` configuration for various user agents. This endpoint requires an Enterprise workspace. Required scope | `site_config:write` - @@ -7504,17 +7560,15 @@ Required scope | `site_config:write` ```typescript await client.sites.robotsTxt.put("580e63e98c9a982ac9b8b741", { - rules: [ - { + rules: [{ userAgent: "googlebot", allows: ["/public"], - disallows: ["/vogon-poetry", "/total-perspective-vortex"], - }, - ], - sitemap: "https://heartofgold.ship/sitemap.xml", + disallows: ["/vogon-poetry", "/total-perspective-vortex"] + }], + sitemap: "https://heartofgold.ship/sitemap.xml" }); -``` +``` @@ -7529,28 +7583,29 @@ await client.sites.robotsTxt.put("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Robots` - +**request:** `Webflow.Robots` +
-**requestOptions:** `RobotsTxt.RequestOptions` - +**requestOptions:** `RobotsTxt.RequestOptions` +
+ @@ -7574,7 +7629,6 @@ Remove specific rules for a user-agent in your `robots.txt` file. To delete all This endpoint requires an Enterprise workspace. Required scope: `site_config:write` - @@ -7590,16 +7644,14 @@ Required scope: `site_config:write` ```typescript await client.sites.robotsTxt.delete("580e63e98c9a982ac9b8b741", { - rules: [ - { + rules: [{ userAgent: "*", allows: ["/public"], - disallows: ["/bubbles"], - }, - ], + disallows: ["/bubbles"] + }] }); -``` +``` @@ -7614,28 +7666,29 @@ await client.sites.robotsTxt.delete("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Robots` - +**request:** `Webflow.Robots` +
-**requestOptions:** `RobotsTxt.RequestOptions` - +**requestOptions:** `RobotsTxt.RequestOptions` +
+ @@ -7657,7 +7710,6 @@ Update the `robots.txt` configuration for various user agents. This endpoint requires an Enterprise workspace. Required scope | `site_config:write` - @@ -7673,17 +7725,15 @@ Required scope | `site_config:write` ```typescript await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", { - rules: [ - { + rules: [{ userAgent: "googlebot", allows: ["/public"], - disallows: ["/vogon-poetry", "/total-perspective-vortex"], - }, - ], - sitemap: "https://heartofgold.ship/sitemap.xml", + disallows: ["/vogon-poetry", "/total-perspective-vortex"] + }], + sitemap: "https://heartofgold.ship/sitemap.xml" }); -``` +``` @@ -7698,34 +7748,34 @@ await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Robots` - +**request:** `Webflow.Robots` +
-**requestOptions:** `RobotsTxt.RequestOptions` - +**requestOptions:** `RobotsTxt.RequestOptions` +
+ ## Sites WellKnown -
client.sites.wellKnown.put(siteId, { ...params }) -> void
@@ -7741,11 +7791,10 @@ await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", { Upload a supported well-known file to a site. The current restrictions on well-known files are as follows: - -- Each file must be smaller than 100kb -- Less than 30 total files -- Have one of the following file extensions (or no extension): `.txt`, `.json`, `.noext` - + - Each file must be smaller than 100kb + - Less than 30 total files + - Have one of the following file extensions (or no extension): `.txt`, `.json`, `.noext` + `.noext` is a special file extension that removes other extensions. For example, `apple-app-site-association.noext.txt` will be uploaded as `apple-app-site-association`. Use this extension for tools that have trouble uploading extensionless files. @@ -7753,7 +7802,6 @@ The current restrictions on well-known files are as follows: This endpoint requires an Enterprise workspace. Required scope: `site_config:write` -
@@ -7770,12 +7818,11 @@ Required scope: `site_config:write` ```typescript await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", { fileName: "apple-app-site-association.txt", - fileData: - '{\n "applinks": {\n "apps": [],\n "details": [\n {\n "appID": "ABCDE12345.com.example.app",\n "paths": [ "/*", "/some/path/*" ]\n }\n ]\n }\n}\n', - contentType: "application/json", + fileData: "{\n \"applinks\": {\n \"apps\": [],\n \"details\": [\n {\n \"appID\": \"ABCDE12345.com.example.app\",\n \"paths\": [ \"/*\", \"/some/path/*\" ]\n }\n ]\n }\n}\n", + contentType: "application/json" }); -``` +``` @@ -7790,28 +7837,29 @@ await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.WellKnownFile` - +**request:** `Webflow.sites.WellKnownFile` +
-**requestOptions:** `WellKnown.RequestOptions` - +**requestOptions:** `WellKnown.RequestOptions` +
+
@@ -7833,7 +7881,6 @@ Delete existing well-known files from a site. This endpoint requires an Enterprise workspace. Required scope: `site_config:write` - @@ -7849,8 +7896,8 @@ Required scope: `site_config:write` ```typescript await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741"); -``` +``` @@ -7865,34 +7912,34 @@ await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.WellKnownDeleteRequest` - +**request:** `Webflow.sites.WellKnownDeleteRequest` +
-**requestOptions:** `WellKnown.RequestOptions` - +**requestOptions:** `WellKnown.RequestOptions` +
+ ## Sites ActivityLogs -
client.sites.activityLogs.list(siteId, { ...params }) -> Webflow.SiteActivityLogResponse
@@ -7905,12 +7952,11 @@ await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741");
-Retrieve Activity Logs for a specific Site. +Retrieve Activity Logs for a specific Site. This endpoint requires an Enterprise workspace. Required scope: `site_activity:read` -
@@ -7927,10 +7973,10 @@ Required scope: `site_activity:read` ```typescript await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", { limit: 1.1, - offset: 1.1, + offset: 1.1 }); -``` +```
@@ -7945,34 +7991,34 @@ await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.ActivityLogsListRequest` - +**request:** `Webflow.sites.ActivityLogsListRequest` +
-**requestOptions:** `ActivityLogs.RequestOptions` - +**requestOptions:** `ActivityLogs.RequestOptions` +
+
## Sites Comments -
client.sites.comments.listCommentThreads(siteId, { ...params }) -> Webflow.CommentThreadList
@@ -7992,7 +8038,6 @@ List all comment threads for a site. Required scope | `comments:read` -
@@ -8012,10 +8057,10 @@ await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", { offset: 1.1, limit: 1.1, sortBy: "createdOn", - sortOrder: "asc", + sortOrder: "asc" }); -``` +``` @@ -8030,28 +8075,29 @@ await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.CommentsListCommentThreadsRequest` - +**request:** `Webflow.sites.CommentsListCommentThreadsRequest` +
-**requestOptions:** `Comments.RequestOptions` - +**requestOptions:** `Comments.RequestOptions` +
+
@@ -8075,7 +8121,6 @@ Get details of a specific comment thread. Required scope | `comments:read` - @@ -8095,10 +8140,10 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63 offset: 1.1, limit: 1.1, sortBy: "createdOn", - sortOrder: "asc", + sortOrder: "asc" }); -``` +``` @@ -8113,7 +8158,7 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63
**siteId:** `string` — Unique identifier for a Site - +
@@ -8121,28 +8166,29 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63
**commentThreadId:** `string` — Unique identifier for a Comment Thread - +
-**request:** `Webflow.sites.CommentsGetCommentThreadRequest` - +**request:** `Webflow.sites.CommentsGetCommentThreadRequest` +
-**requestOptions:** `Comments.RequestOptions` - +**requestOptions:** `Comments.RequestOptions` +
+ @@ -8166,7 +8212,6 @@ List all replies to a specific comment thread. Required scope | `comments:read` - @@ -8186,10 +8231,10 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e offset: 1.1, limit: 1.1, sortBy: "createdOn", - sortOrder: "asc", + sortOrder: "asc" }); -``` +``` @@ -8204,7 +8249,7 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
**siteId:** `string` — Unique identifier for a Site - +
@@ -8212,34 +8257,34 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
**commentThreadId:** `string` — Unique identifier for a Comment Thread - +
-**request:** `Webflow.sites.CommentsListCommentRepliesRequest` - +**request:** `Webflow.sites.CommentsListCommentRepliesRequest` +
-**requestOptions:** `Comments.RequestOptions` - +**requestOptions:** `Comments.RequestOptions` +
+ ## Sites Scripts -
client.sites.scripts.getCustomCode(siteId) -> Webflow.ScriptApplyList
@@ -8252,14 +8297,13 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
-Get all scripts applied to a site by the App. +Get all scripts applied to a site by the App. To apply a script to a site or page, the script must first be registered to a site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. See the documentation on [working with Custom Code](/data/docs/custom-code) for more information. - + Required scope | `custom_code:read` -
@@ -8275,8 +8319,8 @@ Required scope | `custom_code:read` ```typescript await client.sites.scripts.getCustomCode("580e63e98c9a982ac9b8b741"); -``` +```
@@ -8291,20 +8335,21 @@ await client.sites.scripts.getCustomCode("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+
@@ -8328,7 +8373,6 @@ Apply registered scripts to a site. If you have multiple scripts your App needs Required scope | `custom_code:write` - @@ -8344,24 +8388,21 @@ Required scope | `custom_code:write` ```typescript await client.sites.scripts.upsertCustomCode("580e63e98c9a982ac9b8b741", { - scripts: [ - { + scripts: [{ id: "cms_slider", location: "header", version: "1.0.0", attributes: { - "my-attribute": "some-value", - }, - }, - { + "my-attribute": "some-value" + } + }, { id: "alert", location: "header", - version: "0.0.1", - }, - ], + version: "0.0.1" + }] }); -``` +``` @@ -8376,28 +8417,29 @@ await client.sites.scripts.upsertCustomCode("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.ScriptApplyList` - +**request:** `Webflow.ScriptApplyList` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+ @@ -8421,7 +8463,6 @@ To remove individual scripts applied by the App, use the [Add/Update Custom Code Access to this endpoint requires a bearer token obtained from an [OAuth Code Grant Flow](/data/reference/oauth-app). Required scope | `custom_code:write` - @@ -8437,8 +8478,8 @@ Required scope | `custom_code:write` ```typescript await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741"); -``` +``` @@ -8453,20 +8494,21 @@ await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+ @@ -8483,7 +8525,7 @@ await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741");
-Get a list of scripts that have been applied to a site and/or individual pages. +Get a list of scripts that have been applied to a site and/or individual pages. To apply a script to a site or page, the script must first be registered to a site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. @@ -8492,7 +8534,6 @@ Get a list of scripts that have been applied to a site and/or individual pages. Required scope | `custom_code:read` -
@@ -8509,10 +8550,10 @@ Required scope | `custom_code:read` ```typescript await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", { offset: 1.1, - limit: 1.1, + limit: 1.1 }); -``` +``` @@ -8527,34 +8568,34 @@ await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.ScriptsListCustomCodeBlocksRequest` - +**request:** `Webflow.sites.ScriptsListCustomCodeBlocksRequest` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
+ ## Sites Forms -
client.sites.forms.listSubmissionsBySite(siteId, { ...params }) -> Webflow.FormSubmissionList
@@ -8569,7 +8610,7 @@ await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", { List all form submissions for a given site with the ability to filter submissions by a centralized `elementId`. -Add `elementId` when you want to filter form submissions to a specific form in a site. You can get the `elementId` from the [List forms endpoint](/data/reference/forms/forms/list) (displayed as `formElementId` in the response). +Add `elementId` when you want to filter form submissions to a specific form in a site. You can get the `elementId` from the [List forms endpoint](/data/reference/forms/forms/list) (displayed as `formElementId` in the response). When a form is used in a Webflow component definition, each instance of the component will yield a unique form. Adding the `elementId` in this request ensures this API response includes all submissions from that core form, wherever that form is used in instantiated components. @@ -8578,7 +8619,6 @@ When a form is used in a Webflow component definition, each instance of the comp Use the [List Form Submissions endpoint](/data/reference/forms/form-submissions/list-submissions) to list form submissions for a given form ID. Required scope | `forms:read` -
@@ -8596,10 +8636,10 @@ Required scope | `forms:read` await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", { elementId: "18259716-3e5a-646a-5f41-5dc4b9405aa0", offset: 1.1, - limit: 1.1, + limit: 1.1 }); -``` +``` @@ -8614,28 +8654,29 @@ await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.FormsListSubmissionsBySiteRequest` - +**request:** `Webflow.sites.FormsListSubmissionsBySiteRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+
@@ -8652,12 +8693,11 @@ await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", {
-List form submissions for a given form ID within a specific site. +List form submissions for a given form ID within a specific site. Use the [List Form Submissions by Site endpoint](/data/reference/forms/form-submissions/list-submissions-by-site) to list form submissions for a given site with the ability to filter by a `formElementId`. Required scope | `forms:read` -
@@ -8674,10 +8714,10 @@ Required scope | `forms:read` ```typescript await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { offset: 1.1, - limit: 1.1, + limit: 1.1 }); -``` +``` @@ -8692,7 +8732,7 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c
**siteId:** `string` — Unique identifier for a Site - +
@@ -8700,28 +8740,29 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c
**formId:** `string` — Unique identifier for a Form - +
-**request:** `Webflow.sites.FormsListSubmissionsRequest` - +**request:** `Webflow.sites.FormsListSubmissionsRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ @@ -8741,7 +8782,6 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c Get information about a form submission within a specific site. Required scope | `forms:read` - @@ -8757,8 +8797,8 @@ Required scope | `forms:read` ```typescript await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); -``` +``` @@ -8773,7 +8813,7 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a
**siteId:** `string` — Unique identifier for a Site - +
@@ -8781,20 +8821,21 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ @@ -8814,7 +8855,6 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a Delete a form submission within a specific site. Required scope | `forms:write` - @@ -8830,8 +8870,8 @@ Required scope | `forms:write` ```typescript await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); -``` +``` @@ -8846,7 +8886,7 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98
**siteId:** `string` — Unique identifier for a Site - +
@@ -8854,20 +8894,21 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ @@ -8887,7 +8928,6 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98 Update hidden fields on a form submission within a specific site. Required scope | `forms:write` - @@ -8903,8 +8943,8 @@ Required scope | `forms:write` ```typescript await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); -``` +``` @@ -8919,7 +8959,7 @@ await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98
**siteId:** `string` — Unique identifier for a Site - +
@@ -8927,34 +8967,34 @@ await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**request:** `Webflow.sites.FormsUpdateSubmissionRequest` - +**request:** `Webflow.sites.FormsUpdateSubmissionRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
+ ## Workspaces AuditLogs -
client.workspaces.auditLogs.getWorkspaceAuditLogs(workspaceIdOrSlug, { ...params }) -> Webflow.WorkspaceAuditLogResponse
@@ -8972,7 +9012,6 @@ Get audit logs for a workspace. This endpoint requires an Enterprise workspace and a workspace token with the `workspace_activity:read` scope. Create a workspace token from your workspace dashboard integrations page to use this endpoint. Required scope | `workspace_activity:read` -
@@ -8993,10 +9032,10 @@ await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace", sortOrder: "asc", eventType: "user_access", from: new Date("2025-06-22T16:00:31.000Z"), - to: new Date("2025-07-22T16:00:31.000Z"), + to: new Date("2025-07-22T16:00:31.000Z") }); -``` +``` @@ -9011,28 +9050,29 @@ await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace",
**workspaceIdOrSlug:** `string` — Unique identifier or slug for a Workspace - +
-**request:** `Webflow.workspaces.AuditLogsGetWorkspaceAuditLogsRequest` - +**request:** `Webflow.workspaces.AuditLogsGetWorkspaceAuditLogsRequest` +
-**requestOptions:** `AuditLogs.RequestOptions` - +**requestOptions:** `AuditLogs.RequestOptions` +
+
diff --git a/src/BaseClient.ts b/src/BaseClient.ts new file mode 100644 index 00000000..4243fb9e --- /dev/null +++ b/src/BaseClient.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "./core"; +import type * as environments from "./environments"; + +export interface BaseClientOptions { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + accessToken?: core.Supplier; + /** Additional headers to include in requests. */ + headers?: Record | null | undefined>; + /** The default maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The default number of times to retry the request. Defaults to 2. */ + maxRetries?: number; +} + +export interface BaseRequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional query string parameters to include in the request. */ + queryParams?: Record; + /** Additional headers to include in the request. */ + headers?: Record | null | undefined>; +} diff --git a/src/Client.ts b/src/Client.ts index a06fbc3e..633f7d6a 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,47 +1,29 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "./environments"; -import * as core from "./core"; -import { mergeHeaders } from "./core/headers.js"; -import { Token } from "./api/resources/token/client/Client"; -import { Sites } from "./api/resources/sites/client/Client"; +import { AccessGroups } from "./api/resources/accessGroups/client/Client"; +import { Assets } from "./api/resources/assets/client/Client"; import { Collections } from "./api/resources/collections/client/Client"; -import { Pages } from "./api/resources/pages/client/Client"; import { Components } from "./api/resources/components/client/Client"; -import { Scripts } from "./api/resources/scripts/client/Client"; -import { Assets } from "./api/resources/assets/client/Client"; -import { Webhooks } from "./api/resources/webhooks/client/Client"; +import { Ecommerce } from "./api/resources/ecommerce/client/Client"; import { Forms } from "./api/resources/forms/client/Client"; -import { Users } from "./api/resources/users/client/Client"; -import { AccessGroups } from "./api/resources/accessGroups/client/Client"; -import { Products } from "./api/resources/products/client/Client"; -import { Orders } from "./api/resources/orders/client/Client"; import { Inventory } from "./api/resources/inventory/client/Client"; -import { Ecommerce } from "./api/resources/ecommerce/client/Client"; +import { Orders } from "./api/resources/orders/client/Client"; +import { Pages } from "./api/resources/pages/client/Client"; +import { Products } from "./api/resources/products/client/Client"; +import { Scripts } from "./api/resources/scripts/client/Client"; +import { Sites } from "./api/resources/sites/client/Client"; +import { Token } from "./api/resources/token/client/Client"; +import { Users } from "./api/resources/users/client/Client"; +import { Webhooks } from "./api/resources/webhooks/client/Client"; import { Workspaces } from "./api/resources/workspaces/client/Client"; +import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient"; +import * as core from "./core"; +import { mergeHeaders } from "./core/headers"; export declare namespace WebflowClient { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } - - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} + + export interface RequestOptions extends BaseRequestOptions {} } export class WebflowClient { @@ -70,8 +52,8 @@ export class WebflowClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.2.2", - "User-Agent": "webflow-api/3.2.2", + "X-Fern-SDK-Version": "3.3.0", + "User-Agent": "webflow-api/3.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/errors/BadRequestError.ts b/src/api/errors/BadRequestError.ts index 1bb67d02..82b8c800 100644 --- a/src/api/errors/BadRequestError.ts +++ b/src/api/errors/BadRequestError.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. +import type * as core from "../../core"; import * as errors from "../../errors/index"; -import * as core from "../../core"; export class BadRequestError extends errors.WebflowError { constructor(body?: unknown, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/ConflictError.ts b/src/api/errors/ConflictError.ts index ca91b050..c26d504e 100644 --- a/src/api/errors/ConflictError.ts +++ b/src/api/errors/ConflictError.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. +import type * as core from "../../core"; import * as errors from "../../errors/index"; -import * as core from "../../core"; export class ConflictError extends errors.WebflowError { constructor(body?: unknown, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/ForbiddenError.ts b/src/api/errors/ForbiddenError.ts index c0b23d1a..42c8a436 100644 --- a/src/api/errors/ForbiddenError.ts +++ b/src/api/errors/ForbiddenError.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. +import type * as core from "../../core"; import * as errors from "../../errors/index"; -import * as core from "../../core"; export class ForbiddenError extends errors.WebflowError { constructor(body?: unknown, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/InternalServerError.ts b/src/api/errors/InternalServerError.ts index c99b6865..6891f521 100644 --- a/src/api/errors/InternalServerError.ts +++ b/src/api/errors/InternalServerError.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. +import type * as core from "../../core"; import * as errors from "../../errors/index"; -import * as Webflow from "../index"; -import * as core from "../../core"; +import type * as Webflow from "../index"; export class InternalServerError extends errors.WebflowError { constructor(body: Webflow.Error_, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts index 29b6a8cc..3a23bbcd 100644 --- a/src/api/errors/NotFoundError.ts +++ b/src/api/errors/NotFoundError.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. +import type * as core from "../../core"; import * as errors from "../../errors/index"; -import * as Webflow from "../index"; -import * as core from "../../core"; +import type * as Webflow from "../index"; export class NotFoundError extends errors.WebflowError { constructor(body: Webflow.Error_, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/TooManyRequestsError.ts b/src/api/errors/TooManyRequestsError.ts index b7a3fa74..b446eae7 100644 --- a/src/api/errors/TooManyRequestsError.ts +++ b/src/api/errors/TooManyRequestsError.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. +import type * as core from "../../core"; import * as errors from "../../errors/index"; -import * as Webflow from "../index"; -import * as core from "../../core"; +import type * as Webflow from "../index"; export class TooManyRequestsError extends errors.WebflowError { constructor(body: Webflow.Error_, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/UnauthorizedError.ts b/src/api/errors/UnauthorizedError.ts index 8d01eef6..00be898b 100644 --- a/src/api/errors/UnauthorizedError.ts +++ b/src/api/errors/UnauthorizedError.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. +import type * as core from "../../core"; import * as errors from "../../errors/index"; -import * as Webflow from "../index"; -import * as core from "../../core"; +import type * as Webflow from "../index"; export class UnauthorizedError extends errors.WebflowError { constructor(body: Webflow.Error_, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 764085c5..fc45046b 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -1,7 +1,7 @@ -export * from "./UnauthorizedError"; -export * from "./ForbiddenError"; export * from "./BadRequestError"; +export * from "./ConflictError"; +export * from "./ForbiddenError"; +export * from "./InternalServerError"; export * from "./NotFoundError"; export * from "./TooManyRequestsError"; -export * from "./InternalServerError"; -export * from "./ConflictError"; +export * from "./UnauthorizedError"; diff --git a/src/api/index.ts b/src/api/index.ts index 30060724..456653b2 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,3 +1,3 @@ +export * from "./errors"; export * from "./resources"; export * from "./types"; -export * from "./errors"; diff --git a/src/api/resources/accessGroups/client/Client.ts b/src/api/resources/accessGroups/client/Client.ts index 40f0c056..6c82a2cd 100644 --- a/src/api/resources/accessGroups/client/Client.ts +++ b/src/api/resources/accessGroups/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import * as serializers from "../../../../serialization/index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace AccessGroups { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class AccessGroups { @@ -78,37 +60,38 @@ export class AccessGroups { const { offset, limit, sort } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (sort != null) { - _queryParams["sort"] = serializers.AccessGroupsListRequestSort.jsonOrThrow(sort, { + _queryParams.sort = serializers.AccessGroupsListRequestSort.jsonOrThrow(sort, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/accessgroups`, + `sites/${core.url.encodePathParam(siteId)}/accessgroups`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/accessGroups/client/index.ts b/src/api/resources/accessGroups/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/accessGroups/client/index.ts +++ b/src/api/resources/accessGroups/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts b/src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts index 49659032..d2d894bc 100644 --- a/src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts +++ b/src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example @@ -13,13 +11,9 @@ import * as Webflow from "../../../../index"; * } */ export interface AccessGroupsListRequest { - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; /** * Sort string to use when ordering access groups diff --git a/src/api/resources/accessGroups/client/requests/index.ts b/src/api/resources/accessGroups/client/requests/index.ts index 709463a1..016ac082 100644 --- a/src/api/resources/accessGroups/client/requests/index.ts +++ b/src/api/resources/accessGroups/client/requests/index.ts @@ -1 +1 @@ -export { type AccessGroupsListRequest } from "./AccessGroupsListRequest"; +export type { AccessGroupsListRequest } from "./AccessGroupsListRequest"; diff --git a/src/api/resources/accessGroups/index.ts b/src/api/resources/accessGroups/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/accessGroups/index.ts +++ b/src/api/resources/accessGroups/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/accessGroups/types/AccessGroupsListRequestSort.ts b/src/api/resources/accessGroups/types/AccessGroupsListRequestSort.ts index 6daa7813..6beca044 100644 --- a/src/api/resources/accessGroups/types/AccessGroupsListRequestSort.ts +++ b/src/api/resources/accessGroups/types/AccessGroupsListRequestSort.ts @@ -1,15 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type AccessGroupsListRequestSort = +export const AccessGroupsListRequestSort = { /** * Sorts users in ascending order based on their created date */ - | "CreatedOn" + CreatedOnAscending: "CreatedOn", /** * Sorts users in descending order based on their created date */ - | "-CreatedOn"; -export const AccessGroupsListRequestSort = { - CreatedOnAscending: "CreatedOn", CreatedOnDescending: "-CreatedOn", } as const; +export type AccessGroupsListRequestSort = + (typeof AccessGroupsListRequestSort)[keyof typeof AccessGroupsListRequestSort]; diff --git a/src/api/resources/assets/client/Client.ts b/src/api/resources/assets/client/Client.ts index 142b83eb..9bf65e68 100644 --- a/src/api/resources/assets/client/Client.ts +++ b/src/api/resources/assets/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Assets { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } /** @@ -79,29 +61,30 @@ export class Assets { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/assets`, + `sites/${core.url.encodePathParam(siteId)}/assets`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -234,28 +217,30 @@ export class Assets { request: Webflow.AssetsCreateRequest, requestOptions?: Assets.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/assets`, + `sites/${core.url.encodePathParam(siteId)}/assets`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.AssetsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -370,21 +355,23 @@ export class Assets { assetId: string, requestOptions?: Assets.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `assets/${encodeURIComponent(assetId)}`, + `assets/${core.url.encodePathParam(assetId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -499,21 +486,23 @@ export class Assets { assetId: string, requestOptions?: Assets.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `assets/${encodeURIComponent(assetId)}`, + `assets/${core.url.encodePathParam(assetId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -625,28 +614,30 @@ export class Assets { request: Webflow.AssetsUpdateRequest = {}, requestOptions?: Assets.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `assets/${encodeURIComponent(assetId)}`, + `assets/${core.url.encodePathParam(assetId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.AssetsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -764,21 +755,23 @@ export class Assets { siteId: string, requestOptions?: Assets.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/asset_folders`, + `sites/${core.url.encodePathParam(siteId)}/asset_folders`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -903,28 +896,30 @@ export class Assets { request: Webflow.AssetsCreateFolderRequest, requestOptions?: Assets.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/asset_folders`, + `sites/${core.url.encodePathParam(siteId)}/asset_folders`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.AssetsCreateFolderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1044,21 +1039,23 @@ export class Assets { assetFolderId: string, requestOptions?: Assets.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `asset_folders/${encodeURIComponent(assetFolderId)}`, + `asset_folders/${core.url.encodePathParam(assetFolderId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/assets/client/index.ts b/src/api/resources/assets/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/assets/client/index.ts +++ b/src/api/resources/assets/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/assets/client/requests/AssetsCreateFolderRequest.ts b/src/api/resources/assets/client/requests/AssetsCreateFolderRequest.ts index 88a07fcd..8f51e850 100644 --- a/src/api/resources/assets/client/requests/AssetsCreateFolderRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsCreateFolderRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/assets/client/requests/AssetsCreateRequest.ts b/src/api/resources/assets/client/requests/AssetsCreateRequest.ts index 71adecd7..847e2e05 100644 --- a/src/api/resources/assets/client/requests/AssetsCreateRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsCreateRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/assets/client/requests/AssetsListRequest.ts b/src/api/resources/assets/client/requests/AssetsListRequest.ts index 982b68c6..2b902dc9 100644 --- a/src/api/resources/assets/client/requests/AssetsListRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsListRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface AssetsListRequest { - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; } diff --git a/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts b/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts index a01981af..bf2e4a76 100644 --- a/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/assets/client/requests/index.ts b/src/api/resources/assets/client/requests/index.ts index 93250a4c..3a711eb1 100644 --- a/src/api/resources/assets/client/requests/index.ts +++ b/src/api/resources/assets/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type AssetsListRequest } from "./AssetsListRequest"; -export { type AssetsCreateRequest } from "./AssetsCreateRequest"; -export { type AssetsUpdateRequest } from "./AssetsUpdateRequest"; -export { type AssetsCreateFolderRequest } from "./AssetsCreateFolderRequest"; +export type { AssetsCreateFolderRequest } from "./AssetsCreateFolderRequest"; +export type { AssetsCreateRequest } from "./AssetsCreateRequest"; +export type { AssetsListRequest } from "./AssetsListRequest"; +export type { AssetsUpdateRequest } from "./AssetsUpdateRequest"; diff --git a/src/api/resources/collections/client/Client.ts b/src/api/resources/collections/client/Client.ts index e04ee1fc..45978fd5 100644 --- a/src/api/resources/collections/client/Client.ts +++ b/src/api/resources/collections/client/Client.ts @@ -1,37 +1,19 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; import { Fields } from "../resources/fields/client/Client"; import { Items } from "../resources/items/client/Client"; export declare namespace Collections { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } /** @@ -82,21 +64,23 @@ export class Collections { siteId: string, requestOptions?: Collections.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/collections`, + `sites/${core.url.encodePathParam(siteId)}/collections`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -243,28 +227,30 @@ export class Collections { request: Webflow.CollectionsCreateRequest, requestOptions?: Collections.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/collections`, + `sites/${core.url.encodePathParam(siteId)}/collections`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CollectionsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -386,21 +372,23 @@ export class Collections { collectionId: string, requestOptions?: Collections.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}`, + `collections/${core.url.encodePathParam(collectionId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -515,21 +503,23 @@ export class Collections { collectionId: string, requestOptions?: Collections.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}`, + `collections/${core.url.encodePathParam(collectionId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/collections/client/index.ts b/src/api/resources/collections/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/collections/client/index.ts +++ b/src/api/resources/collections/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/collections/client/requests/CollectionsCreateRequest.ts b/src/api/resources/collections/client/requests/CollectionsCreateRequest.ts index 63664ff4..2efe1ada 100644 --- a/src/api/resources/collections/client/requests/CollectionsCreateRequest.ts +++ b/src/api/resources/collections/client/requests/CollectionsCreateRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/collections/client/requests/index.ts b/src/api/resources/collections/client/requests/index.ts index ea1464e5..00a158e5 100644 --- a/src/api/resources/collections/client/requests/index.ts +++ b/src/api/resources/collections/client/requests/index.ts @@ -1 +1 @@ -export { type CollectionsCreateRequest } from "./CollectionsCreateRequest"; +export type { CollectionsCreateRequest } from "./CollectionsCreateRequest"; diff --git a/src/api/resources/collections/index.ts b/src/api/resources/collections/index.ts index 4ce0f390..33a87f10 100644 --- a/src/api/resources/collections/index.ts +++ b/src/api/resources/collections/index.ts @@ -1,2 +1,2 @@ -export * from "./resources"; export * from "./client"; +export * from "./resources"; diff --git a/src/api/resources/collections/resources/fields/client/Client.ts b/src/api/resources/collections/resources/fields/client/Client.ts index 0324c0a1..ded9b0b7 100644 --- a/src/api/resources/collections/resources/fields/client/Client.ts +++ b/src/api/resources/collections/resources/fields/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as serializers from "../../../../../../serialization/index"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace Fields { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Fields { @@ -114,28 +96,30 @@ export class Fields { request: Webflow.FieldCreate, requestOptions?: Fields.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/fields`, + `collections/${core.url.encodePathParam(collectionId)}/fields`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.FieldCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -260,21 +244,23 @@ export class Fields { fieldId: string, requestOptions?: Fields.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}`, + `collections/${core.url.encodePathParam(collectionId)}/fields/${core.url.encodePathParam(fieldId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -395,28 +381,30 @@ export class Fields { request: Webflow.collections.FieldUpdate = {}, requestOptions?: Fields.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}`, + `collections/${core.url.encodePathParam(collectionId)}/fields/${core.url.encodePathParam(fieldId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.collections.FieldUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/collections/resources/fields/client/index.ts b/src/api/resources/collections/resources/fields/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/collections/resources/fields/client/index.ts +++ b/src/api/resources/collections/resources/fields/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/collections/resources/fields/client/requests/FieldUpdate.ts b/src/api/resources/collections/resources/fields/client/requests/FieldUpdate.ts index cf3b7b1c..61239be2 100644 --- a/src/api/resources/collections/resources/fields/client/requests/FieldUpdate.ts +++ b/src/api/resources/collections/resources/fields/client/requests/FieldUpdate.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/collections/resources/fields/client/requests/index.ts b/src/api/resources/collections/resources/fields/client/requests/index.ts index 49626c31..9d47d72a 100644 --- a/src/api/resources/collections/resources/fields/client/requests/index.ts +++ b/src/api/resources/collections/resources/fields/client/requests/index.ts @@ -1 +1 @@ -export { type FieldUpdate } from "./FieldUpdate"; +export type { FieldUpdate } from "./FieldUpdate"; diff --git a/src/api/resources/collections/resources/index.ts b/src/api/resources/collections/resources/index.ts index 2452d24a..db2e1bdc 100644 --- a/src/api/resources/collections/resources/index.ts +++ b/src/api/resources/collections/resources/index.ts @@ -1,5 +1,5 @@ -export * as items from "./items"; -export * from "./items/types"; export * as fields from "./fields"; export * from "./fields/client/requests"; +export * as items from "./items"; export * from "./items/client/requests"; +export * from "./items/types"; diff --git a/src/api/resources/collections/resources/items/client/Client.ts b/src/api/resources/collections/resources/items/client/Client.ts index e31891b0..c779706d 100644 --- a/src/api/resources/collections/resources/items/client/Client.ts +++ b/src/api/resources/collections/resources/items/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace Items { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Items { @@ -81,27 +63,27 @@ export class Items { const { cmsLocaleId, offset, limit, name, slug, lastPublished, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams["cmsLocaleId"] = cmsLocaleId; + _queryParams.cmsLocaleId = cmsLocaleId; } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (name != null) { - _queryParams["name"] = name; + _queryParams.name = name; } if (slug != null) { - _queryParams["slug"] = slug; + _queryParams.slug = slug; } if (lastPublished != null) { - _queryParams["lastPublished"] = serializers.ItemsListItemsRequestLastPublished.jsonOrThrow(lastPublished, { + _queryParams.lastPublished = serializers.ItemsListItemsRequestLastPublished.jsonOrThrow(lastPublished, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -110,7 +92,7 @@ export class Items { } if (sortBy != null) { - _queryParams["sortBy"] = serializers.collections.ItemsListItemsRequestSortBy.jsonOrThrow(sortBy, { + _queryParams.sortBy = serializers.collections.ItemsListItemsRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -118,29 +100,30 @@ export class Items { } if (sortOrder != null) { - _queryParams["sortOrder"] = serializers.collections.ItemsListItemsRequestSortOrder.jsonOrThrow(sortOrder, { + _queryParams.sortOrder = serializers.collections.ItemsListItemsRequestSortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items`, + `collections/${core.url.encodePathParam(collectionId)}/items`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -258,7 +241,41 @@ export class Items { * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy" + * slug: "hitchhikers-guide-to-the-galaxy", + * "plain-text": "Don't Panic.", + * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + * "main-image": { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * }, + * "image-gallery": [ + * { + * "fileId": "62b720ef280c7a7a3be8cabd", + * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + * }, + * { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * } + * ], + * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + * "contact-email": "zaphod.beeblebrox@heartofgold.gov", + * "support-phone": "424-242-4242", + * "answer-to-everything": 42, + * "release-date": "1979-10-12T00:00:00.000Z", + * "is-featured": true, + * "brand-color": "#000000", + * category: "62b720ef280c7a7a3be8cabf", + * author: "62b720ef280c7a7a3be8cab0", + * tags: [ + * "62b720ef280c7a7a3be8cab1", + * "62b720ef280c7a7a3be8cab2" + * ], + * "downloadable-asset": { + * "fileId": "62b720ef280c7a7a3be8cab3", + * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + * } * } * } * }) @@ -272,14 +289,18 @@ export class Items { * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst" + * slug: "senior-data-analyst", + * url: "https://boards.greenhouse.io/webflow/jobs/26567701", + * department: "Data" * } * }, { * isArchived: false, * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager" + * slug: "product-manager", + * url: "https://boards.greenhouse.io/webflow/jobs/31234567", + * department: "Product" * } * }] * } @@ -301,32 +322,33 @@ export class Items { const { skipInvalidFiles, body: _body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); + _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items`, + `collections/${core.url.encodePathParam(collectionId)}/items`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.collections.ItemsCreateItemRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -456,28 +478,30 @@ export class Items { request: Webflow.collections.ItemsDeleteItemsRequest, requestOptions?: Items.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items`, + `collections/${core.url.encodePathParam(collectionId)}/items`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.collections.ItemsDeleteItemsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -589,28 +613,32 @@ export class Items { * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas" + * slug: "ne-paniquez-pas", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico" + * slug: "no-entrar-en-panico", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci" + * slug: "au-revoir-et-merci", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias" + * slug: "hasta-luego-y-gracias", + * featured: false * } * }] * }) @@ -624,7 +652,9 @@ export class Items { * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst" + * slug: "senior-data-analyst", + * url: "https://boards.greenhouse.io/webflow/jobs/26567701", + * department: "Data" * } * }, { * id: "580e64008c9a982ac9b8b754", @@ -632,7 +662,9 @@ export class Items { * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager" + * slug: "product-manager", + * url: "https://boards.greenhouse.io/webflow/jobs/31234567", + * department: "Product" * } * }] * }) @@ -653,32 +685,33 @@ export class Items { const { skipInvalidFiles, ..._body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); + _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items`, + `collections/${core.url.encodePathParam(collectionId)}/items`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.collections.ItemsUpdateItemsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -816,39 +849,36 @@ export class Items { const { cmsLocaleId, offset, limit, name, slug, lastPublished, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams["cmsLocaleId"] = cmsLocaleId; + _queryParams.cmsLocaleId = cmsLocaleId; } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (name != null) { - _queryParams["name"] = name; + _queryParams.name = name; } if (slug != null) { - _queryParams["slug"] = slug; + _queryParams.slug = slug; } if (lastPublished != null) { - _queryParams["lastPublished"] = serializers.ItemsListItemsLiveRequestLastPublished.jsonOrThrow( - lastPublished, - { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - breadcrumbsPrefix: ["request", "lastPublished"], - }, - ); + _queryParams.lastPublished = serializers.ItemsListItemsLiveRequestLastPublished.jsonOrThrow(lastPublished, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["request", "lastPublished"], + }); } if (sortBy != null) { - _queryParams["sortBy"] = serializers.collections.ItemsListItemsLiveRequestSortBy.jsonOrThrow(sortBy, { + _queryParams.sortBy = serializers.collections.ItemsListItemsLiveRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -856,32 +886,30 @@ export class Items { } if (sortOrder != null) { - _queryParams["sortOrder"] = serializers.collections.ItemsListItemsLiveRequestSortOrder.jsonOrThrow( - sortOrder, - { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - }, - ); + _queryParams.sortOrder = serializers.collections.ItemsListItemsLiveRequestSortOrder.jsonOrThrow(sortOrder, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .dataApi, - `collections/${encodeURIComponent(collectionId)}/items/live`, + `collections/${core.url.encodePathParam(collectionId)}/items/live`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1000,7 +1028,41 @@ export class Items { * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy" + * slug: "hitchhikers-guide-to-the-galaxy", + * "plain-text": "Don't Panic.", + * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + * "main-image": { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * }, + * "image-gallery": [ + * { + * "fileId": "62b720ef280c7a7a3be8cabd", + * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + * }, + * { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * } + * ], + * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + * "contact-email": "zaphod.beeblebrox@heartofgold.gov", + * "support-phone": "424-242-4242", + * "answer-to-everything": 42, + * "release-date": "1979-10-12T00:00:00.000Z", + * "is-featured": true, + * "brand-color": "#000000", + * category: "62b720ef280c7a7a3be8cabf", + * author: "62b720ef280c7a7a3be8cab0", + * tags: [ + * "62b720ef280c7a7a3be8cab1", + * "62b720ef280c7a7a3be8cab2" + * ], + * "downloadable-asset": { + * "fileId": "62b720ef280c7a7a3be8cab3", + * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + * } * } * } * }) @@ -1014,14 +1076,18 @@ export class Items { * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst" + * slug: "senior-data-analyst", + * url: "https://boards.greenhouse.io/webflow/jobs/26567701", + * department: "Data" * } * }, { * isArchived: false, * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager" + * slug: "product-manager", + * url: "https://boards.greenhouse.io/webflow/jobs/31234567", + * department: "Product" * } * }] * } @@ -1043,32 +1109,33 @@ export class Items { const { skipInvalidFiles, body: _body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); + _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/live`, + `collections/${core.url.encodePathParam(collectionId)}/items/live`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.collections.ItemsCreateItemLiveRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1197,28 +1264,30 @@ export class Items { request: Webflow.collections.ItemsDeleteItemsLiveRequest, requestOptions?: Items.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/live`, + `collections/${core.url.encodePathParam(collectionId)}/items/live`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.collections.ItemsDeleteItemsLiveRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1327,28 +1396,32 @@ export class Items { * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas" + * slug: "ne-paniquez-pas", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico" + * slug: "no-entrar-en-panico", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci" + * slug: "au-revoir-et-merci", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias" + * slug: "hasta-luego-y-gracias", + * featured: false * } * }] * }) @@ -1362,7 +1435,9 @@ export class Items { * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst" + * slug: "senior-data-analyst", + * url: "https://boards.greenhouse.io/webflow/jobs/26567701", + * department: "Data" * } * }, { * id: "580e64008c9a982ac9b8b754", @@ -1370,7 +1445,9 @@ export class Items { * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager" + * slug: "product-manager", + * url: "https://boards.greenhouse.io/webflow/jobs/31234567", + * department: "Product" * } * }] * }) @@ -1391,32 +1468,33 @@ export class Items { const { skipInvalidFiles, ..._body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); + _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/live`, + `collections/${core.url.encodePathParam(collectionId)}/items/live`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.collections.ItemsUpdateItemsLiveRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1573,32 +1651,33 @@ export class Items { const { skipInvalidFiles, ..._body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); + _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/bulk`, + `collections/${core.url.encodePathParam(collectionId)}/items/bulk`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.collections.CreateBulkCollectionItemRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1729,25 +1808,26 @@ export class Items { const { cmsLocaleId } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams["cmsLocaleId"] = cmsLocaleId; + _queryParams.cmsLocaleId = cmsLocaleId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`, + `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1878,25 +1958,26 @@ export class Items { const { cmsLocaleId } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams["cmsLocaleId"] = cmsLocaleId; + _queryParams.cmsLocaleId = cmsLocaleId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`, + `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2003,7 +2084,41 @@ export class Items { * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy" + * slug: "hitchhikers-guide-to-the-galaxy", + * "plain-text": "Don't Panic.", + * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + * "main-image": { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * }, + * "image-gallery": [ + * { + * "fileId": "62b720ef280c7a7a3be8cabd", + * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + * }, + * { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * } + * ], + * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + * "contact-email": "zaphod.beeblebrox@heartofgold.gov", + * "support-phone": "424-242-4242", + * "answer-to-everything": 42, + * "release-date": "1979-10-12T00:00:00.000Z", + * "is-featured": true, + * "brand-color": "#000000", + * category: "62b720ef280c7a7a3be8cabf", + * author: "62b720ef280c7a7a3be8cab0", + * tags: [ + * "62b720ef280c7a7a3be8cab1", + * "62b720ef280c7a7a3be8cab2" + * ], + * "downloadable-asset": { + * "fileId": "62b720ef280c7a7a3be8cab3", + * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + * } * } * } * }) @@ -2026,32 +2141,33 @@ export class Items { const { skipInvalidFiles, body: _body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); + _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`, + `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.CollectionItemPatchSingle.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2186,25 +2302,26 @@ export class Items { const { cmsLocaleId } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams["cmsLocaleId"] = cmsLocaleId; + _queryParams.cmsLocaleId = cmsLocaleId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .dataApi, - `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`, + `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}/live`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2339,25 +2456,26 @@ export class Items { const { cmsLocaleId } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams["cmsLocaleId"] = cmsLocaleId; + _queryParams.cmsLocaleId = cmsLocaleId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`, + `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}/live`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2465,7 +2583,41 @@ export class Items { * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy" + * slug: "hitchhikers-guide-to-the-galaxy", + * "plain-text": "Don't Panic.", + * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + * "main-image": { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * }, + * "image-gallery": [ + * { + * "fileId": "62b720ef280c7a7a3be8cabd", + * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + * }, + * { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * } + * ], + * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + * "contact-email": "zaphod.beeblebrox@heartofgold.gov", + * "support-phone": "424-242-4242", + * "answer-to-everything": 42, + * "release-date": "1979-10-12T00:00:00.000Z", + * "is-featured": true, + * "brand-color": "#000000", + * category: "62b720ef280c7a7a3be8cabf", + * author: "62b720ef280c7a7a3be8cab0", + * tags: [ + * "62b720ef280c7a7a3be8cab1", + * "62b720ef280c7a7a3be8cab2" + * ], + * "downloadable-asset": { + * "fileId": "62b720ef280c7a7a3be8cab3", + * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + * } * } * } * }) @@ -2490,32 +2642,33 @@ export class Items { const { skipInvalidFiles, body: _body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); + _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`, + `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}/live`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.CollectionItemPatchSingle.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2665,28 +2818,30 @@ export class Items { request: Webflow.collections.ItemsPublishItemRequest, requestOptions?: Items.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(collectionId)}/items/publish`, + `collections/${core.url.encodePathParam(collectionId)}/items/publish`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.collections.ItemsPublishItemRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/collections/resources/items/client/index.ts b/src/api/resources/collections/resources/items/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/collections/resources/items/client/index.ts +++ b/src/api/resources/collections/resources/items/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts b/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts index c5fb0327..d6bf9384 100644 --- a/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts +++ b/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -57,9 +55,7 @@ import * as Webflow from "../../../../../../index"; * } */ export interface CreateBulkCollectionItemRequestBody { - /** - * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. - */ + /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ skipInvalidFiles?: boolean; /** Array of identifiers for the locales where the item will be created */ cmsLocaleIds?: string[]; diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemLiveRequest.ts index 7f7178e4..40e21ced 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemLiveRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -13,7 +11,41 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy" + * slug: "hitchhikers-guide-to-the-galaxy", + * "plain-text": "Don't Panic.", + * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + * "main-image": { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * }, + * "image-gallery": [ + * { + * "fileId": "62b720ef280c7a7a3be8cabd", + * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + * }, + * { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * } + * ], + * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + * "contact-email": "zaphod.beeblebrox@heartofgold.gov", + * "support-phone": "424-242-4242", + * "answer-to-everything": 42, + * "release-date": "1979-10-12T00:00:00.000Z", + * "is-featured": true, + * "brand-color": "#000000", + * category: "62b720ef280c7a7a3be8cabf", + * author: "62b720ef280c7a7a3be8cab0", + * tags: [ + * "62b720ef280c7a7a3be8cab1", + * "62b720ef280c7a7a3be8cab2" + * ], + * "downloadable-asset": { + * "fileId": "62b720ef280c7a7a3be8cab3", + * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + * } * } * } * } @@ -27,23 +59,25 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst" + * slug: "senior-data-analyst", + * url: "https://boards.greenhouse.io/webflow/jobs/26567701", + * department: "Data" * } * }, { * isArchived: false, * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager" + * slug: "product-manager", + * url: "https://boards.greenhouse.io/webflow/jobs/31234567", + * department: "Product" * } * }] * } * } */ export interface ItemsCreateItemLiveRequest { - /** - * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. - */ + /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ skipInvalidFiles?: boolean; body: Webflow.collections.ItemsCreateItemLiveRequestBody; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemRequest.ts index 77c0c974..4f47afe0 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -13,7 +11,41 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy" + * slug: "hitchhikers-guide-to-the-galaxy", + * "plain-text": "Don't Panic.", + * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + * "main-image": { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * }, + * "image-gallery": [ + * { + * "fileId": "62b720ef280c7a7a3be8cabd", + * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + * }, + * { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * } + * ], + * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + * "contact-email": "zaphod.beeblebrox@heartofgold.gov", + * "support-phone": "424-242-4242", + * "answer-to-everything": 42, + * "release-date": "1979-10-12T00:00:00.000Z", + * "is-featured": true, + * "brand-color": "#000000", + * category: "62b720ef280c7a7a3be8cabf", + * author: "62b720ef280c7a7a3be8cab0", + * tags: [ + * "62b720ef280c7a7a3be8cab1", + * "62b720ef280c7a7a3be8cab2" + * ], + * "downloadable-asset": { + * "fileId": "62b720ef280c7a7a3be8cab3", + * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + * } * } * } * } @@ -27,23 +59,25 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst" + * slug: "senior-data-analyst", + * url: "https://boards.greenhouse.io/webflow/jobs/26567701", + * department: "Data" * } * }, { * isArchived: false, * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager" + * slug: "product-manager", + * url: "https://boards.greenhouse.io/webflow/jobs/31234567", + * department: "Product" * } * }] * } * } */ export interface ItemsCreateItemRequest { - /** - * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. - */ + /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ skipInvalidFiles?: boolean; body: Webflow.collections.ItemsCreateItemRequestBody; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemLiveRequest.ts index dfe4d6f6..796b7504 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemLiveRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface ItemsDeleteItemLiveRequest { - /** - * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. - */ + /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ cmsLocaleId?: string; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemRequest.ts index 49073411..6dd9a64d 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface ItemsDeleteItemRequest { - /** - * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. - */ + /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ cmsLocaleId?: string; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts index 779fb410..e24be1ca 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts index 503c93a0..6fb7bd03 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsGetItemLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsGetItemLiveRequest.ts index 4b21ecae..9db7bd09 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsGetItemLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsGetItemLiveRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface ItemsGetItemLiveRequest { - /** - * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. - */ + /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ cmsLocaleId?: string; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsGetItemRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsGetItemRequest.ts index 13e082bc..1bc89dbc 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsGetItemRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsGetItemRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface ItemsGetItemRequest { - /** - * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. - */ + /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ cmsLocaleId?: string; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsListItemsLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsListItemsLiveRequest.ts index 7f50d8be..35cda933 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsListItemsLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsListItemsLiveRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -17,36 +15,20 @@ import * as Webflow from "../../../../../../index"; * } */ export interface ItemsListItemsLiveRequest { - /** - * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. - */ + /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ cmsLocaleId?: string; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Filter by the exact name of the item(s) - */ + /** Filter by the exact name of the item(s) */ name?: string; - /** - * Filter by the exact slug of the item - */ + /** Filter by the exact slug of the item */ slug?: string; - /** - * Filter by the last published date of the item(s) - */ + /** Filter by the last published date of the item(s) */ lastPublished?: Webflow.ItemsListItemsLiveRequestLastPublished; - /** - * Sort results by the provided value - */ + /** Sort results by the provided value */ sortBy?: Webflow.collections.ItemsListItemsLiveRequestSortBy; - /** - * Sorts the results by asc or desc - */ + /** Sorts the results by asc or desc */ sortOrder?: Webflow.collections.ItemsListItemsLiveRequestSortOrder; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsListItemsRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsListItemsRequest.ts index 2edac40f..cb8e37aa 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsListItemsRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsListItemsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -17,36 +15,20 @@ import * as Webflow from "../../../../../../index"; * } */ export interface ItemsListItemsRequest { - /** - * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. - */ + /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ cmsLocaleId?: string; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Filter by the exact name of the item(s) - */ + /** Filter by the exact name of the item(s) */ name?: string; - /** - * Filter by the exact slug of the item - */ + /** Filter by the exact slug of the item */ slug?: string; - /** - * Filter by the last published date of the item(s) - */ + /** Filter by the last published date of the item(s) */ lastPublished?: Webflow.ItemsListItemsRequestLastPublished; - /** - * Sort results by the provided value - */ + /** Sort results by the provided value */ sortBy?: Webflow.collections.ItemsListItemsRequestSortBy; - /** - * Sorts the results by asc or desc - */ + /** Sorts the results by asc or desc */ sortOrder?: Webflow.collections.ItemsListItemsRequestSortOrder; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemLiveRequest.ts index 6ba836d8..dc9d50b1 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemLiveRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -13,15 +11,47 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy" + * slug: "hitchhikers-guide-to-the-galaxy", + * "plain-text": "Don't Panic.", + * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + * "main-image": { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * }, + * "image-gallery": [ + * { + * "fileId": "62b720ef280c7a7a3be8cabd", + * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + * }, + * { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * } + * ], + * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + * "contact-email": "zaphod.beeblebrox@heartofgold.gov", + * "support-phone": "424-242-4242", + * "answer-to-everything": 42, + * "release-date": "1979-10-12T00:00:00.000Z", + * "is-featured": true, + * "brand-color": "#000000", + * category: "62b720ef280c7a7a3be8cabf", + * author: "62b720ef280c7a7a3be8cab0", + * tags: [ + * "62b720ef280c7a7a3be8cab1", + * "62b720ef280c7a7a3be8cab2" + * ], + * "downloadable-asset": { + * "fileId": "62b720ef280c7a7a3be8cab3", + * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + * } * } * } * } */ export interface ItemsUpdateItemLiveRequest { - /** - * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. - */ + /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ skipInvalidFiles?: boolean; body: Webflow.CollectionItemPatchSingle; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemRequest.ts index 3f1db05a..f36c6ae9 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -13,15 +11,47 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy" + * slug: "hitchhikers-guide-to-the-galaxy", + * "plain-text": "Don't Panic.", + * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + * "main-image": { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * }, + * "image-gallery": [ + * { + * "fileId": "62b720ef280c7a7a3be8cabd", + * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" + * }, + * { + * "fileId": "62b720ef280c7a7a3be8cabe", + * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" + * } + * ], + * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + * "contact-email": "zaphod.beeblebrox@heartofgold.gov", + * "support-phone": "424-242-4242", + * "answer-to-everything": 42, + * "release-date": "1979-10-12T00:00:00.000Z", + * "is-featured": true, + * "brand-color": "#000000", + * category: "62b720ef280c7a7a3be8cabf", + * author: "62b720ef280c7a7a3be8cab0", + * tags: [ + * "62b720ef280c7a7a3be8cab1", + * "62b720ef280c7a7a3be8cab2" + * ], + * "downloadable-asset": { + * "fileId": "62b720ef280c7a7a3be8cab3", + * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" + * } * } * } * } */ export interface ItemsUpdateItemRequest { - /** - * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. - */ + /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ skipInvalidFiles?: boolean; body: Webflow.CollectionItemPatchSingle; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts index 29caff27..15df2cca 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -13,28 +11,32 @@ import * as Webflow from "../../../../../../index"; * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas" + * slug: "ne-paniquez-pas", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico" + * slug: "no-entrar-en-panico", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci" + * slug: "au-revoir-et-merci", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias" + * slug: "hasta-luego-y-gracias", + * featured: false * } * }] * } @@ -48,7 +50,9 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst" + * slug: "senior-data-analyst", + * url: "https://boards.greenhouse.io/webflow/jobs/26567701", + * department: "Data" * } * }, { * id: "580e64008c9a982ac9b8b754", @@ -56,7 +60,9 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager" + * slug: "product-manager", + * url: "https://boards.greenhouse.io/webflow/jobs/31234567", + * department: "Product" * } * }] * } @@ -69,28 +75,32 @@ import * as Webflow from "../../../../../../index"; * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas" + * slug: "ne-paniquez-pas", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico" + * slug: "no-entrar-en-panico", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci" + * slug: "au-revoir-et-merci", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias" + * slug: "hasta-luego-y-gracias", + * featured: false * } * }] * } @@ -103,36 +113,38 @@ import * as Webflow from "../../../../../../index"; * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas" + * slug: "ne-paniquez-pas", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico" + * slug: "no-entrar-en-panico", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci" + * slug: "au-revoir-et-merci", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias" + * slug: "hasta-luego-y-gracias", + * featured: false * } * }] * } */ export interface ItemsUpdateItemsLiveRequest { - /** - * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. - */ + /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ skipInvalidFiles?: boolean; items?: Webflow.CollectionItemWithIdInput[]; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts index 303c316e..b3944779 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -13,28 +11,32 @@ import * as Webflow from "../../../../../../index"; * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas" + * slug: "ne-paniquez-pas", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico" + * slug: "no-entrar-en-panico", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci" + * slug: "au-revoir-et-merci", + * featured: false * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias" + * slug: "hasta-luego-y-gracias", + * featured: false * } * }] * } @@ -48,7 +50,9 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst" + * slug: "senior-data-analyst", + * url: "https://boards.greenhouse.io/webflow/jobs/26567701", + * department: "Data" * } * }, { * id: "580e64008c9a982ac9b8b754", @@ -56,15 +60,15 @@ import * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager" + * slug: "product-manager", + * url: "https://boards.greenhouse.io/webflow/jobs/31234567", + * department: "Product" * } * }] * } */ export interface ItemsUpdateItemsRequest { - /** - * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. - */ + /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ skipInvalidFiles?: boolean; items?: Webflow.CollectionItemWithIdInput[]; } diff --git a/src/api/resources/collections/resources/items/client/requests/index.ts b/src/api/resources/collections/resources/items/client/requests/index.ts index b00981ff..4bb198d5 100644 --- a/src/api/resources/collections/resources/items/client/requests/index.ts +++ b/src/api/resources/collections/resources/items/client/requests/index.ts @@ -1,15 +1,15 @@ -export { type ItemsListItemsRequest } from "./ItemsListItemsRequest"; -export { type ItemsCreateItemRequest } from "./ItemsCreateItemRequest"; -export { type ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; -export { type ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; -export { type ItemsListItemsLiveRequest } from "./ItemsListItemsLiveRequest"; -export { type ItemsCreateItemLiveRequest } from "./ItemsCreateItemLiveRequest"; -export { type ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; -export { type ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; -export { type CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; -export { type ItemsGetItemRequest } from "./ItemsGetItemRequest"; -export { type ItemsDeleteItemRequest } from "./ItemsDeleteItemRequest"; -export { type ItemsUpdateItemRequest } from "./ItemsUpdateItemRequest"; -export { type ItemsGetItemLiveRequest } from "./ItemsGetItemLiveRequest"; -export { type ItemsDeleteItemLiveRequest } from "./ItemsDeleteItemLiveRequest"; -export { type ItemsUpdateItemLiveRequest } from "./ItemsUpdateItemLiveRequest"; +export type { CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; +export type { ItemsCreateItemLiveRequest } from "./ItemsCreateItemLiveRequest"; +export type { ItemsCreateItemRequest } from "./ItemsCreateItemRequest"; +export type { ItemsDeleteItemLiveRequest } from "./ItemsDeleteItemLiveRequest"; +export type { ItemsDeleteItemRequest } from "./ItemsDeleteItemRequest"; +export type { ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; +export type { ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; +export type { ItemsGetItemLiveRequest } from "./ItemsGetItemLiveRequest"; +export type { ItemsGetItemRequest } from "./ItemsGetItemRequest"; +export type { ItemsListItemsLiveRequest } from "./ItemsListItemsLiveRequest"; +export type { ItemsListItemsRequest } from "./ItemsListItemsRequest"; +export type { ItemsUpdateItemLiveRequest } from "./ItemsUpdateItemLiveRequest"; +export type { ItemsUpdateItemRequest } from "./ItemsUpdateItemRequest"; +export type { ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; +export type { ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; diff --git a/src/api/resources/collections/resources/items/index.ts b/src/api/resources/collections/resources/items/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/collections/resources/items/index.ts +++ b/src/api/resources/collections/resources/items/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts index 94272dd3..3b4ef4b4 100644 --- a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts +++ b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../index"; +import type * as Webflow from "../../../../../index"; export type CreateBulkCollectionItemRequestBodyFieldData = | Webflow.collections.SingleCmsItem diff --git a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts index 70f4bf43..4d0a3004 100644 --- a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts +++ b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A single CMS item to create diff --git a/src/api/resources/collections/resources/items/types/ItemIDs.ts b/src/api/resources/collections/resources/items/types/ItemIDs.ts index eeebf56c..f1c4b610 100644 --- a/src/api/resources/collections/resources/items/types/ItemIDs.ts +++ b/src/api/resources/collections/resources/items/types/ItemIDs.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * An array of Item IDs in a single locale diff --git a/src/api/resources/collections/resources/items/types/ItemIDsWithLocales.ts b/src/api/resources/collections/resources/items/types/ItemIDsWithLocales.ts index e69cf839..5c02ae6b 100644 --- a/src/api/resources/collections/resources/items/types/ItemIDsWithLocales.ts +++ b/src/api/resources/collections/resources/items/types/ItemIDsWithLocales.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../index"; +import type * as Webflow from "../../../../../index"; /** * An array of Item IDs with included `cmsLocaleIds` diff --git a/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts b/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts index e6574a22..840de801 100644 --- a/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts +++ b/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts @@ -1,7 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../index"; +import type * as Webflow from "../../../../../index"; export type ItemsCreateItemLiveRequestBody = Webflow.CollectionItem | Webflow.collections.MultipleLiveItems; diff --git a/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts b/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts index 2788a6d9..b94a1487 100644 --- a/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts +++ b/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts @@ -1,7 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../index"; +import type * as Webflow from "../../../../../index"; export type ItemsCreateItemRequestBody = Webflow.CollectionItemPostSingle | Webflow.collections.MultipleItems; diff --git a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts index 074dd8a3..807c8179 100644 --- a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts +++ b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ItemsDeleteItemsLiveRequestItemsItem { /** Unique identifier for the Item */ diff --git a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts index f7758491..6739ee64 100644 --- a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts +++ b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ItemsDeleteItemsRequestItemsItem { /** Unique identifier for the Item */ diff --git a/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts b/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts index e463aa98..62738ae3 100644 --- a/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts +++ b/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts @@ -1,10 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ItemsListItemsLiveRequestSortBy = "lastPublished" | "name" | "slug"; export const ItemsListItemsLiveRequestSortBy = { LastPublished: "lastPublished", Name: "name", Slug: "slug", } as const; +export type ItemsListItemsLiveRequestSortBy = + (typeof ItemsListItemsLiveRequestSortBy)[keyof typeof ItemsListItemsLiveRequestSortBy]; diff --git a/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts b/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts index 504484c6..5e07f510 100644 --- a/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts +++ b/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ItemsListItemsLiveRequestSortOrder = "asc" | "desc"; export const ItemsListItemsLiveRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; +export type ItemsListItemsLiveRequestSortOrder = + (typeof ItemsListItemsLiveRequestSortOrder)[keyof typeof ItemsListItemsLiveRequestSortOrder]; diff --git a/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts b/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts index bc7cefc1..c4c612ce 100644 --- a/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts +++ b/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts @@ -1,10 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ItemsListItemsRequestSortBy = "lastPublished" | "name" | "slug"; export const ItemsListItemsRequestSortBy = { LastPublished: "lastPublished", Name: "name", Slug: "slug", } as const; +export type ItemsListItemsRequestSortBy = + (typeof ItemsListItemsRequestSortBy)[keyof typeof ItemsListItemsRequestSortBy]; diff --git a/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts b/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts index 5f2dc236..261a8155 100644 --- a/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts +++ b/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ItemsListItemsRequestSortOrder = "asc" | "desc"; export const ItemsListItemsRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; +export type ItemsListItemsRequestSortOrder = + (typeof ItemsListItemsRequestSortOrder)[keyof typeof ItemsListItemsRequestSortOrder]; diff --git a/src/api/resources/collections/resources/items/types/ItemsPublishItemRequest.ts b/src/api/resources/collections/resources/items/types/ItemsPublishItemRequest.ts index 08c7af48..416cc69e 100644 --- a/src/api/resources/collections/resources/items/types/ItemsPublishItemRequest.ts +++ b/src/api/resources/collections/resources/items/types/ItemsPublishItemRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../index"; +import type * as Webflow from "../../../../../index"; export type ItemsPublishItemRequest = /** diff --git a/src/api/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts b/src/api/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts index 0d36cd03..051daa2a 100644 --- a/src/api/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts +++ b/src/api/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ItemsPublishItemRequestItemsItemsItem { /** The ID of the CMS item */ diff --git a/src/api/resources/collections/resources/items/types/ItemsPublishItemResponse.ts b/src/api/resources/collections/resources/items/types/ItemsPublishItemResponse.ts index 94e2b8c1..ef4ef5b9 100644 --- a/src/api/resources/collections/resources/items/types/ItemsPublishItemResponse.ts +++ b/src/api/resources/collections/resources/items/types/ItemsPublishItemResponse.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ItemsPublishItemResponse { publishedItemIds?: string[]; diff --git a/src/api/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts b/src/api/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts index 610c3130..024e5218 100644 --- a/src/api/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts +++ b/src/api/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts @@ -1,7 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../index"; +import type * as Webflow from "../../../../../index"; export type ItemsUpdateItemsResponse = Webflow.CollectionItem | Webflow.CollectionItemList; diff --git a/src/api/resources/collections/resources/items/types/MultipleItems.ts b/src/api/resources/collections/resources/items/types/MultipleItems.ts index 2c774eaa..d1dca68c 100644 --- a/src/api/resources/collections/resources/items/types/MultipleItems.ts +++ b/src/api/resources/collections/resources/items/types/MultipleItems.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../index"; +import type * as Webflow from "../../../../../index"; export interface MultipleItems { /** An array of items to create */ diff --git a/src/api/resources/collections/resources/items/types/MultipleLiveItems.ts b/src/api/resources/collections/resources/items/types/MultipleLiveItems.ts index f794cfed..cfec53db 100644 --- a/src/api/resources/collections/resources/items/types/MultipleLiveItems.ts +++ b/src/api/resources/collections/resources/items/types/MultipleLiveItems.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../index"; +import type * as Webflow from "../../../../../index"; export interface MultipleLiveItems { /** List of collection items to create */ diff --git a/src/api/resources/collections/resources/items/types/SingleCmsItem.ts b/src/api/resources/collections/resources/items/types/SingleCmsItem.ts index c321f2ff..1a81d7ff 100644 --- a/src/api/resources/collections/resources/items/types/SingleCmsItem.ts +++ b/src/api/resources/collections/resources/items/types/SingleCmsItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface SingleCmsItem { /** The name of the item. */ diff --git a/src/api/resources/collections/resources/items/types/index.ts b/src/api/resources/collections/resources/items/types/index.ts index 92acdcb3..423ca368 100644 --- a/src/api/resources/collections/resources/items/types/index.ts +++ b/src/api/resources/collections/resources/items/types/index.ts @@ -1,19 +1,19 @@ -export * from "./ItemsListItemsRequestSortBy"; -export * from "./ItemsListItemsRequestSortOrder"; -export * from "./MultipleItems"; +export * from "./CreateBulkCollectionItemRequestBodyFieldData"; +export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; +export * from "./ItemIDs"; +export * from "./ItemIDsWithLocales"; +export * from "./ItemsCreateItemLiveRequestBody"; export * from "./ItemsCreateItemRequestBody"; +export * from "./ItemsDeleteItemsLiveRequestItemsItem"; export * from "./ItemsDeleteItemsRequestItemsItem"; -export * from "./ItemsUpdateItemsResponse"; export * from "./ItemsListItemsLiveRequestSortBy"; export * from "./ItemsListItemsLiveRequestSortOrder"; -export * from "./MultipleLiveItems"; -export * from "./ItemsCreateItemLiveRequestBody"; -export * from "./ItemsDeleteItemsLiveRequestItemsItem"; -export * from "./SingleCmsItem"; -export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; -export * from "./CreateBulkCollectionItemRequestBodyFieldData"; -export * from "./ItemIDs"; -export * from "./ItemsPublishItemRequestItemsItemsItem"; -export * from "./ItemIDsWithLocales"; +export * from "./ItemsListItemsRequestSortBy"; +export * from "./ItemsListItemsRequestSortOrder"; export * from "./ItemsPublishItemRequest"; +export * from "./ItemsPublishItemRequestItemsItemsItem"; export * from "./ItemsPublishItemResponse"; +export * from "./ItemsUpdateItemsResponse"; +export * from "./MultipleItems"; +export * from "./MultipleLiveItems"; +export * from "./SingleCmsItem"; diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts index 202f3b59..32029c62 100644 --- a/src/api/resources/components/client/Client.ts +++ b/src/api/resources/components/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Components { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Components { @@ -77,33 +59,34 @@ export class Components { const { branchId, limit, offset } = request; const _queryParams: Record = {}; if (branchId != null) { - _queryParams["branchId"] = branchId; + _queryParams.branchId = branchId; } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/components`, + `sites/${core.url.encodePathParam(siteId)}/components`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -238,37 +221,38 @@ export class Components { const { localeId, branchId, limit, offset } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (branchId != null) { - _queryParams["branchId"] = branchId; + _queryParams.branchId = branchId; } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom`, + `sites/${core.url.encodePathParam(siteId)}/components/${core.url.encodePathParam(componentId)}/dom`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -442,36 +426,37 @@ export class Components { const { localeId, branchId, ..._body } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (branchId != null) { - _queryParams["branchId"] = branchId; + _queryParams.branchId = branchId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom`, + `sites/${core.url.encodePathParam(siteId)}/components/${core.url.encodePathParam(componentId)}/dom`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.ComponentDomWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -609,37 +594,38 @@ export class Components { const { localeId, branchId, limit, offset } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (branchId != null) { - _queryParams["branchId"] = branchId; + _queryParams.branchId = branchId; } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties`, + `sites/${core.url.encodePathParam(siteId)}/components/${core.url.encodePathParam(componentId)}/properties`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -786,36 +772,37 @@ export class Components { const { localeId, branchId, ..._body } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (branchId != null) { - _queryParams["branchId"] = branchId; + _queryParams.branchId = branchId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties`, + `sites/${core.url.encodePathParam(siteId)}/components/${core.url.encodePathParam(componentId)}/properties`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.ComponentPropertiesWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/components/client/index.ts b/src/api/resources/components/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/components/client/index.ts +++ b/src/api/resources/components/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/components/client/requests/ComponentDomWrite.ts b/src/api/resources/components/client/requests/ComponentDomWrite.ts index 421ed0b0..cab01181 100644 --- a/src/api/resources/components/client/requests/ComponentDomWrite.ts +++ b/src/api/resources/components/client/requests/ComponentDomWrite.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example @@ -50,9 +48,7 @@ export interface ComponentDomWrite { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Scope the operation to work on a specific branch. - */ + /** Scope the operation to work on a specific branch. */ branchId?: string; /** List of DOM Nodes with the new content that will be updated in each node. */ nodes: Webflow.ComponentDomWriteNodesItem[]; diff --git a/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts b/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts index 7c79d5a7..306872f2 100644 --- a/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts +++ b/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example @@ -25,9 +23,7 @@ export interface ComponentPropertiesWrite { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Scope the operation to work on a specific branch. - */ + /** Scope the operation to work on a specific branch. */ branchId?: string; /** A list of component properties to update within the specified secondary locale. */ properties: Webflow.ComponentPropertiesWritePropertiesItem[]; diff --git a/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts b/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts index 810ffa3d..7836c5c3 100644 --- a/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts +++ b/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -18,16 +16,10 @@ export interface ComponentsGetContentRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Scope the operation to work on a specific branch. - */ + /** Scope the operation to work on a specific branch. */ branchId?: string; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; } diff --git a/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts b/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts index a2271bec..25f9b06e 100644 --- a/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts +++ b/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -18,16 +16,10 @@ export interface ComponentsGetPropertiesRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Scope the operation to work on a specific branch. - */ + /** Scope the operation to work on a specific branch. */ branchId?: string; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; } diff --git a/src/api/resources/components/client/requests/ComponentsListRequest.ts b/src/api/resources/components/client/requests/ComponentsListRequest.ts index 04d1beb5..ac00e2b1 100644 --- a/src/api/resources/components/client/requests/ComponentsListRequest.ts +++ b/src/api/resources/components/client/requests/ComponentsListRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,16 +9,10 @@ * } */ export interface ComponentsListRequest { - /** - * Scope the operation to work on a specific branch. - */ + /** Scope the operation to work on a specific branch. */ branchId?: string; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; } diff --git a/src/api/resources/components/client/requests/index.ts b/src/api/resources/components/client/requests/index.ts index c8f88ea5..1a3c508d 100644 --- a/src/api/resources/components/client/requests/index.ts +++ b/src/api/resources/components/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type ComponentsListRequest } from "./ComponentsListRequest"; -export { type ComponentsGetContentRequest } from "./ComponentsGetContentRequest"; -export { type ComponentDomWrite } from "./ComponentDomWrite"; -export { type ComponentsGetPropertiesRequest } from "./ComponentsGetPropertiesRequest"; -export { type ComponentPropertiesWrite } from "./ComponentPropertiesWrite"; +export type { ComponentDomWrite } from "./ComponentDomWrite"; +export type { ComponentPropertiesWrite } from "./ComponentPropertiesWrite"; +export type { ComponentsGetContentRequest } from "./ComponentsGetContentRequest"; +export type { ComponentsGetPropertiesRequest } from "./ComponentsGetPropertiesRequest"; +export type { ComponentsListRequest } from "./ComponentsListRequest"; diff --git a/src/api/resources/components/index.ts b/src/api/resources/components/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/components/index.ts +++ b/src/api/resources/components/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/components/types/ComponentDomWriteNodesItem.ts b/src/api/resources/components/types/ComponentDomWriteNodesItem.ts index 4437947d..9b8b8674 100644 --- a/src/api/resources/components/types/ComponentDomWriteNodesItem.ts +++ b/src/api/resources/components/types/ComponentDomWriteNodesItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export type ComponentDomWriteNodesItem = | Webflow.TextNodeWrite diff --git a/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts b/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts index dac54dc0..0467ccad 100644 --- a/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts +++ b/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ComponentPropertiesWritePropertiesItem { /** The ID of the property. */ diff --git a/src/api/resources/components/types/ComponentsUpdateContentResponse.ts b/src/api/resources/components/types/ComponentsUpdateContentResponse.ts index 3bb712bd..d81ab1d9 100644 --- a/src/api/resources/components/types/ComponentsUpdateContentResponse.ts +++ b/src/api/resources/components/types/ComponentsUpdateContentResponse.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ComponentsUpdateContentResponse { /** A list of error messages, if any. */ diff --git a/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts b/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts index 8c1f4142..1c251cbc 100644 --- a/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts +++ b/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ComponentsUpdatePropertiesResponse { /** A list of error messages, if any. */ diff --git a/src/api/resources/components/types/index.ts b/src/api/resources/components/types/index.ts index 1bdf297c..d72e3728 100644 --- a/src/api/resources/components/types/index.ts +++ b/src/api/resources/components/types/index.ts @@ -1,4 +1,4 @@ export * from "./ComponentDomWriteNodesItem"; -export * from "./ComponentsUpdateContentResponse"; export * from "./ComponentPropertiesWritePropertiesItem"; +export * from "./ComponentsUpdateContentResponse"; export * from "./ComponentsUpdatePropertiesResponse"; diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index f2e260ed..168b57ae 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Ecommerce { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Ecommerce { @@ -69,21 +51,23 @@ export class Ecommerce { siteId: string, requestOptions?: Ecommerce.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/ecommerce/settings`, + `sites/${core.url.encodePathParam(siteId)}/ecommerce/settings`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/forms/client/Client.ts b/src/api/resources/forms/client/Client.ts index 9a7be23b..4330d772 100644 --- a/src/api/resources/forms/client/Client.ts +++ b/src/api/resources/forms/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Forms { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } /** @@ -81,29 +63,30 @@ export class Forms { const { limit, offset } = request; const _queryParams: Record = {}; if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/forms`, + `sites/${core.url.encodePathParam(siteId)}/forms`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -223,21 +206,23 @@ export class Forms { formId: string, requestOptions?: Forms.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `forms/${encodeURIComponent(formId)}`, + `forms/${core.url.encodePathParam(formId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -373,29 +358,30 @@ export class Forms { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `forms/${encodeURIComponent(formId)}/submissions`, + `forms/${core.url.encodePathParam(formId)}/submissions`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -516,21 +502,23 @@ export class Forms { formSubmissionId: string, requestOptions?: Forms.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `form_submissions/${encodeURIComponent(formSubmissionId)}`, + `form_submissions/${core.url.encodePathParam(formSubmissionId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -655,21 +643,23 @@ export class Forms { formSubmissionId: string, requestOptions?: Forms.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `form_submissions/${encodeURIComponent(formSubmissionId)}`, + `form_submissions/${core.url.encodePathParam(formSubmissionId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -789,28 +779,30 @@ export class Forms { request: Webflow.FormsUpdateSubmissionRequest = {}, requestOptions?: Forms.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `form_submissions/${encodeURIComponent(formSubmissionId)}`, + `form_submissions/${core.url.encodePathParam(formSubmissionId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.FormsUpdateSubmissionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/forms/client/index.ts b/src/api/resources/forms/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/forms/client/index.ts +++ b/src/api/resources/forms/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/forms/client/requests/FormsListRequest.ts b/src/api/resources/forms/client/requests/FormsListRequest.ts index 4e085579..ad5859ab 100644 --- a/src/api/resources/forms/client/requests/FormsListRequest.ts +++ b/src/api/resources/forms/client/requests/FormsListRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface FormsListRequest { - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; } diff --git a/src/api/resources/forms/client/requests/FormsListSubmissionsRequest.ts b/src/api/resources/forms/client/requests/FormsListSubmissionsRequest.ts index 56f85c8a..91c686e5 100644 --- a/src/api/resources/forms/client/requests/FormsListSubmissionsRequest.ts +++ b/src/api/resources/forms/client/requests/FormsListSubmissionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface FormsListSubmissionsRequest { - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; } diff --git a/src/api/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts b/src/api/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts index d0c8dfb4..16be9837 100644 --- a/src/api/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts +++ b/src/api/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/forms/client/requests/index.ts b/src/api/resources/forms/client/requests/index.ts index b3189128..752836de 100644 --- a/src/api/resources/forms/client/requests/index.ts +++ b/src/api/resources/forms/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type FormsListRequest } from "./FormsListRequest"; -export { type FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; -export { type FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; +export type { FormsListRequest } from "./FormsListRequest"; +export type { FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; +export type { FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 8ce422fe..d10e5259 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,36 +1,36 @@ -export * as sites from "./sites"; -export * from "./sites/types"; -export * as pages from "./pages"; -export * from "./pages/types"; -export * as components from "./components"; -export * from "./components/types"; -export * as users from "./users"; -export * from "./users/types"; export * as accessGroups from "./accessGroups"; +export * from "./accessGroups/client/requests"; export * from "./accessGroups/types"; -export * as products from "./products"; -export * from "./products/types"; -export * as orders from "./orders"; -export * from "./orders/types"; -export * as inventory from "./inventory"; -export * from "./inventory/types"; -export * as collections from "./collections"; -export * as workspaces from "./workspaces"; -export * as token from "./token"; -export * as scripts from "./scripts"; export * as assets from "./assets"; -export * as webhooks from "./webhooks"; -export * as forms from "./forms"; -export * as ecommerce from "./ecommerce"; -export * from "./sites/client/requests"; +export * from "./assets/client/requests"; +export * as collections from "./collections"; export * from "./collections/client/requests"; -export * from "./pages/client/requests"; +export * as components from "./components"; export * from "./components/client/requests"; -export * from "./scripts/client/requests"; -export * from "./assets/client/requests"; +export * from "./components/types"; +export * as ecommerce from "./ecommerce"; +export * as forms from "./forms"; export * from "./forms/client/requests"; -export * from "./users/client/requests"; -export * from "./accessGroups/client/requests"; -export * from "./products/client/requests"; -export * from "./orders/client/requests"; +export * as inventory from "./inventory"; export * from "./inventory/client/requests"; +export * from "./inventory/types"; +export * as orders from "./orders"; +export * from "./orders/client/requests"; +export * from "./orders/types"; +export * as pages from "./pages"; +export * from "./pages/client/requests"; +export * from "./pages/types"; +export * as products from "./products"; +export * from "./products/client/requests"; +export * from "./products/types"; +export * as scripts from "./scripts"; +export * from "./scripts/client/requests"; +export * as sites from "./sites"; +export * from "./sites/client/requests"; +export * from "./sites/types"; +export * as token from "./token"; +export * as users from "./users"; +export * from "./users/client/requests"; +export * from "./users/types"; +export * as webhooks from "./webhooks"; +export * as workspaces from "./workspaces"; diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index 7448e5be..2237c45a 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Inventory { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } /** @@ -75,21 +57,23 @@ export class Inventory { skuId: string, requestOptions?: Inventory.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(skuCollectionId)}/items/${encodeURIComponent(skuId)}/inventory`, + `collections/${core.url.encodePathParam(skuCollectionId)}/items/${core.url.encodePathParam(skuId)}/inventory`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -227,28 +211,30 @@ export class Inventory { request: Webflow.InventoryUpdateRequest, requestOptions?: Inventory.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${encodeURIComponent(skuCollectionId)}/items/${encodeURIComponent(skuId)}/inventory`, + `collections/${core.url.encodePathParam(skuCollectionId)}/items/${core.url.encodePathParam(skuId)}/inventory`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.InventoryUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/inventory/client/index.ts b/src/api/resources/inventory/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/inventory/client/index.ts +++ b/src/api/resources/inventory/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/inventory/client/requests/InventoryUpdateRequest.ts b/src/api/resources/inventory/client/requests/InventoryUpdateRequest.ts index 6dd3bbee..873436ba 100644 --- a/src/api/resources/inventory/client/requests/InventoryUpdateRequest.ts +++ b/src/api/resources/inventory/client/requests/InventoryUpdateRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/inventory/client/requests/index.ts b/src/api/resources/inventory/client/requests/index.ts index 3ec833cc..52df383e 100644 --- a/src/api/resources/inventory/client/requests/index.ts +++ b/src/api/resources/inventory/client/requests/index.ts @@ -1 +1 @@ -export { type InventoryUpdateRequest } from "./InventoryUpdateRequest"; +export type { InventoryUpdateRequest } from "./InventoryUpdateRequest"; diff --git a/src/api/resources/inventory/index.ts b/src/api/resources/inventory/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/inventory/index.ts +++ b/src/api/resources/inventory/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/inventory/types/EcommInventoryChangedPayload.ts b/src/api/resources/inventory/types/EcommInventoryChangedPayload.ts index 41e8a1f7..c20a7924 100644 --- a/src/api/resources/inventory/types/EcommInventoryChangedPayload.ts +++ b/src/api/resources/inventory/types/EcommInventoryChangedPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface EcommInventoryChangedPayload { triggerType?: "ecomm_inventory_changed"; diff --git a/src/api/resources/inventory/types/InventoryUpdateRequestInventoryType.ts b/src/api/resources/inventory/types/InventoryUpdateRequestInventoryType.ts index a762d082..235406e6 100644 --- a/src/api/resources/inventory/types/InventoryUpdateRequestInventoryType.ts +++ b/src/api/resources/inventory/types/InventoryUpdateRequestInventoryType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * infinite or finite - */ -export type InventoryUpdateRequestInventoryType = "infinite" | "finite"; +/** infinite or finite */ export const InventoryUpdateRequestInventoryType = { Infinite: "infinite", Finite: "finite", } as const; +export type InventoryUpdateRequestInventoryType = + (typeof InventoryUpdateRequestInventoryType)[keyof typeof InventoryUpdateRequestInventoryType]; diff --git a/src/api/resources/inventory/types/index.ts b/src/api/resources/inventory/types/index.ts index a225550f..f48b48ca 100644 --- a/src/api/resources/inventory/types/index.ts +++ b/src/api/resources/inventory/types/index.ts @@ -1,2 +1,2 @@ -export * from "./InventoryUpdateRequestInventoryType"; export * from "./EcommInventoryChangedPayload"; +export * from "./InventoryUpdateRequestInventoryType"; diff --git a/src/api/resources/orders/client/Client.ts b/src/api/resources/orders/client/Client.ts index a2d5a6d7..78887001 100644 --- a/src/api/resources/orders/client/Client.ts +++ b/src/api/resources/orders/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import * as serializers from "../../../../serialization/index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Orders { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } /** @@ -82,7 +64,7 @@ export class Orders { const { status, offset, limit } = request; const _queryParams: Record = {}; if (status != null) { - _queryParams["status"] = serializers.OrdersListRequestStatus.jsonOrThrow(status, { + _queryParams.status = serializers.OrdersListRequestStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -90,29 +72,30 @@ export class Orders { } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/orders`, + `sites/${core.url.encodePathParam(siteId)}/orders`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -240,21 +223,23 @@ export class Orders { orderId: string, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}`, + `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -388,28 +373,30 @@ export class Orders { request: Webflow.OrdersUpdateRequest = {}, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}`, + `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.OrdersUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -541,28 +528,30 @@ export class Orders { request: Webflow.OrdersUpdateFulfillRequest = {}, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/fulfill`, + `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}/fulfill`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.OrdersUpdateFulfillRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -691,21 +680,23 @@ export class Orders { orderId: string, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/unfulfill`, + `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}/unfulfill`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -838,28 +829,30 @@ export class Orders { request: Webflow.OrdersRefundRequest = {}, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/refund`, + `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}/refund`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.OrdersRefundRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/orders/client/index.ts b/src/api/resources/orders/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/orders/client/index.ts +++ b/src/api/resources/orders/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/orders/client/requests/OrdersListRequest.ts b/src/api/resources/orders/client/requests/OrdersListRequest.ts index ac45d33f..8481fd5e 100644 --- a/src/api/resources/orders/client/requests/OrdersListRequest.ts +++ b/src/api/resources/orders/client/requests/OrdersListRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example @@ -13,16 +11,10 @@ import * as Webflow from "../../../../index"; * } */ export interface OrdersListRequest { - /** - * Filter the orders by status - */ + /** Filter the orders by status */ status?: Webflow.OrdersListRequestStatus; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; } diff --git a/src/api/resources/orders/client/requests/OrdersRefundRequest.ts b/src/api/resources/orders/client/requests/OrdersRefundRequest.ts index 68d1b5ac..e51bc31b 100644 --- a/src/api/resources/orders/client/requests/OrdersRefundRequest.ts +++ b/src/api/resources/orders/client/requests/OrdersRefundRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts b/src/api/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts index 45c67a6f..accb07e4 100644 --- a/src/api/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts +++ b/src/api/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/orders/client/requests/OrdersUpdateRequest.ts b/src/api/resources/orders/client/requests/OrdersUpdateRequest.ts index fea7c2b3..93d22f1e 100644 --- a/src/api/resources/orders/client/requests/OrdersUpdateRequest.ts +++ b/src/api/resources/orders/client/requests/OrdersUpdateRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/orders/client/requests/index.ts b/src/api/resources/orders/client/requests/index.ts index f9f70048..3eb7507e 100644 --- a/src/api/resources/orders/client/requests/index.ts +++ b/src/api/resources/orders/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type OrdersListRequest } from "./OrdersListRequest"; -export { type OrdersUpdateRequest } from "./OrdersUpdateRequest"; -export { type OrdersUpdateFulfillRequest } from "./OrdersUpdateFulfillRequest"; -export { type OrdersRefundRequest } from "./OrdersRefundRequest"; +export type { OrdersListRequest } from "./OrdersListRequest"; +export type { OrdersRefundRequest } from "./OrdersRefundRequest"; +export type { OrdersUpdateFulfillRequest } from "./OrdersUpdateFulfillRequest"; +export type { OrdersUpdateRequest } from "./OrdersUpdateRequest"; diff --git a/src/api/resources/orders/index.ts b/src/api/resources/orders/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/orders/index.ts +++ b/src/api/resources/orders/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/orders/types/OrdersListRequestStatus.ts b/src/api/resources/orders/types/OrdersListRequestStatus.ts index 38e60f53..f93b09e6 100644 --- a/src/api/resources/orders/types/OrdersListRequestStatus.ts +++ b/src/api/resources/orders/types/OrdersListRequestStatus.ts @@ -1,14 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type OrdersListRequestStatus = - | "pending" - | "refunded" - | "dispute-lost" - | "fulfilled" - | "disputed" - | "unfulfilled"; export const OrdersListRequestStatus = { Pending: "pending", Refunded: "refunded", @@ -17,3 +8,4 @@ export const OrdersListRequestStatus = { Disputed: "disputed", Unfulfilled: "unfulfilled", } as const; +export type OrdersListRequestStatus = (typeof OrdersListRequestStatus)[keyof typeof OrdersListRequestStatus]; diff --git a/src/api/resources/orders/types/OrdersRefundRequestReason.ts b/src/api/resources/orders/types/OrdersRefundRequestReason.ts index 1fceae18..0e971d34 100644 --- a/src/api/resources/orders/types/OrdersRefundRequestReason.ts +++ b/src/api/resources/orders/types/OrdersRefundRequestReason.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The reason for the refund - */ -export type OrdersRefundRequestReason = "duplicate" | "fraudulent" | "requested"; +/** The reason for the refund */ export const OrdersRefundRequestReason = { Duplicate: "duplicate", Fraudulent: "fraudulent", Requested: "requested", } as const; +export type OrdersRefundRequestReason = (typeof OrdersRefundRequestReason)[keyof typeof OrdersRefundRequestReason]; diff --git a/src/api/resources/pages/client/Client.ts b/src/api/resources/pages/client/Client.ts index abc05512..93c9c245 100644 --- a/src/api/resources/pages/client/Client.ts +++ b/src/api/resources/pages/client/Client.ts @@ -1,36 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; import { Scripts } from "../resources/scripts/client/Client"; export declare namespace Pages { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } /** @@ -86,33 +68,34 @@ export class Pages { const { localeId, limit, offset } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/pages`, + `sites/${core.url.encodePathParam(siteId)}/pages`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -238,25 +221,26 @@ export class Pages { const { localeId } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${encodeURIComponent(pageId)}`, + `pages/${core.url.encodePathParam(pageId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -394,32 +378,33 @@ export class Pages { const { localeId, ..._body } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${encodeURIComponent(pageId)}`, + `pages/${core.url.encodePathParam(pageId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.PageMetadataWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -550,33 +535,34 @@ export class Pages { const { localeId, limit, offset } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${encodeURIComponent(pageId)}/dom`, + `pages/${core.url.encodePathParam(pageId)}/dom`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -745,30 +731,31 @@ export class Pages { ): Promise> { const { localeId, ..._body } = request; const _queryParams: Record = {}; - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${encodeURIComponent(pageId)}/dom`, + `pages/${core.url.encodePathParam(pageId)}/dom`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", - queryParameters: _queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", body: serializers.PageDomWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/pages/client/index.ts b/src/api/resources/pages/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/pages/client/index.ts +++ b/src/api/resources/pages/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/pages/client/requests/PageDomWrite.ts b/src/api/resources/pages/client/requests/PageDomWrite.ts index 84e5f5f3..8537fb66 100644 --- a/src/api/resources/pages/client/requests/PageDomWrite.ts +++ b/src/api/resources/pages/client/requests/PageDomWrite.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example @@ -43,9 +41,7 @@ import * as Webflow from "../../../../index"; * } */ export interface PageDomWrite { - /** - * The locale identifier. - */ + /** The locale identifier. */ localeId: string; /** List of DOM Nodes with the new content that will be updated in each node. */ nodes: Webflow.PageDomWriteNodesItem[]; diff --git a/src/api/resources/pages/client/requests/PageMetadataWrite.ts b/src/api/resources/pages/client/requests/PageMetadataWrite.ts index 6b91f91c..61dc8a5a 100644 --- a/src/api/resources/pages/client/requests/PageMetadataWrite.ts +++ b/src/api/resources/pages/client/requests/PageMetadataWrite.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/pages/client/requests/PagesGetContentRequest.ts b/src/api/resources/pages/client/requests/PagesGetContentRequest.ts index e28a93d2..8f2cd2ce 100644 --- a/src/api/resources/pages/client/requests/PagesGetContentRequest.ts +++ b/src/api/resources/pages/client/requests/PagesGetContentRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -17,12 +15,8 @@ export interface PagesGetContentRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; } diff --git a/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts b/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts index 68114fa7..9bab5f28 100644 --- a/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts +++ b/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/pages/client/requests/PagesListRequest.ts b/src/api/resources/pages/client/requests/PagesListRequest.ts index adcce34a..7f9d8e48 100644 --- a/src/api/resources/pages/client/requests/PagesListRequest.ts +++ b/src/api/resources/pages/client/requests/PagesListRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -17,12 +15,8 @@ export interface PagesListRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; } diff --git a/src/api/resources/pages/client/requests/index.ts b/src/api/resources/pages/client/requests/index.ts index 0c99edcc..ab79f4da 100644 --- a/src/api/resources/pages/client/requests/index.ts +++ b/src/api/resources/pages/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type PagesListRequest } from "./PagesListRequest"; -export { type PagesGetMetadataRequest } from "./PagesGetMetadataRequest"; -export { type PageMetadataWrite } from "./PageMetadataWrite"; -export { type PagesGetContentRequest } from "./PagesGetContentRequest"; -export { type PageDomWrite } from "./PageDomWrite"; +export type { PageDomWrite } from "./PageDomWrite"; +export type { PageMetadataWrite } from "./PageMetadataWrite"; +export type { PagesGetContentRequest } from "./PagesGetContentRequest"; +export type { PagesGetMetadataRequest } from "./PagesGetMetadataRequest"; +export type { PagesListRequest } from "./PagesListRequest"; diff --git a/src/api/resources/pages/index.ts b/src/api/resources/pages/index.ts index 848e75ab..fb00ab43 100644 --- a/src/api/resources/pages/index.ts +++ b/src/api/resources/pages/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; export * from "./client"; export * from "./resources"; +export * from "./types"; diff --git a/src/api/resources/pages/resources/scripts/client/Client.ts b/src/api/resources/pages/resources/scripts/client/Client.ts index 2622188b..cf83b3bb 100644 --- a/src/api/resources/pages/resources/scripts/client/Client.ts +++ b/src/api/resources/pages/resources/scripts/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace Scripts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Scripts { @@ -67,21 +49,23 @@ export class Scripts { pageId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${encodeURIComponent(pageId)}/custom_code`, + `pages/${core.url.encodePathParam(pageId)}/custom_code`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -220,28 +204,30 @@ export class Scripts { request: Webflow.ScriptApplyList, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${encodeURIComponent(pageId)}/custom_code`, + `pages/${core.url.encodePathParam(pageId)}/custom_code`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ScriptApplyList.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -362,21 +348,23 @@ export class Scripts { pageId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${encodeURIComponent(pageId)}/custom_code`, + `pages/${core.url.encodePathParam(pageId)}/custom_code`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/pages/types/PageDomWriteNodesItem.ts b/src/api/resources/pages/types/PageDomWriteNodesItem.ts index 09895469..23bf52d8 100644 --- a/src/api/resources/pages/types/PageDomWriteNodesItem.ts +++ b/src/api/resources/pages/types/PageDomWriteNodesItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export type PageDomWriteNodesItem = | Webflow.TextNodeWrite diff --git a/src/api/resources/pages/types/PageMetadataWriteOpenGraph.ts b/src/api/resources/pages/types/PageMetadataWriteOpenGraph.ts index ceeb14ca..2f27ce9a 100644 --- a/src/api/resources/pages/types/PageMetadataWriteOpenGraph.ts +++ b/src/api/resources/pages/types/PageMetadataWriteOpenGraph.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Open Graph fields for the Page diff --git a/src/api/resources/pages/types/PageMetadataWriteSeo.ts b/src/api/resources/pages/types/PageMetadataWriteSeo.ts index 7d162ad1..1acc6082 100644 --- a/src/api/resources/pages/types/PageMetadataWriteSeo.ts +++ b/src/api/resources/pages/types/PageMetadataWriteSeo.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * SEO-related fields for the Page diff --git a/src/api/resources/pages/types/UpdateStaticContentResponse.ts b/src/api/resources/pages/types/UpdateStaticContentResponse.ts index 70339d41..88b4a1e9 100644 --- a/src/api/resources/pages/types/UpdateStaticContentResponse.ts +++ b/src/api/resources/pages/types/UpdateStaticContentResponse.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface UpdateStaticContentResponse { /** A list of error messages, if any. */ diff --git a/src/api/resources/pages/types/index.ts b/src/api/resources/pages/types/index.ts index 9fecb32e..f2f4beb2 100644 --- a/src/api/resources/pages/types/index.ts +++ b/src/api/resources/pages/types/index.ts @@ -1,4 +1,4 @@ -export * from "./PageMetadataWriteSeo"; -export * from "./PageMetadataWriteOpenGraph"; export * from "./PageDomWriteNodesItem"; +export * from "./PageMetadataWriteOpenGraph"; +export * from "./PageMetadataWriteSeo"; export * from "./UpdateStaticContentResponse"; diff --git a/src/api/resources/products/client/Client.ts b/src/api/resources/products/client/Client.ts index 8da928e6..ba3e9199 100644 --- a/src/api/resources/products/client/Client.ts +++ b/src/api/resources/products/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Products { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Products { @@ -81,29 +63,30 @@ export class Products { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/products`, + `sites/${core.url.encodePathParam(siteId)}/products`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -291,28 +274,30 @@ export class Products { request: Webflow.ProductSkuCreate, requestOptions?: Products.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/products`, + `sites/${core.url.encodePathParam(siteId)}/products`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ProductSkuCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -440,21 +425,23 @@ export class Products { productId: string, requestOptions?: Products.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}`, + `sites/${core.url.encodePathParam(siteId)}/products/${core.url.encodePathParam(productId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -588,28 +575,30 @@ export class Products { request: Webflow.ProductSkuUpdate = {}, requestOptions?: Products.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}`, + `sites/${core.url.encodePathParam(siteId)}/products/${core.url.encodePathParam(productId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ProductSkuUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -760,28 +749,30 @@ export class Products { request: Webflow.ProductsCreateSkuRequest, requestOptions?: Products.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}/skus`, + `sites/${core.url.encodePathParam(siteId)}/products/${core.url.encodePathParam(productId)}/skus`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ProductsCreateSkuRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -937,28 +928,30 @@ export class Products { request: Webflow.ProductsUpdateSkuRequest, requestOptions?: Products.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}/skus/${encodeURIComponent(skuId)}`, + `sites/${core.url.encodePathParam(siteId)}/products/${core.url.encodePathParam(productId)}/skus/${core.url.encodePathParam(skuId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ProductsUpdateSkuRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/products/client/index.ts b/src/api/resources/products/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/products/client/index.ts +++ b/src/api/resources/products/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/products/client/requests/ProductSkuCreate.ts b/src/api/resources/products/client/requests/ProductSkuCreate.ts index 319a8369..afb2d2cc 100644 --- a/src/api/resources/products/client/requests/ProductSkuCreate.ts +++ b/src/api/resources/products/client/requests/ProductSkuCreate.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/products/client/requests/ProductSkuUpdate.ts b/src/api/resources/products/client/requests/ProductSkuUpdate.ts index 76e3f601..63c42173 100644 --- a/src/api/resources/products/client/requests/ProductSkuUpdate.ts +++ b/src/api/resources/products/client/requests/ProductSkuUpdate.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts b/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts index 6e57238c..4a0a2f94 100644 --- a/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts +++ b/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/products/client/requests/ProductsListRequest.ts b/src/api/resources/products/client/requests/ProductsListRequest.ts index d89e80fd..90999786 100644 --- a/src/api/resources/products/client/requests/ProductsListRequest.ts +++ b/src/api/resources/products/client/requests/ProductsListRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface ProductsListRequest { - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; } diff --git a/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts b/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts index 9cb1d368..4641f6d1 100644 --- a/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts +++ b/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/products/client/requests/index.ts b/src/api/resources/products/client/requests/index.ts index 4d8035a5..8ff3294f 100644 --- a/src/api/resources/products/client/requests/index.ts +++ b/src/api/resources/products/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type ProductsListRequest } from "./ProductsListRequest"; -export { type ProductSkuCreate } from "./ProductSkuCreate"; -export { type ProductSkuUpdate } from "./ProductSkuUpdate"; -export { type ProductsCreateSkuRequest } from "./ProductsCreateSkuRequest"; -export { type ProductsUpdateSkuRequest } from "./ProductsUpdateSkuRequest"; +export type { ProductSkuCreate } from "./ProductSkuCreate"; +export type { ProductSkuUpdate } from "./ProductSkuUpdate"; +export type { ProductsCreateSkuRequest } from "./ProductsCreateSkuRequest"; +export type { ProductsListRequest } from "./ProductsListRequest"; +export type { ProductsUpdateSkuRequest } from "./ProductsUpdateSkuRequest"; diff --git a/src/api/resources/products/index.ts b/src/api/resources/products/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/products/index.ts +++ b/src/api/resources/products/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/products/types/ProductSkuCreateProduct.ts b/src/api/resources/products/types/ProductSkuCreateProduct.ts index c8638f46..1a666686 100644 --- a/src/api/resources/products/types/ProductSkuCreateProduct.ts +++ b/src/api/resources/products/types/ProductSkuCreateProduct.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface ProductSkuCreateProduct { fieldData?: Webflow.ProductFieldData; diff --git a/src/api/resources/products/types/ProductSkuCreateSku.ts b/src/api/resources/products/types/ProductSkuCreateSku.ts index c704fa2f..90ee1f39 100644 --- a/src/api/resources/products/types/ProductSkuCreateSku.ts +++ b/src/api/resources/products/types/ProductSkuCreateSku.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface ProductSkuCreateSku { fieldData?: Webflow.SkuFieldData; diff --git a/src/api/resources/products/types/ProductsCreateSkuResponse.ts b/src/api/resources/products/types/ProductsCreateSkuResponse.ts index c0a565fa..3e8e25fb 100644 --- a/src/api/resources/products/types/ProductsCreateSkuResponse.ts +++ b/src/api/resources/products/types/ProductsCreateSkuResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface ProductsCreateSkuResponse { skus: Webflow.Sku[]; diff --git a/src/api/resources/scripts/client/Client.ts b/src/api/resources/scripts/client/Client.ts index dce2f569..0be75acc 100644 --- a/src/api/resources/scripts/client/Client.ts +++ b/src/api/resources/scripts/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Scripts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Scripts { @@ -71,21 +53,23 @@ export class Scripts { siteId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/registered_scripts`, + `sites/${core.url.encodePathParam(siteId)}/registered_scripts`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -217,28 +201,30 @@ export class Scripts { request: Webflow.CustomCodeHostedRequest, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/registered_scripts/hosted`, + `sites/${core.url.encodePathParam(siteId)}/registered_scripts/hosted`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CustomCodeHostedRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -369,28 +355,30 @@ export class Scripts { request: Webflow.CustomCodeInlineRequest, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/registered_scripts/inline`, + `sites/${core.url.encodePathParam(siteId)}/registered_scripts/inline`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CustomCodeInlineRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/scripts/client/index.ts b/src/api/resources/scripts/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/scripts/client/index.ts +++ b/src/api/resources/scripts/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/scripts/client/requests/CustomCodeHostedRequest.ts b/src/api/resources/scripts/client/requests/CustomCodeHostedRequest.ts index 3a5e5830..3c99646d 100644 --- a/src/api/resources/scripts/client/requests/CustomCodeHostedRequest.ts +++ b/src/api/resources/scripts/client/requests/CustomCodeHostedRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/scripts/client/requests/CustomCodeInlineRequest.ts b/src/api/resources/scripts/client/requests/CustomCodeInlineRequest.ts index d65f3d0e..0a088d3a 100644 --- a/src/api/resources/scripts/client/requests/CustomCodeInlineRequest.ts +++ b/src/api/resources/scripts/client/requests/CustomCodeInlineRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/scripts/client/requests/index.ts b/src/api/resources/scripts/client/requests/index.ts index 30d6b835..7a2d21e4 100644 --- a/src/api/resources/scripts/client/requests/index.ts +++ b/src/api/resources/scripts/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type CustomCodeHostedRequest } from "./CustomCodeHostedRequest"; -export { type CustomCodeInlineRequest } from "./CustomCodeInlineRequest"; +export type { CustomCodeHostedRequest } from "./CustomCodeHostedRequest"; +export type { CustomCodeInlineRequest } from "./CustomCodeInlineRequest"; diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index 4d3407a1..87f7654e 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -1,43 +1,25 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import { Redirects } from "../resources/redirects/client/Client"; -import { Plans } from "../resources/plans/client/Client"; -import { RobotsTxt } from "../resources/robotsTxt/client/Client"; -import { WellKnown } from "../resources/wellKnown/client/Client"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; import { ActivityLogs } from "../resources/activityLogs/client/Client"; import { Comments } from "../resources/comments/client/Client"; -import { Scripts } from "../resources/scripts/client/Client"; import { Forms } from "../resources/forms/client/Client"; +import { Plans } from "../resources/plans/client/Client"; +import { Redirects } from "../resources/redirects/client/Client"; +import { RobotsTxt } from "../resources/robotsTxt/client/Client"; +import { Scripts } from "../resources/scripts/client/Client"; +import { WellKnown } from "../resources/wellKnown/client/Client"; export declare namespace Sites { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } /** @@ -126,28 +108,30 @@ export class Sites { request: Webflow.SitesCreateRequest, requestOptions?: Sites.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `workspaces/${encodeURIComponent(workspaceId)}/sites`, + `workspaces/${core.url.encodePathParam(workspaceId)}/sites`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SitesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -260,21 +244,23 @@ export class Sites { } private async __list(requestOptions?: Sites.RequestOptions): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, "sites", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -376,21 +362,23 @@ export class Sites { siteId: string, requestOptions?: Sites.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}`, + `sites/${core.url.encodePathParam(siteId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -505,21 +493,23 @@ export class Sites { } private async __delete(siteId: string, requestOptions?: Sites.RequestOptions): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}`, + `sites/${core.url.encodePathParam(siteId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -636,28 +626,30 @@ export class Sites { request: Webflow.SitesUpdateRequest = {}, requestOptions?: Sites.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}`, + `sites/${core.url.encodePathParam(siteId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SitesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -777,21 +769,23 @@ export class Sites { siteId: string, requestOptions?: Sites.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/custom_domains`, + `sites/${core.url.encodePathParam(siteId)}/custom_domains`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -921,28 +915,30 @@ export class Sites { request: Webflow.SitesPublishRequest = {}, requestOptions?: Sites.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/publish`, + `sites/${core.url.encodePathParam(siteId)}/publish`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SitesPublishRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/client/index.ts b/src/api/resources/sites/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/sites/client/index.ts +++ b/src/api/resources/sites/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/sites/client/requests/SitesCreateRequest.ts b/src/api/resources/sites/client/requests/SitesCreateRequest.ts index c7911a56..ee2378a3 100644 --- a/src/api/resources/sites/client/requests/SitesCreateRequest.ts +++ b/src/api/resources/sites/client/requests/SitesCreateRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/sites/client/requests/SitesPublishRequest.ts b/src/api/resources/sites/client/requests/SitesPublishRequest.ts index 1cc22308..55b7a596 100644 --- a/src/api/resources/sites/client/requests/SitesPublishRequest.ts +++ b/src/api/resources/sites/client/requests/SitesPublishRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/sites/client/requests/SitesUpdateRequest.ts b/src/api/resources/sites/client/requests/SitesUpdateRequest.ts index 99058677..ef6e8d1b 100644 --- a/src/api/resources/sites/client/requests/SitesUpdateRequest.ts +++ b/src/api/resources/sites/client/requests/SitesUpdateRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/sites/client/requests/index.ts b/src/api/resources/sites/client/requests/index.ts index b802fad3..7fc59b25 100644 --- a/src/api/resources/sites/client/requests/index.ts +++ b/src/api/resources/sites/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type SitesCreateRequest } from "./SitesCreateRequest"; -export { type SitesUpdateRequest } from "./SitesUpdateRequest"; -export { type SitesPublishRequest } from "./SitesPublishRequest"; +export type { SitesCreateRequest } from "./SitesCreateRequest"; +export type { SitesPublishRequest } from "./SitesPublishRequest"; +export type { SitesUpdateRequest } from "./SitesUpdateRequest"; diff --git a/src/api/resources/sites/index.ts b/src/api/resources/sites/index.ts index a931b363..fb00ab43 100644 --- a/src/api/resources/sites/index.ts +++ b/src/api/resources/sites/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * from "./resources"; export * from "./client"; +export * from "./resources"; +export * from "./types"; diff --git a/src/api/resources/sites/resources/activityLogs/client/Client.ts b/src/api/resources/sites/resources/activityLogs/client/Client.ts index 3bb413b1..881dd856 100644 --- a/src/api/resources/sites/resources/activityLogs/client/Client.ts +++ b/src/api/resources/sites/resources/activityLogs/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace ActivityLogs { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class ActivityLogs { @@ -77,29 +59,30 @@ export class ActivityLogs { const { limit, offset } = request; const _queryParams: Record = {}; if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/activity_logs`, + `sites/${core.url.encodePathParam(siteId)}/activity_logs`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/activityLogs/client/index.ts b/src/api/resources/sites/resources/activityLogs/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/sites/resources/activityLogs/client/index.ts +++ b/src/api/resources/sites/resources/activityLogs/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/activityLogs/client/requests/ActivityLogsListRequest.ts b/src/api/resources/sites/resources/activityLogs/client/requests/ActivityLogsListRequest.ts index e9351691..f04d34d8 100644 --- a/src/api/resources/sites/resources/activityLogs/client/requests/ActivityLogsListRequest.ts +++ b/src/api/resources/sites/resources/activityLogs/client/requests/ActivityLogsListRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface ActivityLogsListRequest { - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; } diff --git a/src/api/resources/sites/resources/activityLogs/client/requests/index.ts b/src/api/resources/sites/resources/activityLogs/client/requests/index.ts index c22e9ae2..ddd3248d 100644 --- a/src/api/resources/sites/resources/activityLogs/client/requests/index.ts +++ b/src/api/resources/sites/resources/activityLogs/client/requests/index.ts @@ -1 +1 @@ -export { type ActivityLogsListRequest } from "./ActivityLogsListRequest"; +export type { ActivityLogsListRequest } from "./ActivityLogsListRequest"; diff --git a/src/api/resources/sites/resources/comments/client/Client.ts b/src/api/resources/sites/resources/comments/client/Client.ts index eeba63bf..b408aeeb 100644 --- a/src/api/resources/sites/resources/comments/client/Client.ts +++ b/src/api/resources/sites/resources/comments/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace Comments { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Comments { @@ -83,19 +65,19 @@ export class Comments { const { localeId, offset, limit, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (sortBy != null) { - _queryParams["sortBy"] = serializers.sites.CommentsListCommentThreadsRequestSortBy.jsonOrThrow(sortBy, { + _queryParams.sortBy = serializers.sites.CommentsListCommentThreadsRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -103,7 +85,7 @@ export class Comments { } if (sortOrder != null) { - _queryParams["sortOrder"] = serializers.sites.CommentsListCommentThreadsRequestSortOrder.jsonOrThrow( + _queryParams.sortOrder = serializers.sites.CommentsListCommentThreadsRequestSortOrder.jsonOrThrow( sortOrder, { unrecognizedObjectKeys: "passthrough", @@ -113,22 +95,23 @@ export class Comments { ); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/comments`, + `sites/${core.url.encodePathParam(siteId)}/comments`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -267,19 +250,19 @@ export class Comments { const { localeId, offset, limit, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (sortBy != null) { - _queryParams["sortBy"] = serializers.sites.CommentsGetCommentThreadRequestSortBy.jsonOrThrow(sortBy, { + _queryParams.sortBy = serializers.sites.CommentsGetCommentThreadRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -287,32 +270,30 @@ export class Comments { } if (sortOrder != null) { - _queryParams["sortOrder"] = serializers.sites.CommentsGetCommentThreadRequestSortOrder.jsonOrThrow( - sortOrder, - { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - }, - ); + _queryParams.sortOrder = serializers.sites.CommentsGetCommentThreadRequestSortOrder.jsonOrThrow(sortOrder, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}`, + `sites/${core.url.encodePathParam(siteId)}/comments/${core.url.encodePathParam(commentThreadId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -453,19 +434,19 @@ export class Comments { const { localeId, offset, limit, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams["localeId"] = localeId; + _queryParams.localeId = localeId; } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (sortBy != null) { - _queryParams["sortBy"] = serializers.sites.CommentsListCommentRepliesRequestSortBy.jsonOrThrow(sortBy, { + _queryParams.sortBy = serializers.sites.CommentsListCommentRepliesRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -473,7 +454,7 @@ export class Comments { } if (sortOrder != null) { - _queryParams["sortOrder"] = serializers.sites.CommentsListCommentRepliesRequestSortOrder.jsonOrThrow( + _queryParams.sortOrder = serializers.sites.CommentsListCommentRepliesRequestSortOrder.jsonOrThrow( sortOrder, { unrecognizedObjectKeys: "passthrough", @@ -483,22 +464,23 @@ export class Comments { ); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}/replies`, + `sites/${core.url.encodePathParam(siteId)}/comments/${core.url.encodePathParam(commentThreadId)}/replies`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/comments/client/index.ts b/src/api/resources/sites/resources/comments/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/sites/resources/comments/client/index.ts +++ b/src/api/resources/sites/resources/comments/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts b/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts index 5d0862c9..929f218b 100644 --- a/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -21,20 +19,12 @@ export interface CommentsGetCommentThreadRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Sort results by the provided value. Only allowed when sortOrder is provided. - */ + /** Sort results by the provided value. Only allowed when sortOrder is provided. */ sortBy?: Webflow.sites.CommentsGetCommentThreadRequestSortBy; - /** - * Sorts the results by asc or desc - */ + /** Sorts the results by asc or desc */ sortOrder?: Webflow.sites.CommentsGetCommentThreadRequestSortOrder; } diff --git a/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts index 25c64593..5512c9c6 100644 --- a/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -21,20 +19,12 @@ export interface CommentsListCommentRepliesRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Sort results by the provided value. Only allowed when sortOrder is provided. - */ + /** Sort results by the provided value. Only allowed when sortOrder is provided. */ sortBy?: Webflow.sites.CommentsListCommentRepliesRequestSortBy; - /** - * Sorts the results by asc or desc - */ + /** Sorts the results by asc or desc */ sortOrder?: Webflow.sites.CommentsListCommentRepliesRequestSortOrder; } diff --git a/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts index 3aaa0c23..ad313708 100644 --- a/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -21,20 +19,12 @@ export interface CommentsListCommentThreadsRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Sort results by the provided value. Only allowed when sortOrder is provided. - */ + /** Sort results by the provided value. Only allowed when sortOrder is provided. */ sortBy?: Webflow.sites.CommentsListCommentThreadsRequestSortBy; - /** - * Sorts the results by asc or desc - */ + /** Sorts the results by asc or desc */ sortOrder?: Webflow.sites.CommentsListCommentThreadsRequestSortOrder; } diff --git a/src/api/resources/sites/resources/comments/client/requests/index.ts b/src/api/resources/sites/resources/comments/client/requests/index.ts index 6a4c7581..28bcd5b9 100644 --- a/src/api/resources/sites/resources/comments/client/requests/index.ts +++ b/src/api/resources/sites/resources/comments/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type CommentsListCommentThreadsRequest } from "./CommentsListCommentThreadsRequest"; -export { type CommentsGetCommentThreadRequest } from "./CommentsGetCommentThreadRequest"; -export { type CommentsListCommentRepliesRequest } from "./CommentsListCommentRepliesRequest"; +export type { CommentsGetCommentThreadRequest } from "./CommentsGetCommentThreadRequest"; +export type { CommentsListCommentRepliesRequest } from "./CommentsListCommentRepliesRequest"; +export type { CommentsListCommentThreadsRequest } from "./CommentsListCommentThreadsRequest"; diff --git a/src/api/resources/sites/resources/comments/index.ts b/src/api/resources/sites/resources/comments/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/sites/resources/comments/index.ts +++ b/src/api/resources/sites/resources/comments/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts index 745d5440..aeee91d4 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CommentsGetCommentThreadRequestSortBy = "createdOn" | "lastUpdated"; export const CommentsGetCommentThreadRequestSortBy = { CreatedOn: "createdOn", LastUpdated: "lastUpdated", } as const; +export type CommentsGetCommentThreadRequestSortBy = + (typeof CommentsGetCommentThreadRequestSortBy)[keyof typeof CommentsGetCommentThreadRequestSortBy]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts index 065b226b..d999530d 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CommentsGetCommentThreadRequestSortOrder = "asc" | "desc"; export const CommentsGetCommentThreadRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; +export type CommentsGetCommentThreadRequestSortOrder = + (typeof CommentsGetCommentThreadRequestSortOrder)[keyof typeof CommentsGetCommentThreadRequestSortOrder]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts index 61bb74eb..ff317651 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CommentsListCommentRepliesRequestSortBy = "createdOn" | "lastUpdated"; export const CommentsListCommentRepliesRequestSortBy = { CreatedOn: "createdOn", LastUpdated: "lastUpdated", } as const; +export type CommentsListCommentRepliesRequestSortBy = + (typeof CommentsListCommentRepliesRequestSortBy)[keyof typeof CommentsListCommentRepliesRequestSortBy]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts index 4ca7594b..290ce704 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CommentsListCommentRepliesRequestSortOrder = "asc" | "desc"; export const CommentsListCommentRepliesRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; +export type CommentsListCommentRepliesRequestSortOrder = + (typeof CommentsListCommentRepliesRequestSortOrder)[keyof typeof CommentsListCommentRepliesRequestSortOrder]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts index d04dd360..59340376 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CommentsListCommentThreadsRequestSortBy = "createdOn" | "lastUpdated"; export const CommentsListCommentThreadsRequestSortBy = { CreatedOn: "createdOn", LastUpdated: "lastUpdated", } as const; +export type CommentsListCommentThreadsRequestSortBy = + (typeof CommentsListCommentThreadsRequestSortBy)[keyof typeof CommentsListCommentThreadsRequestSortBy]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts index 1121b941..005ab1af 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CommentsListCommentThreadsRequestSortOrder = "asc" | "desc"; export const CommentsListCommentThreadsRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; +export type CommentsListCommentThreadsRequestSortOrder = + (typeof CommentsListCommentThreadsRequestSortOrder)[keyof typeof CommentsListCommentThreadsRequestSortOrder]; diff --git a/src/api/resources/sites/resources/comments/types/index.ts b/src/api/resources/sites/resources/comments/types/index.ts index 0d2c5090..b2ed8e9b 100644 --- a/src/api/resources/sites/resources/comments/types/index.ts +++ b/src/api/resources/sites/resources/comments/types/index.ts @@ -1,6 +1,6 @@ -export * from "./CommentsListCommentThreadsRequestSortBy"; -export * from "./CommentsListCommentThreadsRequestSortOrder"; export * from "./CommentsGetCommentThreadRequestSortBy"; export * from "./CommentsGetCommentThreadRequestSortOrder"; export * from "./CommentsListCommentRepliesRequestSortBy"; export * from "./CommentsListCommentRepliesRequestSortOrder"; +export * from "./CommentsListCommentThreadsRequestSortBy"; +export * from "./CommentsListCommentThreadsRequestSortOrder"; diff --git a/src/api/resources/sites/resources/forms/client/Client.ts b/src/api/resources/sites/resources/forms/client/Client.ts index 6fb29cd5..3f11dfc4 100644 --- a/src/api/resources/sites/resources/forms/client/Client.ts +++ b/src/api/resources/sites/resources/forms/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace Forms { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Forms { @@ -86,33 +68,34 @@ export class Forms { const { elementId, offset, limit } = request; const _queryParams: Record = {}; if (elementId != null) { - _queryParams["elementId"] = elementId; + _queryParams.elementId = elementId; } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/form_submissions`, + `sites/${core.url.encodePathParam(siteId)}/form_submissions`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -249,29 +232,30 @@ export class Forms { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/forms/${encodeURIComponent(formId)}/submissions`, + `sites/${core.url.encodePathParam(siteId)}/forms/${core.url.encodePathParam(formId)}/submissions`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -397,21 +381,23 @@ export class Forms { formSubmissionId: string, requestOptions?: Forms.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, + `sites/${core.url.encodePathParam(siteId)}/form_submissions/${core.url.encodePathParam(formSubmissionId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -538,21 +524,23 @@ export class Forms { formSubmissionId: string, requestOptions?: Forms.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, + `sites/${core.url.encodePathParam(siteId)}/form_submissions/${core.url.encodePathParam(formSubmissionId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -677,28 +665,30 @@ export class Forms { request: Webflow.sites.FormsUpdateSubmissionRequest = {}, requestOptions?: Forms.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, + `sites/${core.url.encodePathParam(siteId)}/form_submissions/${core.url.encodePathParam(formSubmissionId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.sites.FormsUpdateSubmissionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/forms/client/index.ts b/src/api/resources/sites/resources/forms/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/sites/resources/forms/client/index.ts +++ b/src/api/resources/sites/resources/forms/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsBySiteRequest.ts b/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsBySiteRequest.ts index 8b7ddaf4..08e87c9a 100644 --- a/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsBySiteRequest.ts +++ b/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsBySiteRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,16 +9,10 @@ * } */ export interface FormsListSubmissionsBySiteRequest { - /** - * Identifier for an element - */ + /** Identifier for an element */ elementId?: string; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; } diff --git a/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsRequest.ts b/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsRequest.ts index 56f85c8a..91c686e5 100644 --- a/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsRequest.ts +++ b/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface FormsListSubmissionsRequest { - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; } diff --git a/src/api/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts b/src/api/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts index d0c8dfb4..16be9837 100644 --- a/src/api/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts +++ b/src/api/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/sites/resources/forms/client/requests/index.ts b/src/api/resources/sites/resources/forms/client/requests/index.ts index f5f527d3..7b55dd20 100644 --- a/src/api/resources/sites/resources/forms/client/requests/index.ts +++ b/src/api/resources/sites/resources/forms/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type FormsListSubmissionsBySiteRequest } from "./FormsListSubmissionsBySiteRequest"; -export { type FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; -export { type FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; +export type { FormsListSubmissionsBySiteRequest } from "./FormsListSubmissionsBySiteRequest"; +export type { FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; +export type { FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; diff --git a/src/api/resources/sites/resources/index.ts b/src/api/resources/sites/resources/index.ts index ae08c39f..61f7706e 100644 --- a/src/api/resources/sites/resources/index.ts +++ b/src/api/resources/sites/resources/index.ts @@ -1,15 +1,15 @@ -export * as wellKnown from "./wellKnown"; -export * from "./wellKnown/types"; +export * as activityLogs from "./activityLogs"; +export * from "./activityLogs/client/requests"; export * as comments from "./comments"; +export * from "./comments/client/requests"; export * from "./comments/types"; -export * as redirects from "./redirects"; +export * as forms from "./forms"; +export * from "./forms/client/requests"; export * as plans from "./plans"; +export * as redirects from "./redirects"; export * as robotsTxt from "./robotsTxt"; -export * as activityLogs from "./activityLogs"; export * as scripts from "./scripts"; -export * as forms from "./forms"; -export * from "./wellKnown/client/requests"; -export * from "./activityLogs/client/requests"; -export * from "./comments/client/requests"; export * from "./scripts/client/requests"; -export * from "./forms/client/requests"; +export * as wellKnown from "./wellKnown"; +export * from "./wellKnown/client/requests"; +export * from "./wellKnown/types"; diff --git a/src/api/resources/sites/resources/plans/client/Client.ts b/src/api/resources/sites/resources/plans/client/Client.ts index 740813e2..06b9854f 100644 --- a/src/api/resources/sites/resources/plans/client/Client.ts +++ b/src/api/resources/sites/resources/plans/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace Plans { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Plans { @@ -69,21 +51,23 @@ export class Plans { siteId: string, requestOptions?: Plans.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/plan`, + `sites/${core.url.encodePathParam(siteId)}/plan`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/redirects/client/Client.ts b/src/api/resources/sites/resources/redirects/client/Client.ts index 8d393634..f4c843dc 100644 --- a/src/api/resources/sites/resources/redirects/client/Client.ts +++ b/src/api/resources/sites/resources/redirects/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace Redirects { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Redirects { @@ -71,21 +53,23 @@ export class Redirects { siteId: string, requestOptions?: Redirects.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/redirects`, + `sites/${core.url.encodePathParam(siteId)}/redirects`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -214,28 +198,30 @@ export class Redirects { request: Webflow.Redirect, requestOptions?: Redirects.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/redirects`, + `sites/${core.url.encodePathParam(siteId)}/redirects`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Redirect.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -360,21 +346,23 @@ export class Redirects { redirectId: string, requestOptions?: Redirects.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/redirects/${encodeURIComponent(redirectId)}`, + `sites/${core.url.encodePathParam(siteId)}/redirects/${core.url.encodePathParam(redirectId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -506,28 +494,30 @@ export class Redirects { request: Webflow.Redirect, requestOptions?: Redirects.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/redirects/${encodeURIComponent(redirectId)}`, + `sites/${core.url.encodePathParam(siteId)}/redirects/${core.url.encodePathParam(redirectId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Redirect.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/robotsTxt/client/Client.ts b/src/api/resources/sites/resources/robotsTxt/client/Client.ts index 719e5607..4a922806 100644 --- a/src/api/resources/sites/resources/robotsTxt/client/Client.ts +++ b/src/api/resources/sites/resources/robotsTxt/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace RobotsTxt { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class RobotsTxt { @@ -66,21 +48,23 @@ export class RobotsTxt { siteId: string, requestOptions?: RobotsTxt.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/robots_txt`, + `sites/${core.url.encodePathParam(siteId)}/robots_txt`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -210,28 +194,30 @@ export class RobotsTxt { request: Webflow.Robots, requestOptions?: RobotsTxt.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/robots_txt`, + `sites/${core.url.encodePathParam(siteId)}/robots_txt`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Robots.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -362,28 +348,30 @@ export class RobotsTxt { request: Webflow.Robots, requestOptions?: RobotsTxt.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/robots_txt`, + `sites/${core.url.encodePathParam(siteId)}/robots_txt`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Robots.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -515,28 +503,30 @@ export class RobotsTxt { request: Webflow.Robots, requestOptions?: RobotsTxt.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/robots_txt`, + `sites/${core.url.encodePathParam(siteId)}/robots_txt`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Robots.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/scripts/client/Client.ts b/src/api/resources/sites/resources/scripts/client/Client.ts index dcc9031a..da6bdd3f 100644 --- a/src/api/resources/sites/resources/scripts/client/Client.ts +++ b/src/api/resources/sites/resources/scripts/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace Scripts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Scripts { @@ -71,21 +53,23 @@ export class Scripts { siteId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/custom_code`, + `sites/${core.url.encodePathParam(siteId)}/custom_code`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -223,28 +207,30 @@ export class Scripts { request: Webflow.ScriptApplyList, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/custom_code`, + `sites/${core.url.encodePathParam(siteId)}/custom_code`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ScriptApplyList.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -363,21 +349,23 @@ export class Scripts { siteId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/custom_code`, + `sites/${core.url.encodePathParam(siteId)}/custom_code`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -503,29 +491,30 @@ export class Scripts { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/custom_code/blocks`, + `sites/${core.url.encodePathParam(siteId)}/custom_code/blocks`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/scripts/client/index.ts b/src/api/resources/sites/resources/scripts/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/sites/resources/scripts/client/index.ts +++ b/src/api/resources/sites/resources/scripts/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/scripts/client/requests/ScriptsListCustomCodeBlocksRequest.ts b/src/api/resources/sites/resources/scripts/client/requests/ScriptsListCustomCodeBlocksRequest.ts index 5063abf4..7f7715c6 100644 --- a/src/api/resources/sites/resources/scripts/client/requests/ScriptsListCustomCodeBlocksRequest.ts +++ b/src/api/resources/sites/resources/scripts/client/requests/ScriptsListCustomCodeBlocksRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface ScriptsListCustomCodeBlocksRequest { - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; } diff --git a/src/api/resources/sites/resources/scripts/client/requests/index.ts b/src/api/resources/sites/resources/scripts/client/requests/index.ts index 32e771fa..01f0ce5d 100644 --- a/src/api/resources/sites/resources/scripts/client/requests/index.ts +++ b/src/api/resources/sites/resources/scripts/client/requests/index.ts @@ -1 +1 @@ -export { type ScriptsListCustomCodeBlocksRequest } from "./ScriptsListCustomCodeBlocksRequest"; +export type { ScriptsListCustomCodeBlocksRequest } from "./ScriptsListCustomCodeBlocksRequest"; diff --git a/src/api/resources/sites/resources/wellKnown/client/Client.ts b/src/api/resources/sites/resources/wellKnown/client/Client.ts index 8346e2dd..9c1a48b1 100644 --- a/src/api/resources/sites/resources/wellKnown/client/Client.ts +++ b/src/api/resources/sites/resources/wellKnown/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as serializers from "../../../../../../serialization/index"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace WellKnown { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class WellKnown { @@ -85,28 +67,30 @@ export class WellKnown { request: Webflow.sites.WellKnownFile, requestOptions?: WellKnown.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/well_known`, + `sites/${core.url.encodePathParam(siteId)}/well_known`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.sites.WellKnownFile.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -220,28 +204,30 @@ export class WellKnown { request: Webflow.sites.WellKnownDeleteRequest = {}, requestOptions?: WellKnown.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/well_known`, + `sites/${core.url.encodePathParam(siteId)}/well_known`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.sites.WellKnownDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/wellKnown/client/index.ts b/src/api/resources/sites/resources/wellKnown/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/sites/resources/wellKnown/client/index.ts +++ b/src/api/resources/sites/resources/wellKnown/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts index 12b026fe..971b614d 100644 --- a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts +++ b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts index 62a7c2cc..2168f9da 100644 --- a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts +++ b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example diff --git a/src/api/resources/sites/resources/wellKnown/client/requests/index.ts b/src/api/resources/sites/resources/wellKnown/client/requests/index.ts index 80d597d9..1d8b2183 100644 --- a/src/api/resources/sites/resources/wellKnown/client/requests/index.ts +++ b/src/api/resources/sites/resources/wellKnown/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type WellKnownFile } from "./WellKnownFile"; -export { type WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; +export type { WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; +export type { WellKnownFile } from "./WellKnownFile"; diff --git a/src/api/resources/sites/resources/wellKnown/index.ts b/src/api/resources/sites/resources/wellKnown/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/sites/resources/wellKnown/index.ts +++ b/src/api/resources/sites/resources/wellKnown/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts b/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts index c3192e7f..1b17879a 100644 --- a/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts +++ b/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The content type of the file. Defaults to application/json - */ -export type WellKnownFileContentType = "application/json" | "text/plain"; +/** The content type of the file. Defaults to application/json */ export const WellKnownFileContentType = { ApplicationJson: "application/json", TextPlain: "text/plain", } as const; +export type WellKnownFileContentType = (typeof WellKnownFileContentType)[keyof typeof WellKnownFileContentType]; diff --git a/src/api/resources/sites/types/SitesPublishResponse.ts b/src/api/resources/sites/types/SitesPublishResponse.ts index e427b61a..4b7bb2fb 100644 --- a/src/api/resources/sites/types/SitesPublishResponse.ts +++ b/src/api/resources/sites/types/SitesPublishResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface SitesPublishResponse { /** Array of domains objects */ diff --git a/src/api/resources/token/client/Client.ts b/src/api/resources/token/client/Client.ts index 8daffbd1..85c23549 100644 --- a/src/api/resources/token/client/Client.ts +++ b/src/api/resources/token/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Token { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Token { @@ -59,21 +41,23 @@ export class Token { private async __authorizedBy( requestOptions?: Token.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, "token/authorized_by", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -149,21 +133,23 @@ export class Token { private async __introspect( requestOptions?: Token.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, "token/introspect", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/users/client/Client.ts b/src/api/resources/users/client/Client.ts index 881c258e..51c906b2 100644 --- a/src/api/resources/users/client/Client.ts +++ b/src/api/resources/users/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import * as serializers from "../../../../serialization/index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Users { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Users { @@ -78,37 +60,38 @@ export class Users { const { offset, limit, sort } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (sort != null) { - _queryParams["sort"] = serializers.UsersListRequestSort.jsonOrThrow(sort, { + _queryParams.sort = serializers.UsersListRequestSort.jsonOrThrow(sort, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/users`, + `sites/${core.url.encodePathParam(siteId)}/users`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -232,21 +215,23 @@ export class Users { userId: string, requestOptions?: Users.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`, + `sites/${core.url.encodePathParam(siteId)}/users/${core.url.encodePathParam(userId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -372,21 +357,23 @@ export class Users { userId: string, requestOptions?: Users.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`, + `sites/${core.url.encodePathParam(siteId)}/users/${core.url.encodePathParam(userId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -521,28 +508,30 @@ export class Users { request: Webflow.User, requestOptions?: Users.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`, + `sites/${core.url.encodePathParam(siteId)}/users/${core.url.encodePathParam(userId)}`, ), method: "PATCH", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.User.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -674,28 +663,30 @@ export class Users { request: Webflow.UsersInviteRequest, requestOptions?: Users.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/users/invite`, + `sites/${core.url.encodePathParam(siteId)}/users/invite`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UsersInviteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/users/client/index.ts b/src/api/resources/users/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/users/client/index.ts +++ b/src/api/resources/users/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/users/client/requests/UsersInviteRequest.ts b/src/api/resources/users/client/requests/UsersInviteRequest.ts index 6af54ae3..ee3c353f 100644 --- a/src/api/resources/users/client/requests/UsersInviteRequest.ts +++ b/src/api/resources/users/client/requests/UsersInviteRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/users/client/requests/UsersListRequest.ts b/src/api/resources/users/client/requests/UsersListRequest.ts index e583aadb..a2b9065d 100644 --- a/src/api/resources/users/client/requests/UsersListRequest.ts +++ b/src/api/resources/users/client/requests/UsersListRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../index"; +import type * as Webflow from "../../../../index"; /** * @example @@ -13,13 +11,9 @@ import * as Webflow from "../../../../index"; * } */ export interface UsersListRequest { - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; /** * Sort string to use when ordering users diff --git a/src/api/resources/users/client/requests/index.ts b/src/api/resources/users/client/requests/index.ts index 3912aa4b..b6d806bb 100644 --- a/src/api/resources/users/client/requests/index.ts +++ b/src/api/resources/users/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type UsersListRequest } from "./UsersListRequest"; -export { type UsersInviteRequest } from "./UsersInviteRequest"; +export type { UsersInviteRequest } from "./UsersInviteRequest"; +export type { UsersListRequest } from "./UsersListRequest"; diff --git a/src/api/resources/users/index.ts b/src/api/resources/users/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/users/index.ts +++ b/src/api/resources/users/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/users/types/UserAccountAddedPayload.ts b/src/api/resources/users/types/UserAccountAddedPayload.ts index fc58a9ba..b23d0a7a 100644 --- a/src/api/resources/users/types/UserAccountAddedPayload.ts +++ b/src/api/resources/users/types/UserAccountAddedPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface UserAccountAddedPayload { triggerType?: "user_account_added"; diff --git a/src/api/resources/users/types/UserAccountAddedPayloadPayload.ts b/src/api/resources/users/types/UserAccountAddedPayloadPayload.ts index bb646a03..223d6ff7 100644 --- a/src/api/resources/users/types/UserAccountAddedPayloadPayload.ts +++ b/src/api/resources/users/types/UserAccountAddedPayloadPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface UserAccountAddedPayloadPayload { /** The data about the user account that was added */ diff --git a/src/api/resources/users/types/UserAccountAddedPayloadPayloadData.ts b/src/api/resources/users/types/UserAccountAddedPayloadPayloadData.ts index a9c9b712..ab0bf8eb 100644 --- a/src/api/resources/users/types/UserAccountAddedPayloadPayloadData.ts +++ b/src/api/resources/users/types/UserAccountAddedPayloadPayloadData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The data about the user account that was added diff --git a/src/api/resources/users/types/UserAccountDeletedPayload.ts b/src/api/resources/users/types/UserAccountDeletedPayload.ts index 419718d0..b9cefe9e 100644 --- a/src/api/resources/users/types/UserAccountDeletedPayload.ts +++ b/src/api/resources/users/types/UserAccountDeletedPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface UserAccountDeletedPayload { triggerType?: "user_account_deleted"; diff --git a/src/api/resources/users/types/UserAccountDeletedPayloadPayload.ts b/src/api/resources/users/types/UserAccountDeletedPayloadPayload.ts index 40e3a24d..630739ea 100644 --- a/src/api/resources/users/types/UserAccountDeletedPayloadPayload.ts +++ b/src/api/resources/users/types/UserAccountDeletedPayloadPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface UserAccountDeletedPayloadPayload { /** The data about the user account that was added */ diff --git a/src/api/resources/users/types/UserAccountDeletedPayloadPayloadData.ts b/src/api/resources/users/types/UserAccountDeletedPayloadPayloadData.ts index 21e16380..4cf4deb2 100644 --- a/src/api/resources/users/types/UserAccountDeletedPayloadPayloadData.ts +++ b/src/api/resources/users/types/UserAccountDeletedPayloadPayloadData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The data about the user account that was added diff --git a/src/api/resources/users/types/UserAccountUpdatedPayload.ts b/src/api/resources/users/types/UserAccountUpdatedPayload.ts index 9718b762..e8e4be4e 100644 --- a/src/api/resources/users/types/UserAccountUpdatedPayload.ts +++ b/src/api/resources/users/types/UserAccountUpdatedPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface UserAccountUpdatedPayload { triggerType?: "user_account_updated"; diff --git a/src/api/resources/users/types/UserAccountUpdatedPayloadPayload.ts b/src/api/resources/users/types/UserAccountUpdatedPayloadPayload.ts index 1de45d36..9acb7380 100644 --- a/src/api/resources/users/types/UserAccountUpdatedPayloadPayload.ts +++ b/src/api/resources/users/types/UserAccountUpdatedPayloadPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../index"; +import type * as Webflow from "../../../index"; export interface UserAccountUpdatedPayloadPayload { /** The data about the user account that was added */ diff --git a/src/api/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts b/src/api/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts index a97a6132..cce2dc0a 100644 --- a/src/api/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts +++ b/src/api/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The data about the user account that was added diff --git a/src/api/resources/users/types/UsersListRequestSort.ts b/src/api/resources/users/types/UsersListRequestSort.ts index e2c62d3f..e31cae7f 100644 --- a/src/api/resources/users/types/UsersListRequestSort.ts +++ b/src/api/resources/users/types/UsersListRequestSort.ts @@ -1,47 +1,35 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type UsersListRequestSort = +export const UsersListRequestSort = { /** * Sorts users in ascending order based on their created date */ - | "CreatedOn" + CreatedOnAscending: "CreatedOn", /** * Sorts users in descending order based on their created date */ - | "-CreatedOn" + CreatedOnDescending: "-CreatedOn", /** * Sorts users in ascending order based on their email */ - | "Email" + EmailAscending: "Email", /** * Sorts users in descending order based on their email */ - | "-Email" + EmailDescending: "-Email", /** * Sorts users in ascending order based on their status */ - | "Status" + StatusAscending: "Status", /** * Sorts users in descending order based on their status */ - | "-Status" + StatusDescending: "-Status", /** * Sorts users in ascending order based on their last login date */ - | "LastLogin" + LastLoginAscending: "LastLogin", /** * Sorts users in descending order based on their last login date */ - | "-LastLogin" + LastLoginDescending: "-LastLogin", /** * Sorts users in ascending order based on their update date */ - | "UpdatedOn" + UpdatedOnAscending: "UpdatedOn", /** * Sorts users in descending order based on their update date */ - | "-UpdatedOn"; -export const UsersListRequestSort = { - CreatedOnAscending: "CreatedOn", - CreatedOnDescending: "-CreatedOn", - EmailAscending: "Email", - EmailDescending: "-Email", - StatusAscending: "Status", - StatusDescending: "-Status", - LastLoginAscending: "LastLogin", - LastLoginDescending: "-LastLogin", - UpdatedOnAscending: "UpdatedOn", UpdatedOnDescending: "-UpdatedOn", } as const; +export type UsersListRequestSort = (typeof UsersListRequestSort)[keyof typeof UsersListRequestSort]; diff --git a/src/api/resources/users/types/index.ts b/src/api/resources/users/types/index.ts index 258617f4..38625be7 100644 --- a/src/api/resources/users/types/index.ts +++ b/src/api/resources/users/types/index.ts @@ -1,10 +1,10 @@ -export * from "./UsersListRequestSort"; -export * from "./UserAccountAddedPayloadPayloadData"; -export * from "./UserAccountAddedPayloadPayload"; export * from "./UserAccountAddedPayload"; -export * from "./UserAccountUpdatedPayloadPayloadData"; -export * from "./UserAccountUpdatedPayloadPayload"; -export * from "./UserAccountUpdatedPayload"; -export * from "./UserAccountDeletedPayloadPayloadData"; -export * from "./UserAccountDeletedPayloadPayload"; +export * from "./UserAccountAddedPayloadPayload"; +export * from "./UserAccountAddedPayloadPayloadData"; export * from "./UserAccountDeletedPayload"; +export * from "./UserAccountDeletedPayloadPayload"; +export * from "./UserAccountDeletedPayloadPayloadData"; +export * from "./UserAccountUpdatedPayload"; +export * from "./UserAccountUpdatedPayloadPayload"; +export * from "./UserAccountUpdatedPayloadPayloadData"; +export * from "./UsersListRequestSort"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index 3fef40e1..3d55ca36 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Webflow from "../../../index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import * as Webflow from "../../../index"; export declare namespace Webhooks { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } /** @@ -70,21 +52,23 @@ export class Webhooks { siteId: string, requestOptions?: Webhooks.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/webhooks`, + `sites/${core.url.encodePathParam(siteId)}/webhooks`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -216,28 +200,30 @@ export class Webhooks { request: Webflow.Webhook, requestOptions?: Webhooks.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${encodeURIComponent(siteId)}/webhooks`, + `sites/${core.url.encodePathParam(siteId)}/webhooks`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Webhook.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -352,21 +338,23 @@ export class Webhooks { webhookId: string, requestOptions?: Webhooks.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `webhooks/${encodeURIComponent(webhookId)}`, + `webhooks/${core.url.encodePathParam(webhookId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -481,21 +469,23 @@ export class Webhooks { webhookId: string, requestOptions?: Webhooks.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `webhooks/${encodeURIComponent(webhookId)}`, + `webhooks/${core.url.encodePathParam(webhookId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/workspaces/client/Client.ts b/src/api/resources/workspaces/client/Client.ts index 579b9e20..ecfe1eeb 100644 --- a/src/api/resources/workspaces/client/Client.ts +++ b/src/api/resources/workspaces/client/Client.ts @@ -1,20 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; -import * as core from "../../../../core"; +import type { BaseClientOptions } from "../../../../BaseClient"; import { AuditLogs } from "../resources/auditLogs/client/Client"; export declare namespace Workspaces { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} } export class Workspaces { diff --git a/src/api/resources/workspaces/index.ts b/src/api/resources/workspaces/index.ts index 4ce0f390..33a87f10 100644 --- a/src/api/resources/workspaces/index.ts +++ b/src/api/resources/workspaces/index.ts @@ -1,2 +1,2 @@ -export * from "./resources"; export * from "./client"; +export * from "./resources"; diff --git a/src/api/resources/workspaces/resources/auditLogs/client/Client.ts b/src/api/resources/workspaces/resources/auditLogs/client/Client.ts index 2891a903..3a0e15e8 100644 --- a/src/api/resources/workspaces/resources/auditLogs/client/Client.ts +++ b/src/api/resources/workspaces/resources/auditLogs/client/Client.ts @@ -1,35 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Webflow from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import urlJoin from "url-join"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as Webflow from "../../../../../index"; export declare namespace AuditLogs { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - accessToken?: core.Supplier; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class AuditLogs { @@ -84,55 +66,60 @@ export class AuditLogs { const { limit, offset, sortOrder, eventType, from: from_, to } = request; const _queryParams: Record = {}; if (limit != null) { - _queryParams["limit"] = limit.toString(); + _queryParams.limit = limit.toString(); } if (offset != null) { - _queryParams["offset"] = offset.toString(); + _queryParams.offset = offset.toString(); } if (sortOrder != null) { - _queryParams["sortOrder"] = - serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestSortOrder.jsonOrThrow(sortOrder, { + _queryParams.sortOrder = serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestSortOrder.jsonOrThrow( + sortOrder, + { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, - }); + }, + ); } if (eventType != null) { - _queryParams["eventType"] = - serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestEventType.jsonOrThrow(eventType, { + _queryParams.eventType = serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestEventType.jsonOrThrow( + eventType, + { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, - }); + }, + ); } if (from_ != null) { - _queryParams["from"] = from_.toISOString(); + _queryParams.from = from_.toISOString(); } if (to != null) { - _queryParams["to"] = to.toISOString(); + _queryParams.to = to.toISOString(); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ); const _response = await core.fetcher({ - url: urlJoin( + url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `workspaces/${encodeURIComponent(workspaceIdOrSlug)}/audit_logs`, + `workspaces/${core.url.encodePathParam(workspaceIdOrSlug)}/audit_logs`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/workspaces/resources/auditLogs/client/index.ts b/src/api/resources/workspaces/resources/auditLogs/client/index.ts index f33205a0..415726b7 100644 --- a/src/api/resources/workspaces/resources/auditLogs/client/index.ts +++ b/src/api/resources/workspaces/resources/auditLogs/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/workspaces/resources/auditLogs/client/requests/AuditLogsGetWorkspaceAuditLogsRequest.ts b/src/api/resources/workspaces/resources/auditLogs/client/requests/AuditLogsGetWorkspaceAuditLogsRequest.ts index 9d125874..3165c505 100644 --- a/src/api/resources/workspaces/resources/auditLogs/client/requests/AuditLogsGetWorkspaceAuditLogsRequest.ts +++ b/src/api/resources/workspaces/resources/auditLogs/client/requests/AuditLogsGetWorkspaceAuditLogsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../../../../../../index"; +import type * as Webflow from "../../../../../../index"; /** * @example @@ -16,28 +14,16 @@ import * as Webflow from "../../../../../../index"; * } */ export interface AuditLogsGetWorkspaceAuditLogsRequest { - /** - * Maximum number of records to be returned (max limit: 100) - */ + /** Maximum number of records to be returned (max limit: 100) */ limit?: number; - /** - * Offset used for pagination if the results have more than limit records - */ + /** Offset used for pagination if the results have more than limit records */ offset?: number; - /** - * Sorts the results by asc or desc - */ + /** Sorts the results by asc or desc */ sortOrder?: Webflow.workspaces.AuditLogsGetWorkspaceAuditLogsRequestSortOrder; - /** - * The event type to filter by - */ + /** The event type to filter by */ eventType?: Webflow.workspaces.AuditLogsGetWorkspaceAuditLogsRequestEventType; - /** - * The start date to filter by - */ + /** The start date to filter by */ from?: Date; - /** - * The end date to filter by - */ + /** The end date to filter by */ to?: Date; } diff --git a/src/api/resources/workspaces/resources/auditLogs/client/requests/index.ts b/src/api/resources/workspaces/resources/auditLogs/client/requests/index.ts index bd4dd6b0..b587fe28 100644 --- a/src/api/resources/workspaces/resources/auditLogs/client/requests/index.ts +++ b/src/api/resources/workspaces/resources/auditLogs/client/requests/index.ts @@ -1 +1 @@ -export { type AuditLogsGetWorkspaceAuditLogsRequest } from "./AuditLogsGetWorkspaceAuditLogsRequest"; +export type { AuditLogsGetWorkspaceAuditLogsRequest } from "./AuditLogsGetWorkspaceAuditLogsRequest"; diff --git a/src/api/resources/workspaces/resources/auditLogs/index.ts b/src/api/resources/workspaces/resources/auditLogs/index.ts index c9240f83..d2ec2302 100644 --- a/src/api/resources/workspaces/resources/auditLogs/index.ts +++ b/src/api/resources/workspaces/resources/auditLogs/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts b/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts index 98d1c579..bc462606 100644 --- a/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts +++ b/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts @@ -1,13 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type AuditLogsGetWorkspaceAuditLogsRequestEventType = - | "user_access" - | "custom_role" - | "workspace_membership" - | "site_membership" - | "workspace_invitation"; export const AuditLogsGetWorkspaceAuditLogsRequestEventType = { UserAccess: "user_access", CustomRole: "custom_role", @@ -15,3 +7,5 @@ export const AuditLogsGetWorkspaceAuditLogsRequestEventType = { SiteMembership: "site_membership", WorkspaceInvitation: "workspace_invitation", } as const; +export type AuditLogsGetWorkspaceAuditLogsRequestEventType = + (typeof AuditLogsGetWorkspaceAuditLogsRequestEventType)[keyof typeof AuditLogsGetWorkspaceAuditLogsRequestEventType]; diff --git a/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts b/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts index ba8d6c9d..efdcd8be 100644 --- a/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts +++ b/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type AuditLogsGetWorkspaceAuditLogsRequestSortOrder = "asc" | "desc"; export const AuditLogsGetWorkspaceAuditLogsRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; +export type AuditLogsGetWorkspaceAuditLogsRequestSortOrder = + (typeof AuditLogsGetWorkspaceAuditLogsRequestSortOrder)[keyof typeof AuditLogsGetWorkspaceAuditLogsRequestSortOrder]; diff --git a/src/api/resources/workspaces/resources/auditLogs/types/index.ts b/src/api/resources/workspaces/resources/auditLogs/types/index.ts index cfaf464d..41fb105c 100644 --- a/src/api/resources/workspaces/resources/auditLogs/types/index.ts +++ b/src/api/resources/workspaces/resources/auditLogs/types/index.ts @@ -1,2 +1,2 @@ -export * from "./AuditLogsGetWorkspaceAuditLogsRequestSortOrder"; export * from "./AuditLogsGetWorkspaceAuditLogsRequestEventType"; +export * from "./AuditLogsGetWorkspaceAuditLogsRequestSortOrder"; diff --git a/src/api/resources/workspaces/resources/index.ts b/src/api/resources/workspaces/resources/index.ts index 7c178d39..da3e9fbf 100644 --- a/src/api/resources/workspaces/resources/index.ts +++ b/src/api/resources/workspaces/resources/index.ts @@ -1,3 +1,3 @@ export * as auditLogs from "./auditLogs"; -export * from "./auditLogs/types"; export * from "./auditLogs/client/requests"; +export * from "./auditLogs/types"; diff --git a/src/api/types/AccessGroup.ts b/src/api/types/AccessGroup.ts index d94688bc..e98d2e8a 100644 --- a/src/api/types/AccessGroup.ts +++ b/src/api/types/AccessGroup.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface AccessGroup { /** Unique identifier for the Access Group */ diff --git a/src/api/types/AccessGroupList.ts b/src/api/types/AccessGroupList.ts index f76f25f1..d4b46af4 100644 --- a/src/api/types/AccessGroupList.ts +++ b/src/api/types/AccessGroupList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The list access groups results diff --git a/src/api/types/Application.ts b/src/api/types/Application.ts index 18c66866..de739638 100644 --- a/src/api/types/Application.ts +++ b/src/api/types/Application.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface Application { /** Unique identifier for the Application */ diff --git a/src/api/types/Asset.ts b/src/api/types/Asset.ts index 3c1ed56f..3346e95f 100644 --- a/src/api/types/Asset.ts +++ b/src/api/types/Asset.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Asset details diff --git a/src/api/types/AssetFolder.ts b/src/api/types/AssetFolder.ts index 9affae5a..7708b8de 100644 --- a/src/api/types/AssetFolder.ts +++ b/src/api/types/AssetFolder.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Asset Folder details diff --git a/src/api/types/AssetFolderList.ts b/src/api/types/AssetFolderList.ts index 7618d6cb..bd157908 100644 --- a/src/api/types/AssetFolderList.ts +++ b/src/api/types/AssetFolderList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Asset Folders object diff --git a/src/api/types/AssetUpload.ts b/src/api/types/AssetUpload.ts index 748fe76e..31128215 100644 --- a/src/api/types/AssetUpload.ts +++ b/src/api/types/AssetUpload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface AssetUpload { /** Metadata for uploading the asset binary */ diff --git a/src/api/types/AssetUploadUploadDetails.ts b/src/api/types/AssetUploadUploadDetails.ts index 8226a132..88a246b7 100644 --- a/src/api/types/AssetUploadUploadDetails.ts +++ b/src/api/types/AssetUploadUploadDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Metadata for uploading the asset binary diff --git a/src/api/types/AssetVariant.ts b/src/api/types/AssetVariant.ts index 86700495..db9eb57f 100644 --- a/src/api/types/AssetVariant.ts +++ b/src/api/types/AssetVariant.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Asset variant details diff --git a/src/api/types/Assets.ts b/src/api/types/Assets.ts index 46b4681b..0879598a 100644 --- a/src/api/types/Assets.ts +++ b/src/api/types/Assets.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A list of assets diff --git a/src/api/types/Authorization.ts b/src/api/types/Authorization.ts index 192aaa3b..62dbdc81 100644 --- a/src/api/types/Authorization.ts +++ b/src/api/types/Authorization.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface Authorization { /** The Authorization object */ diff --git a/src/api/types/AuthorizationAuthorization.ts b/src/api/types/AuthorizationAuthorization.ts index 3527fde3..f7d57373 100644 --- a/src/api/types/AuthorizationAuthorization.ts +++ b/src/api/types/AuthorizationAuthorization.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Authorization object diff --git a/src/api/types/AuthorizationAuthorizationAuthorizedTo.ts b/src/api/types/AuthorizationAuthorizationAuthorizedTo.ts index 0e34e40c..1d9f74b8 100644 --- a/src/api/types/AuthorizationAuthorizationAuthorizedTo.ts +++ b/src/api/types/AuthorizationAuthorizationAuthorizedTo.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface AuthorizationAuthorizationAuthorizedTo { /** Array of Sites this app is authorized to */ diff --git a/src/api/types/AuthorizedUser.ts b/src/api/types/AuthorizedUser.ts index c62b63d5..eeb0e767 100644 --- a/src/api/types/AuthorizedUser.ts +++ b/src/api/types/AuthorizedUser.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface AuthorizedUser { /** The unique ID of the user */ diff --git a/src/api/types/BadRequestErrorBody.ts b/src/api/types/BadRequestErrorBody.ts index 4cf0862f..cd3dbab0 100644 --- a/src/api/types/BadRequestErrorBody.ts +++ b/src/api/types/BadRequestErrorBody.ts @@ -1,7 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export type BadRequestErrorBody = Webflow.InvalidDomain | undefined | Webflow.NoDomains | undefined; diff --git a/src/api/types/BulkCollectionItem.ts b/src/api/types/BulkCollectionItem.ts index 00f2bd6c..ecccc63e 100644 --- a/src/api/types/BulkCollectionItem.ts +++ b/src/api/types/BulkCollectionItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items diff --git a/src/api/types/BulkCollectionItemFieldData.ts b/src/api/types/BulkCollectionItemFieldData.ts index 9c7a049b..f0ff85cd 100644 --- a/src/api/types/BulkCollectionItemFieldData.ts +++ b/src/api/types/BulkCollectionItemFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface BulkCollectionItemFieldData { /** Name of the Item */ diff --git a/src/api/types/Collection.ts b/src/api/types/Collection.ts index 5214eec9..28f37449 100644 --- a/src/api/types/Collection.ts +++ b/src/api/types/Collection.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A collection object diff --git a/src/api/types/CollectionItem.ts b/src/api/types/CollectionItem.ts index 2783d84b..5d17d886 100644 --- a/src/api/types/CollectionItem.ts +++ b/src/api/types/CollectionItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A Collection Item represents a single entry in your collection. Each item includes: diff --git a/src/api/types/CollectionItemChanged.ts b/src/api/types/CollectionItemChanged.ts index 1b301c10..e42c8f92 100644 --- a/src/api/types/CollectionItemChanged.ts +++ b/src/api/types/CollectionItemChanged.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a Collection Item is changed diff --git a/src/api/types/CollectionItemCreated.ts b/src/api/types/CollectionItemCreated.ts index 63474fa4..d7cd331c 100644 --- a/src/api/types/CollectionItemCreated.ts +++ b/src/api/types/CollectionItemCreated.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a Collection Item is created diff --git a/src/api/types/CollectionItemFieldData.ts b/src/api/types/CollectionItemFieldData.ts index 818da81f..d17e1e88 100644 --- a/src/api/types/CollectionItemFieldData.ts +++ b/src/api/types/CollectionItemFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CollectionItemFieldData { /** Name of the Item */ diff --git a/src/api/types/CollectionItemList.ts b/src/api/types/CollectionItemList.ts index 357eb694..dce2ee85 100644 --- a/src/api/types/CollectionItemList.ts +++ b/src/api/types/CollectionItemList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Results from collection items list diff --git a/src/api/types/CollectionItemListNoPagination.ts b/src/api/types/CollectionItemListNoPagination.ts index 64e063ac..2e72cf38 100644 --- a/src/api/types/CollectionItemListNoPagination.ts +++ b/src/api/types/CollectionItemListNoPagination.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Results from collection items list diff --git a/src/api/types/CollectionItemListPagination.ts b/src/api/types/CollectionItemListPagination.ts index f3631d75..a5c27e8c 100644 --- a/src/api/types/CollectionItemListPagination.ts +++ b/src/api/types/CollectionItemListPagination.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CollectionItemListPagination { /** The limit specified in the request */ diff --git a/src/api/types/CollectionItemPatchSingle.ts b/src/api/types/CollectionItemPatchSingle.ts index 2b750e65..72fa3fdb 100644 --- a/src/api/types/CollectionItemPatchSingle.ts +++ b/src/api/types/CollectionItemPatchSingle.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items diff --git a/src/api/types/CollectionItemPatchSingleFieldData.ts b/src/api/types/CollectionItemPatchSingleFieldData.ts index d2436c68..6a71a6a1 100644 --- a/src/api/types/CollectionItemPatchSingleFieldData.ts +++ b/src/api/types/CollectionItemPatchSingleFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CollectionItemPatchSingleFieldData { /** Name of the Item */ diff --git a/src/api/types/CollectionItemPostSingle.ts b/src/api/types/CollectionItemPostSingle.ts index 98b0bd28..19ca4778 100644 --- a/src/api/types/CollectionItemPostSingle.ts +++ b/src/api/types/CollectionItemPostSingle.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A Collection Item represents a single entry in your collection. Each item includes: diff --git a/src/api/types/CollectionItemPostSingleFieldData.ts b/src/api/types/CollectionItemPostSingleFieldData.ts index 82d4a3a7..ecf0bc80 100644 --- a/src/api/types/CollectionItemPostSingleFieldData.ts +++ b/src/api/types/CollectionItemPostSingleFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CollectionItemPostSingleFieldData { /** Name of the Item */ diff --git a/src/api/types/CollectionItemPublished.ts b/src/api/types/CollectionItemPublished.ts index ac069407..8740c7bf 100644 --- a/src/api/types/CollectionItemPublished.ts +++ b/src/api/types/CollectionItemPublished.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface CollectionItemPublished { /** The type of event that triggered the request */ diff --git a/src/api/types/CollectionItemRemoved.ts b/src/api/types/CollectionItemRemoved.ts index b9c5f1e3..1301f846 100644 --- a/src/api/types/CollectionItemRemoved.ts +++ b/src/api/types/CollectionItemRemoved.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface CollectionItemRemoved { /** The type of event that triggered the request */ diff --git a/src/api/types/CollectionItemRemovedPayload.ts b/src/api/types/CollectionItemRemovedPayload.ts index 6a16174a..a3b5b81a 100644 --- a/src/api/types/CollectionItemRemovedPayload.ts +++ b/src/api/types/CollectionItemRemovedPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The payload of data sent from Webflow diff --git a/src/api/types/CollectionItemRemovedPayloadFieldData.ts b/src/api/types/CollectionItemRemovedPayloadFieldData.ts index 925241e6..43ab5807 100644 --- a/src/api/types/CollectionItemRemovedPayloadFieldData.ts +++ b/src/api/types/CollectionItemRemovedPayloadFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CollectionItemRemovedPayloadFieldData { name: string; diff --git a/src/api/types/CollectionItemUnpublished.ts b/src/api/types/CollectionItemUnpublished.ts index f5f73a31..d6db37e6 100644 --- a/src/api/types/CollectionItemUnpublished.ts +++ b/src/api/types/CollectionItemUnpublished.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface CollectionItemUnpublished { /** The type of event that triggered the request */ diff --git a/src/api/types/CollectionItemUnpublishedPayload.ts b/src/api/types/CollectionItemUnpublishedPayload.ts index 41fe6cbb..33d2cf41 100644 --- a/src/api/types/CollectionItemUnpublishedPayload.ts +++ b/src/api/types/CollectionItemUnpublishedPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The payload of data sent from Webflow diff --git a/src/api/types/CollectionItemUnpublishedPayloadFieldData.ts b/src/api/types/CollectionItemUnpublishedPayloadFieldData.ts index 9700c773..e5534d3f 100644 --- a/src/api/types/CollectionItemUnpublishedPayloadFieldData.ts +++ b/src/api/types/CollectionItemUnpublishedPayloadFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CollectionItemUnpublishedPayloadFieldData { name: string; diff --git a/src/api/types/CollectionItemWithIdInput.ts b/src/api/types/CollectionItemWithIdInput.ts index 0320115e..55399e5c 100644 --- a/src/api/types/CollectionItemWithIdInput.ts +++ b/src/api/types/CollectionItemWithIdInput.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items diff --git a/src/api/types/CollectionItemWithIdInputFieldData.ts b/src/api/types/CollectionItemWithIdInputFieldData.ts index 1b528c07..1ccfddab 100644 --- a/src/api/types/CollectionItemWithIdInputFieldData.ts +++ b/src/api/types/CollectionItemWithIdInputFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CollectionItemWithIdInputFieldData { /** Name of the Item */ diff --git a/src/api/types/CollectionList.ts b/src/api/types/CollectionList.ts index 74b6338c..17d56f25 100644 --- a/src/api/types/CollectionList.ts +++ b/src/api/types/CollectionList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface CollectionList { /** An array of Collections */ diff --git a/src/api/types/CollectionListArrayItem.ts b/src/api/types/CollectionListArrayItem.ts index 2c3ae253..a58fdfb8 100644 --- a/src/api/types/CollectionListArrayItem.ts +++ b/src/api/types/CollectionListArrayItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A collection object diff --git a/src/api/types/Comment.ts b/src/api/types/Comment.ts index 8e0c3ce8..68e92b4f 100644 --- a/src/api/types/Comment.ts +++ b/src/api/types/Comment.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a comment thread or reply is made on a Site diff --git a/src/api/types/CommentPayload.ts b/src/api/types/CommentPayload.ts index 6f560aac..09946ef0 100644 --- a/src/api/types/CommentPayload.ts +++ b/src/api/types/CommentPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The comment webhook payload contains data for the thread and for replies. Check the type to determine if the payload is for a thread or a reply. The webhook payload may be delayed by up to 5 minutes. diff --git a/src/api/types/CommentPayloadAuthor.ts b/src/api/types/CommentPayloadAuthor.ts index 576e25f6..c0ede7cf 100644 --- a/src/api/types/CommentPayloadAuthor.ts +++ b/src/api/types/CommentPayloadAuthor.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CommentPayloadAuthor { /** The unique identifier of the author */ diff --git a/src/api/types/CommentPayloadMentionedUsersItem.ts b/src/api/types/CommentPayloadMentionedUsersItem.ts index b805e191..9fc9accd 100644 --- a/src/api/types/CommentPayloadMentionedUsersItem.ts +++ b/src/api/types/CommentPayloadMentionedUsersItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CommentPayloadMentionedUsersItem { /** The unique identifier of the mentioned user */ diff --git a/src/api/types/CommentReply.ts b/src/api/types/CommentReply.ts index 8ace76a5..c3b28fef 100644 --- a/src/api/types/CommentReply.ts +++ b/src/api/types/CommentReply.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A comment thread represents a conversation between users on a specific page. Each comment thread has a unique identifier and can contain multiple comments. diff --git a/src/api/types/CommentReplyAuthor.ts b/src/api/types/CommentReplyAuthor.ts index a2e04427..ad49f050 100644 --- a/src/api/types/CommentReplyAuthor.ts +++ b/src/api/types/CommentReplyAuthor.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CommentReplyAuthor { /** The unique identifier of the author */ diff --git a/src/api/types/CommentReplyList.ts b/src/api/types/CommentReplyList.ts index 16884f3c..3ae840c3 100644 --- a/src/api/types/CommentReplyList.ts +++ b/src/api/types/CommentReplyList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A list of comment replies. diff --git a/src/api/types/CommentReplyListPagination.ts b/src/api/types/CommentReplyListPagination.ts index e96f3972..524577d6 100644 --- a/src/api/types/CommentReplyListPagination.ts +++ b/src/api/types/CommentReplyListPagination.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CommentReplyListPagination { /** The limit specified in the request (default 100) */ diff --git a/src/api/types/CommentReplyMentionedUsersItem.ts b/src/api/types/CommentReplyMentionedUsersItem.ts index 3d1a27ba..16fb6389 100644 --- a/src/api/types/CommentReplyMentionedUsersItem.ts +++ b/src/api/types/CommentReplyMentionedUsersItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CommentReplyMentionedUsersItem { /** The unique identifier of the mentioned user */ diff --git a/src/api/types/CommentThread.ts b/src/api/types/CommentThread.ts index c8e3e685..80c8d997 100644 --- a/src/api/types/CommentThread.ts +++ b/src/api/types/CommentThread.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A comment thread represents a conversation between users on a specific page. Each comment thread has a unique identifier and can contain multiple comments. Retrieve comment replies using the replies API endpoint. diff --git a/src/api/types/CommentThreadAuthor.ts b/src/api/types/CommentThreadAuthor.ts index 3dd3cdb4..839622ff 100644 --- a/src/api/types/CommentThreadAuthor.ts +++ b/src/api/types/CommentThreadAuthor.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CommentThreadAuthor { /** The unique identifier of the author */ diff --git a/src/api/types/CommentThreadList.ts b/src/api/types/CommentThreadList.ts index dd90cfcc..de157d3b 100644 --- a/src/api/types/CommentThreadList.ts +++ b/src/api/types/CommentThreadList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A list of comment threads on the site. Contains the content of the first reply. diff --git a/src/api/types/CommentThreadListPagination.ts b/src/api/types/CommentThreadListPagination.ts index 6399f3e5..7f2863bd 100644 --- a/src/api/types/CommentThreadListPagination.ts +++ b/src/api/types/CommentThreadListPagination.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CommentThreadListPagination { /** The limit specified in the request (default 100) */ diff --git a/src/api/types/CommentThreadMentionedUsersItem.ts b/src/api/types/CommentThreadMentionedUsersItem.ts index 851363c9..43ace1e1 100644 --- a/src/api/types/CommentThreadMentionedUsersItem.ts +++ b/src/api/types/CommentThreadMentionedUsersItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CommentThreadMentionedUsersItem { /** The unique identifier of the mentioned user */ diff --git a/src/api/types/Component.ts b/src/api/types/Component.ts index f90eff53..32365fb8 100644 --- a/src/api/types/Component.ts +++ b/src/api/types/Component.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The Component object diff --git a/src/api/types/ComponentDom.ts b/src/api/types/ComponentDom.ts index 3f0b29af..4d5d4e87 100644 --- a/src/api/types/ComponentDom.ts +++ b/src/api/types/ComponentDom.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Component DOM schema represents the content structure of a component. Similar to Page DOM, it captures various content nodes and their associated attributes, but specifically for a component's structure. Each node has a unique identifier and can contain text, images, select or text inputs, submit buttons, or nested component instances. diff --git a/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts b/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts index 2fe7cd3b..8320b4bd 100644 --- a/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts +++ b/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Update text property overrides of a component instance diff --git a/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts b/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts index a69d7028..43c9f523 100644 --- a/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts +++ b/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem { /** The ID of the property. */ diff --git a/src/api/types/ComponentList.ts b/src/api/types/ComponentList.ts index 8af4f455..f55e17ca 100644 --- a/src/api/types/ComponentList.ts +++ b/src/api/types/ComponentList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * List of Components on a site. diff --git a/src/api/types/ComponentNode.ts b/src/api/types/ComponentNode.ts index 6b1d4a62..6fb02cdb 100644 --- a/src/api/types/ComponentNode.ts +++ b/src/api/types/ComponentNode.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Represents a component instance within the DOM. It contains details about the component instance, such as its type and properties. diff --git a/src/api/types/ComponentProperties.ts b/src/api/types/ComponentProperties.ts index e2e33ecb..1c495453 100644 --- a/src/api/types/ComponentProperties.ts +++ b/src/api/types/ComponentProperties.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Component Properties schema represents a list of properties that store text content. Each property has a unique identifier and can be of different types like plain text or rich text. The schema also provides pagination details for scenarios where there more properties than the limit. diff --git a/src/api/types/ComponentProperty.ts b/src/api/types/ComponentProperty.ts index fffc0323..c0a4c7a5 100644 --- a/src/api/types/ComponentProperty.ts +++ b/src/api/types/ComponentProperty.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Represents a property of a component instance in the DOM. A property contains a list of both the raw text and the HTML representation, allowing for flexibility in rendering and processing. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/ComponentPropertyType.ts b/src/api/types/ComponentPropertyType.ts index a92aae91..5f2d3413 100644 --- a/src/api/types/ComponentPropertyType.ts +++ b/src/api/types/ComponentPropertyType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of the property. - */ -export type ComponentPropertyType = "Plain Text" | "Rich Text" | "Alt Text"; +/** The type of the property. */ export const ComponentPropertyType = { PlainText: "Plain Text", RichText: "Rich Text", AltText: "Alt Text", } as const; +export type ComponentPropertyType = (typeof ComponentPropertyType)[keyof typeof ComponentPropertyType]; diff --git a/src/api/types/Conflict.ts b/src/api/types/Conflict.ts index 46a53a5f..1fe066c3 100644 --- a/src/api/types/Conflict.ts +++ b/src/api/types/Conflict.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type Conflict = unknown; diff --git a/src/api/types/ConflictErrorBody.ts b/src/api/types/ConflictErrorBody.ts index 81bcd8d1..7928e326 100644 --- a/src/api/types/ConflictErrorBody.ts +++ b/src/api/types/ConflictErrorBody.ts @@ -1,7 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export type ConflictErrorBody = Webflow.DuplicateUserEmail | undefined | Webflow.UserLimitReached | undefined; diff --git a/src/api/types/CustomCodeBlock.ts b/src/api/types/CustomCodeBlock.ts index 41acef4b..5c7d1d6f 100644 --- a/src/api/types/CustomCodeBlock.ts +++ b/src/api/types/CustomCodeBlock.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A specific instance of Custom Code applied to a Site or Page diff --git a/src/api/types/CustomCodeBlockType.ts b/src/api/types/CustomCodeBlockType.ts index d4d2fb23..d72d4f65 100644 --- a/src/api/types/CustomCodeBlockType.ts +++ b/src/api/types/CustomCodeBlockType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Whether the Custom Code script is applied at the Site-level or Page-level - */ -export type CustomCodeBlockType = "page" | "site"; +/** Whether the Custom Code script is applied at the Site-level or Page-level */ export const CustomCodeBlockType = { Page: "page", Site: "site", } as const; +export type CustomCodeBlockType = (typeof CustomCodeBlockType)[keyof typeof CustomCodeBlockType]; diff --git a/src/api/types/CustomCodeHostedResponse.ts b/src/api/types/CustomCodeHostedResponse.ts index 8a8b1d08..a4d8286a 100644 --- a/src/api/types/CustomCodeHostedResponse.ts +++ b/src/api/types/CustomCodeHostedResponse.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Registered custom code for application diff --git a/src/api/types/CustomCodeInlineResponse.ts b/src/api/types/CustomCodeInlineResponse.ts index feb74a4b..cd8f2219 100644 --- a/src/api/types/CustomCodeInlineResponse.ts +++ b/src/api/types/CustomCodeInlineResponse.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Registered custom code for application diff --git a/src/api/types/CustomRole.ts b/src/api/types/CustomRole.ts index 2e4c1762..0f0c0033 100644 --- a/src/api/types/CustomRole.ts +++ b/src/api/types/CustomRole.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CustomRole { /** The name of the custom role */ diff --git a/src/api/types/CustomRoleAuditLogItem.ts b/src/api/types/CustomRoleAuditLogItem.ts index ec3dced4..d7d78567 100644 --- a/src/api/types/CustomRoleAuditLogItem.ts +++ b/src/api/types/CustomRoleAuditLogItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface CustomRoleAuditLogItem { eventSubType?: Webflow.CustomRoleAuditLogItemEventSubType; diff --git a/src/api/types/CustomRoleAuditLogItemEventSubType.ts b/src/api/types/CustomRoleAuditLogItemEventSubType.ts index bccd7734..840bf169 100644 --- a/src/api/types/CustomRoleAuditLogItemEventSubType.ts +++ b/src/api/types/CustomRoleAuditLogItemEventSubType.ts @@ -1,10 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CustomRoleAuditLogItemEventSubType = "role_created" | "role_updated" | "role_deleted"; export const CustomRoleAuditLogItemEventSubType = { RoleCreated: "role_created", RoleUpdated: "role_updated", RoleDeleted: "role_deleted", } as const; +export type CustomRoleAuditLogItemEventSubType = + (typeof CustomRoleAuditLogItemEventSubType)[keyof typeof CustomRoleAuditLogItemEventSubType]; diff --git a/src/api/types/Dom.ts b/src/api/types/Dom.ts index 5a387c24..6e04034d 100644 --- a/src/api/types/Dom.ts +++ b/src/api/types/Dom.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The DOM (Document Object Model) schema represents the content structure of a web page or component. It captures various content nodes along with their associated attributes. Each node has a unique identifier and can be of different types like text, image or component-instance. The schema also provides pagination details for scenarios where the content nodes are too many to be fetched in a single request. diff --git a/src/api/types/Domain.ts b/src/api/types/Domain.ts index 04e9bb96..b328ad4a 100644 --- a/src/api/types/Domain.ts +++ b/src/api/types/Domain.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface Domain { /** Unique identifier for the Domain */ diff --git a/src/api/types/Domains.ts b/src/api/types/Domains.ts index 1e156571..7eb2e5c4 100644 --- a/src/api/types/Domains.ts +++ b/src/api/types/Domains.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface Domains { customDomains?: Webflow.Domain[]; diff --git a/src/api/types/DuplicateUserEmail.ts b/src/api/types/DuplicateUserEmail.ts index 79b2a95b..f4b5367d 100644 --- a/src/api/types/DuplicateUserEmail.ts +++ b/src/api/types/DuplicateUserEmail.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type DuplicateUserEmail = unknown; diff --git a/src/api/types/EcommerceSettings.ts b/src/api/types/EcommerceSettings.ts index fa755860..9c037bd8 100644 --- a/src/api/types/EcommerceSettings.ts +++ b/src/api/types/EcommerceSettings.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Ecommerce settings for a Webflow Site diff --git a/src/api/types/ErrorCode.ts b/src/api/types/ErrorCode.ts index 942424c7..d0e73bcd 100644 --- a/src/api/types/ErrorCode.ts +++ b/src/api/types/ErrorCode.ts @@ -1,40 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Error code - */ -export type ErrorCode = - | "bad_request" - | "collection_not_found" - | "conflict" - | "duplicate_collection" - | "duplicate_user_email" - | "ecommerce_not_enabled" - | "forbidden" - | "forms_require_republish" - | "incompatible_webhook_filter" - | "internal_error" - | "invalid_auth_version" - | "invalid_credentials" - | "invalid_domain" - | "invalid_user_email" - | "item_not_found" - | "missing_scopes" - | "no_domains" - | "not_authorized" - | "not_enterprise_plan_site" - | "not_enterprise_plan_workspace" - | "order_not_found" - | "resource_not_found" - | "too_many_requests" - | "unsupported_version" - | "unsupported_webhook_trigger_type" - | "user_limit_reached" - | "user_not_found" - | "users_not_enabled" - | "validation_error"; +/** Error code */ export const ErrorCode = { BadRequest: "bad_request", CollectionNotFound: "collection_not_found", @@ -66,3 +32,4 @@ export const ErrorCode = { UsersNotEnabled: "users_not_enabled", ValidationError: "validation_error", } as const; +export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode]; diff --git a/src/api/types/Error_.ts b/src/api/types/Error_.ts index 6295f0e4..48014d1a 100644 --- a/src/api/types/Error_.ts +++ b/src/api/types/Error_.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface Error_ { /** Error code */ diff --git a/src/api/types/Field.ts b/src/api/types/Field.ts index 44300446..4506ee2e 100644 --- a/src/api/types/Field.ts +++ b/src/api/types/Field.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The details of a field in a collection diff --git a/src/api/types/FieldCreate.ts b/src/api/types/FieldCreate.ts index 85a3c879..f363297a 100644 --- a/src/api/types/FieldCreate.ts +++ b/src/api/types/FieldCreate.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Details about the field of a collection diff --git a/src/api/types/FieldType.ts b/src/api/types/FieldType.ts index 5f225005..1d0ed650 100644 --- a/src/api/types/FieldType.ts +++ b/src/api/types/FieldType.ts @@ -1,28 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Choose these appropriate field type for your collection data - */ -export type FieldType = - | "Color" - | "DateTime" - | "Email" - | "ExtFileRef" - | "File" - | "Image" - | "Link" - | "MultiImage" - | "MultiReference" - | "Number" - | "Option" - | "Phone" - | "PlainText" - | "Reference" - | "RichText" - | "Switch" - | "VideoLink"; +/** Choose these appropriate field type for your collection data */ export const FieldType = { Color: "Color", DateTime: "DateTime", @@ -42,3 +20,4 @@ export const FieldType = { Switch: "Switch", VideoLink: "VideoLink", } as const; +export type FieldType = (typeof FieldType)[keyof typeof FieldType]; diff --git a/src/api/types/FieldValidations.ts b/src/api/types/FieldValidations.ts index aefb1cc4..6963118f 100644 --- a/src/api/types/FieldValidations.ts +++ b/src/api/types/FieldValidations.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The validations for the field diff --git a/src/api/types/FieldValidationsAdditionalProperties.ts b/src/api/types/FieldValidationsAdditionalProperties.ts index b629d590..0178fad1 100644 --- a/src/api/types/FieldValidationsAdditionalProperties.ts +++ b/src/api/types/FieldValidationsAdditionalProperties.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export type FieldValidationsAdditionalProperties = | string diff --git a/src/api/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts b/src/api/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts index f541be1e..3232ec5a 100644 --- a/src/api/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts +++ b/src/api/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface FieldValidationsAdditionalPropertiesAdditionalProperties { additionalProperties?: unknown; diff --git a/src/api/types/ForbiddenErrorBody.ts b/src/api/types/ForbiddenErrorBody.ts index 73b8f3f9..21337061 100644 --- a/src/api/types/ForbiddenErrorBody.ts +++ b/src/api/types/ForbiddenErrorBody.ts @@ -1,7 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export type ForbiddenErrorBody = Webflow.InvalidScopes | undefined | Webflow.UsersNotEnabled | undefined; diff --git a/src/api/types/Form.ts b/src/api/types/Form.ts index ec91d181..71a5fd64 100644 --- a/src/api/types/Form.ts +++ b/src/api/types/Form.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A Webflow form diff --git a/src/api/types/FormField.ts b/src/api/types/FormField.ts index 63d089ed..5fa59686 100644 --- a/src/api/types/FormField.ts +++ b/src/api/types/FormField.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A collection of form fields with additional properties. diff --git a/src/api/types/FormFieldValue.ts b/src/api/types/FormFieldValue.ts index 96717dd7..a19f1040 100644 --- a/src/api/types/FormFieldValue.ts +++ b/src/api/types/FormFieldValue.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * An object containing field info for a specific fieldID. diff --git a/src/api/types/FormFieldValueType.ts b/src/api/types/FormFieldValueType.ts index cce8be0a..d7f201d2 100644 --- a/src/api/types/FormFieldValueType.ts +++ b/src/api/types/FormFieldValueType.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The field type - */ -export type FormFieldValueType = "Plain" | "Email" | "Password" | "Phone" | "Number"; +/** The field type */ export const FormFieldValueType = { Plain: "Plain", Email: "Email", @@ -13,3 +8,4 @@ export const FormFieldValueType = { Phone: "Phone", Number: "Number", } as const; +export type FormFieldValueType = (typeof FormFieldValueType)[keyof typeof FormFieldValueType]; diff --git a/src/api/types/FormList.ts b/src/api/types/FormList.ts index cd9736be..2d490285 100644 --- a/src/api/types/FormList.ts +++ b/src/api/types/FormList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface FormList { forms?: Webflow.Form[]; diff --git a/src/api/types/FormResponseSettings.ts b/src/api/types/FormResponseSettings.ts index 0ad96213..97b863a4 100644 --- a/src/api/types/FormResponseSettings.ts +++ b/src/api/types/FormResponseSettings.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Settings for form responses diff --git a/src/api/types/FormSubmission.ts b/src/api/types/FormSubmission.ts index a156b7d6..aef4b732 100644 --- a/src/api/types/FormSubmission.ts +++ b/src/api/types/FormSubmission.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface FormSubmission { /** The unique ID of the Form submission */ diff --git a/src/api/types/FormSubmissionList.ts b/src/api/types/FormSubmissionList.ts index 0b55b4fb..4cf5fb3e 100644 --- a/src/api/types/FormSubmissionList.ts +++ b/src/api/types/FormSubmissionList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface FormSubmissionList { formSubmissions?: Webflow.FormSubmission[]; diff --git a/src/api/types/FormSubmissionTrigger.ts b/src/api/types/FormSubmissionTrigger.ts index 3141648b..09db1cea 100644 --- a/src/api/types/FormSubmissionTrigger.ts +++ b/src/api/types/FormSubmissionTrigger.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a form is submitted diff --git a/src/api/types/FormSubmissionTriggerPayload.ts b/src/api/types/FormSubmissionTriggerPayload.ts index b8506bc1..dfa4b2a9 100644 --- a/src/api/types/FormSubmissionTriggerPayload.ts +++ b/src/api/types/FormSubmissionTriggerPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The payload of data sent from Webflow diff --git a/src/api/types/FormSubmissionTriggerPayloadSchemaItem.ts b/src/api/types/FormSubmissionTriggerPayloadSchemaItem.ts index 15de25e8..79cfac91 100644 --- a/src/api/types/FormSubmissionTriggerPayloadSchemaItem.ts +++ b/src/api/types/FormSubmissionTriggerPayloadSchemaItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface FormSubmissionTriggerPayloadSchemaItem { /** Form field name */ diff --git a/src/api/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts b/src/api/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts index a691913b..aed60d88 100644 --- a/src/api/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts +++ b/src/api/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts @@ -1,16 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Form field type - */ -export type FormSubmissionTriggerPayloadSchemaItemFieldType = - | "FormTextInput" - | "FormTextarea" - | "FormCheckboxInput" - | "FormRadioInput" - | "FormFileUploadInput"; +/** Form field type */ export const FormSubmissionTriggerPayloadSchemaItemFieldType = { FormTextInput: "FormTextInput", FormTextarea: "FormTextarea", @@ -18,3 +8,5 @@ export const FormSubmissionTriggerPayloadSchemaItemFieldType = { FormRadioInput: "FormRadioInput", FormFileUploadInput: "FormFileUploadInput", } as const; +export type FormSubmissionTriggerPayloadSchemaItemFieldType = + (typeof FormSubmissionTriggerPayloadSchemaItemFieldType)[keyof typeof FormSubmissionTriggerPayloadSchemaItemFieldType]; diff --git a/src/api/types/ImageNode.ts b/src/api/types/ImageNode.ts index 8134be46..f09028fe 100644 --- a/src/api/types/ImageNode.ts +++ b/src/api/types/ImageNode.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Represents an image within the DOM. It contains details about the image, such as its alternative text (alt) for accessibility and an asset identifier for fetching the actual image resource. Additional attributes can be associated with the image for styling or other purposes. diff --git a/src/api/types/ImageNodeImage.ts b/src/api/types/ImageNodeImage.ts index 571de582..70360de6 100644 --- a/src/api/types/ImageNodeImage.ts +++ b/src/api/types/ImageNodeImage.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The image details of the node diff --git a/src/api/types/InvalidDomain.ts b/src/api/types/InvalidDomain.ts index 4da2028b..9e636d31 100644 --- a/src/api/types/InvalidDomain.ts +++ b/src/api/types/InvalidDomain.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type InvalidDomain = unknown; diff --git a/src/api/types/InvalidScopes.ts b/src/api/types/InvalidScopes.ts index b389c2bb..f26c69e7 100644 --- a/src/api/types/InvalidScopes.ts +++ b/src/api/types/InvalidScopes.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type InvalidScopes = unknown; diff --git a/src/api/types/InventoryItem.ts b/src/api/types/InventoryItem.ts index 93cd7c00..9e372b7c 100644 --- a/src/api/types/InventoryItem.ts +++ b/src/api/types/InventoryItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The availabile inventory for an item diff --git a/src/api/types/InventoryItemInventoryType.ts b/src/api/types/InventoryItemInventoryType.ts index 86d6b087..b2c7a258 100644 --- a/src/api/types/InventoryItemInventoryType.ts +++ b/src/api/types/InventoryItemInventoryType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * infinite or finite - */ -export type InventoryItemInventoryType = "infinite" | "finite"; +/** infinite or finite */ export const InventoryItemInventoryType = { Infinite: "infinite", Finite: "finite", } as const; +export type InventoryItemInventoryType = (typeof InventoryItemInventoryType)[keyof typeof InventoryItemInventoryType]; diff --git a/src/api/types/ItemsListItemsLiveRequestLastPublished.ts b/src/api/types/ItemsListItemsLiveRequestLastPublished.ts index 0ff0e748..4211b175 100644 --- a/src/api/types/ItemsListItemsLiveRequestLastPublished.ts +++ b/src/api/types/ItemsListItemsLiveRequestLastPublished.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ItemsListItemsLiveRequestLastPublished { /** Filter items last published before this date */ diff --git a/src/api/types/ItemsListItemsRequestLastPublished.ts b/src/api/types/ItemsListItemsRequestLastPublished.ts index ab2e4ed4..7b31ac1a 100644 --- a/src/api/types/ItemsListItemsRequestLastPublished.ts +++ b/src/api/types/ItemsListItemsRequestLastPublished.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ItemsListItemsRequestLastPublished { /** Filter items last published before this date */ diff --git a/src/api/types/ListCustomCodeBlocks.ts b/src/api/types/ListCustomCodeBlocks.ts index 6518202a..a16cdb2f 100644 --- a/src/api/types/ListCustomCodeBlocks.ts +++ b/src/api/types/ListCustomCodeBlocks.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Custom Code Blocks corresponding to where scripts were applied diff --git a/src/api/types/Locale.ts b/src/api/types/Locale.ts index 38974659..0bade2d9 100644 --- a/src/api/types/Locale.ts +++ b/src/api/types/Locale.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface Locale { /** The unique identifier for the locale. */ diff --git a/src/api/types/Locales.ts b/src/api/types/Locales.ts index f8dc0241..dd995f6a 100644 --- a/src/api/types/Locales.ts +++ b/src/api/types/Locales.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface Locales { /** The primary locale for the site or application. */ diff --git a/src/api/types/Metadata.ts b/src/api/types/Metadata.ts index d0931da4..81fe1e3e 100644 --- a/src/api/types/Metadata.ts +++ b/src/api/types/Metadata.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The metadata for the Option field. diff --git a/src/api/types/MetadataOptionsItem.ts b/src/api/types/MetadataOptionsItem.ts index b06b88a4..43ab8d85 100644 --- a/src/api/types/MetadataOptionsItem.ts +++ b/src/api/types/MetadataOptionsItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A single option value for the Option field. diff --git a/src/api/types/NewOrder.ts b/src/api/types/NewOrder.ts index 70d8da57..1755e3ce 100644 --- a/src/api/types/NewOrder.ts +++ b/src/api/types/NewOrder.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a new order is created diff --git a/src/api/types/NoDomains.ts b/src/api/types/NoDomains.ts index d00b6e30..ef51694c 100644 --- a/src/api/types/NoDomains.ts +++ b/src/api/types/NoDomains.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type NoDomains = unknown; diff --git a/src/api/types/Node.ts b/src/api/types/Node.ts index 3aee1b92..e231935f 100644 --- a/src/api/types/Node.ts +++ b/src/api/types/Node.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A generic representation of a content element within the Document Object Model (DOM). Each node has a unique identifier and a specific type that determines its content structure and attributes. diff --git a/src/api/types/NotEnterprisePlanSite.ts b/src/api/types/NotEnterprisePlanSite.ts index 20fad119..1c46d244 100644 --- a/src/api/types/NotEnterprisePlanSite.ts +++ b/src/api/types/NotEnterprisePlanSite.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type NotEnterprisePlanSite = unknown; diff --git a/src/api/types/NotEnterprisePlanWorkspace.ts b/src/api/types/NotEnterprisePlanWorkspace.ts index fbd758af..efa63194 100644 --- a/src/api/types/NotEnterprisePlanWorkspace.ts +++ b/src/api/types/NotEnterprisePlanWorkspace.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type NotEnterprisePlanWorkspace = unknown; diff --git a/src/api/types/OptionField.ts b/src/api/types/OptionField.ts index 8bfafcdc..80e42477 100644 --- a/src/api/types/OptionField.ts +++ b/src/api/types/OptionField.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface OptionField { /** Unique identifier for a Field */ diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 808ff284..24b99dd6 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface Order { /** diff --git a/src/api/types/OrderAddress.ts b/src/api/types/OrderAddress.ts index 2f3d1072..5015c48b 100644 --- a/src/api/types/OrderAddress.ts +++ b/src/api/types/OrderAddress.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A customer address diff --git a/src/api/types/OrderAddressJapanType.ts b/src/api/types/OrderAddressJapanType.ts index 975e8fa6..bebad715 100644 --- a/src/api/types/OrderAddressJapanType.ts +++ b/src/api/types/OrderAddressJapanType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Represents a Japan-only address format. This field will only appear on orders placed from Japan. - */ -export type OrderAddressJapanType = "kana" | "kanji"; +/** Represents a Japan-only address format. This field will only appear on orders placed from Japan. */ export const OrderAddressJapanType = { Kana: "kana", Kanji: "kanji", } as const; +export type OrderAddressJapanType = (typeof OrderAddressJapanType)[keyof typeof OrderAddressJapanType]; diff --git a/src/api/types/OrderAddressType.ts b/src/api/types/OrderAddressType.ts index 0fab55da..95a879cd 100644 --- a/src/api/types/OrderAddressType.ts +++ b/src/api/types/OrderAddressType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of the order address (billing or shipping) - */ -export type OrderAddressType = "shipping" | "billing"; +/** The type of the order address (billing or shipping) */ export const OrderAddressType = { Shipping: "shipping", Billing: "billing", } as const; +export type OrderAddressType = (typeof OrderAddressType)[keyof typeof OrderAddressType]; diff --git a/src/api/types/OrderBillingAddress.ts b/src/api/types/OrderBillingAddress.ts index ac8667dc..01df1fce 100644 --- a/src/api/types/OrderBillingAddress.ts +++ b/src/api/types/OrderBillingAddress.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The billing address diff --git a/src/api/types/OrderBillingAddressJapanType.ts b/src/api/types/OrderBillingAddressJapanType.ts index a5f26409..a8819241 100644 --- a/src/api/types/OrderBillingAddressJapanType.ts +++ b/src/api/types/OrderBillingAddressJapanType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Represents a Japan-only address format. This field will only appear on orders placed from Japan. - */ -export type OrderBillingAddressJapanType = "kana" | "kanji"; +/** Represents a Japan-only address format. This field will only appear on orders placed from Japan. */ export const OrderBillingAddressJapanType = { Kana: "kana", Kanji: "kanji", } as const; +export type OrderBillingAddressJapanType = + (typeof OrderBillingAddressJapanType)[keyof typeof OrderBillingAddressJapanType]; diff --git a/src/api/types/OrderBillingAddressType.ts b/src/api/types/OrderBillingAddressType.ts index 1144bada..3f641db8 100644 --- a/src/api/types/OrderBillingAddressType.ts +++ b/src/api/types/OrderBillingAddressType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of the order address (billing or shipping) - */ -export type OrderBillingAddressType = "shipping" | "billing"; +/** The type of the order address (billing or shipping) */ export const OrderBillingAddressType = { Shipping: "shipping", Billing: "billing", } as const; +export type OrderBillingAddressType = (typeof OrderBillingAddressType)[keyof typeof OrderBillingAddressType]; diff --git a/src/api/types/OrderCustomerInfo.ts b/src/api/types/OrderCustomerInfo.ts index f774e405..a03c1ce2 100644 --- a/src/api/types/OrderCustomerInfo.ts +++ b/src/api/types/OrderCustomerInfo.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * An object with the keys `fullName` and `email`. diff --git a/src/api/types/OrderDisputeLastStatus.ts b/src/api/types/OrderDisputeLastStatus.ts index 660c0393..df838500 100644 --- a/src/api/types/OrderDisputeLastStatus.ts +++ b/src/api/types/OrderDisputeLastStatus.ts @@ -1,19 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * If an order was disputed by the customer, then this key will be set with the [dispute's status](https://stripe.com/docs/api#dispute_object-status). - */ -export type OrderDisputeLastStatus = - | "warning_needs_response" - | "warning_under_review" - | "warning_closed" - | "needs_response" - | "under_review" - | "charge_refunded" - | "won" - | "lost"; +/** If an order was disputed by the customer, then this key will be set with the [dispute's status](https://stripe.com/docs/api#dispute_object-status). */ export const OrderDisputeLastStatus = { WarningNeedsResponse: "warning_needs_response", WarningUnderReview: "warning_under_review", @@ -24,3 +11,4 @@ export const OrderDisputeLastStatus = { Won: "won", Lost: "lost", } as const; +export type OrderDisputeLastStatus = (typeof OrderDisputeLastStatus)[keyof typeof OrderDisputeLastStatus]; diff --git a/src/api/types/OrderDownloadFilesItem.ts b/src/api/types/OrderDownloadFilesItem.ts index 13774268..2b0792c8 100644 --- a/src/api/types/OrderDownloadFilesItem.ts +++ b/src/api/types/OrderDownloadFilesItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface OrderDownloadFilesItem { /** The unique identifier for the downloadable file */ diff --git a/src/api/types/OrderList.ts b/src/api/types/OrderList.ts index 25518c90..7723d868 100644 --- a/src/api/types/OrderList.ts +++ b/src/api/types/OrderList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Results from order list diff --git a/src/api/types/OrderMetadata.ts b/src/api/types/OrderMetadata.ts index 4e99ed3b..b2231b0e 100644 --- a/src/api/types/OrderMetadata.ts +++ b/src/api/types/OrderMetadata.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface OrderMetadata { isBuyNow?: boolean; diff --git a/src/api/types/OrderPrice.ts b/src/api/types/OrderPrice.ts index 287163d4..acc8bfd9 100644 --- a/src/api/types/OrderPrice.ts +++ b/src/api/types/OrderPrice.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface OrderPrice { /** The three-letter ISO currency code */ diff --git a/src/api/types/OrderPurchasedItem.ts b/src/api/types/OrderPurchasedItem.ts index a27367bc..20cc5f18 100644 --- a/src/api/types/OrderPurchasedItem.ts +++ b/src/api/types/OrderPurchasedItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * An Item that was purchased diff --git a/src/api/types/OrderPurchasedItemVariantImage.ts b/src/api/types/OrderPurchasedItemVariantImage.ts index 540c32b5..ce121f75 100644 --- a/src/api/types/OrderPurchasedItemVariantImage.ts +++ b/src/api/types/OrderPurchasedItemVariantImage.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface OrderPurchasedItemVariantImage { /** The hosted location for the Variant's image */ diff --git a/src/api/types/OrderPurchasedItemVariantImageFile.ts b/src/api/types/OrderPurchasedItemVariantImageFile.ts index f9ef3b8c..88c77d13 100644 --- a/src/api/types/OrderPurchasedItemVariantImageFile.ts +++ b/src/api/types/OrderPurchasedItemVariantImageFile.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface OrderPurchasedItemVariantImageFile { /** The image size in bytes */ diff --git a/src/api/types/OrderPurchasedItemVariantImageFileVariantsItem.ts b/src/api/types/OrderPurchasedItemVariantImageFileVariantsItem.ts index 0c288fe3..f9f80e1b 100644 --- a/src/api/types/OrderPurchasedItemVariantImageFileVariantsItem.ts +++ b/src/api/types/OrderPurchasedItemVariantImageFileVariantsItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface OrderPurchasedItemVariantImageFileVariantsItem { /** The hosted location for the Variant's image */ diff --git a/src/api/types/OrderShippingAddress.ts b/src/api/types/OrderShippingAddress.ts index edb1937f..581f7c88 100644 --- a/src/api/types/OrderShippingAddress.ts +++ b/src/api/types/OrderShippingAddress.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The shipping address diff --git a/src/api/types/OrderShippingAddressJapanType.ts b/src/api/types/OrderShippingAddressJapanType.ts index 0e820bd2..b91d073d 100644 --- a/src/api/types/OrderShippingAddressJapanType.ts +++ b/src/api/types/OrderShippingAddressJapanType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Represents a Japan-only address format. This field will only appear on orders placed from Japan. - */ -export type OrderShippingAddressJapanType = "kana" | "kanji"; +/** Represents a Japan-only address format. This field will only appear on orders placed from Japan. */ export const OrderShippingAddressJapanType = { Kana: "kana", Kanji: "kanji", } as const; +export type OrderShippingAddressJapanType = + (typeof OrderShippingAddressJapanType)[keyof typeof OrderShippingAddressJapanType]; diff --git a/src/api/types/OrderShippingAddressType.ts b/src/api/types/OrderShippingAddressType.ts index cff20adc..bf5bafa3 100644 --- a/src/api/types/OrderShippingAddressType.ts +++ b/src/api/types/OrderShippingAddressType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of the order address (billing or shipping) - */ -export type OrderShippingAddressType = "shipping" | "billing"; +/** The type of the order address (billing or shipping) */ export const OrderShippingAddressType = { Shipping: "shipping", Billing: "billing", } as const; +export type OrderShippingAddressType = (typeof OrderShippingAddressType)[keyof typeof OrderShippingAddressType]; diff --git a/src/api/types/OrderStatus.ts b/src/api/types/OrderStatus.ts index ef868e86..b1441005 100644 --- a/src/api/types/OrderStatus.ts +++ b/src/api/types/OrderStatus.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The status of the Order - */ -export type OrderStatus = "pending" | "unfulfilled" | "fulfilled" | "disputed" | "dispute-lost" | "refunded"; +/** The status of the Order */ export const OrderStatus = { Pending: "pending", Unfulfilled: "unfulfilled", @@ -14,3 +9,4 @@ export const OrderStatus = { DisputeLost: "dispute-lost", Refunded: "refunded", } as const; +export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus]; diff --git a/src/api/types/OrderTotals.ts b/src/api/types/OrderTotals.ts index 7502e638..0f66275e 100644 --- a/src/api/types/OrderTotals.ts +++ b/src/api/types/OrderTotals.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * An object describing various pricing totals diff --git a/src/api/types/OrderTotalsExtrasItem.ts b/src/api/types/OrderTotalsExtrasItem.ts index 03f059db..7226116c 100644 --- a/src/api/types/OrderTotalsExtrasItem.ts +++ b/src/api/types/OrderTotalsExtrasItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Extra order items, includes discounts, shipping, and taxes. diff --git a/src/api/types/OrderTotalsExtrasItemType.ts b/src/api/types/OrderTotalsExtrasItemType.ts index 5c88217c..486bd25d 100644 --- a/src/api/types/OrderTotalsExtrasItemType.ts +++ b/src/api/types/OrderTotalsExtrasItemType.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of extra item this is. - */ -export type OrderTotalsExtrasItemType = "discount" | "discount-shipping" | "shipping" | "tax"; +/** The type of extra item this is. */ export const OrderTotalsExtrasItemType = { Discount: "discount", DiscountShipping: "discount-shipping", Shipping: "shipping", Tax: "tax", } as const; +export type OrderTotalsExtrasItemType = (typeof OrderTotalsExtrasItemType)[keyof typeof OrderTotalsExtrasItemType]; diff --git a/src/api/types/Page.ts b/src/api/types/Page.ts index 8c51c4eb..308b97cb 100644 --- a/src/api/types/Page.ts +++ b/src/api/types/Page.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Page object diff --git a/src/api/types/PageCreatedWebhook.ts b/src/api/types/PageCreatedWebhook.ts index 76dc9e10..a2ddf988 100644 --- a/src/api/types/PageCreatedWebhook.ts +++ b/src/api/types/PageCreatedWebhook.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a Page is created diff --git a/src/api/types/PageCreatedWebhookPayload.ts b/src/api/types/PageCreatedWebhookPayload.ts index 60e88a79..2868ed48 100644 --- a/src/api/types/PageCreatedWebhookPayload.ts +++ b/src/api/types/PageCreatedWebhookPayload.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The payload of data sent from Webflow diff --git a/src/api/types/PageDeletedWebhook.ts b/src/api/types/PageDeletedWebhook.ts index 1c81b18d..641ef582 100644 --- a/src/api/types/PageDeletedWebhook.ts +++ b/src/api/types/PageDeletedWebhook.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a Page is deleted diff --git a/src/api/types/PageDeletedWebhookPayload.ts b/src/api/types/PageDeletedWebhookPayload.ts index d625ebcc..4af70418 100644 --- a/src/api/types/PageDeletedWebhookPayload.ts +++ b/src/api/types/PageDeletedWebhookPayload.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The payload of data sent from Webflow diff --git a/src/api/types/PageList.ts b/src/api/types/PageList.ts index 09f4f73f..bcd24e75 100644 --- a/src/api/types/PageList.ts +++ b/src/api/types/PageList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Page object diff --git a/src/api/types/PageMetadataUpdatedWebhook.ts b/src/api/types/PageMetadataUpdatedWebhook.ts index 05a3417e..dc2bbb84 100644 --- a/src/api/types/PageMetadataUpdatedWebhook.ts +++ b/src/api/types/PageMetadataUpdatedWebhook.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a Page's metadata is updated diff --git a/src/api/types/PageMetadataUpdatedWebhookPayload.ts b/src/api/types/PageMetadataUpdatedWebhookPayload.ts index 27a32b61..841cbb8e 100644 --- a/src/api/types/PageMetadataUpdatedWebhookPayload.ts +++ b/src/api/types/PageMetadataUpdatedWebhookPayload.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The payload of data sent from Webflow diff --git a/src/api/types/PageOpenGraph.ts b/src/api/types/PageOpenGraph.ts index f288a304..43619ecd 100644 --- a/src/api/types/PageOpenGraph.ts +++ b/src/api/types/PageOpenGraph.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Open Graph fields for the Page diff --git a/src/api/types/PageSeo.ts b/src/api/types/PageSeo.ts index 42e5879b..ee956820 100644 --- a/src/api/types/PageSeo.ts +++ b/src/api/types/PageSeo.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * SEO-related fields for the Page diff --git a/src/api/types/Pagination.ts b/src/api/types/Pagination.ts index 1ee7cd06..a5b2ef55 100644 --- a/src/api/types/Pagination.ts +++ b/src/api/types/Pagination.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Pagination object diff --git a/src/api/types/Payload.ts b/src/api/types/Payload.ts index 4690b4cc..8019c383 100644 --- a/src/api/types/Payload.ts +++ b/src/api/types/Payload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The payload of data sent from Webflow diff --git a/src/api/types/PayloadFieldData.ts b/src/api/types/PayloadFieldData.ts index 526ec184..a7918a21 100644 --- a/src/api/types/PayloadFieldData.ts +++ b/src/api/types/PayloadFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PayloadFieldData { name: string; diff --git a/src/api/types/PaypalDetails.ts b/src/api/types/PaypalDetails.ts index 522ef66a..61bd3793 100644 --- a/src/api/types/PaypalDetails.ts +++ b/src/api/types/PaypalDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaypalDetails { /** PayPal order identifier */ diff --git a/src/api/types/Product.ts b/src/api/types/Product.ts index cca3b59d..567c7f80 100644 --- a/src/api/types/Product.ts +++ b/src/api/types/Product.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Product object diff --git a/src/api/types/ProductAndSkUs.ts b/src/api/types/ProductAndSkUs.ts index e2ffc46d..8cd5345c 100644 --- a/src/api/types/ProductAndSkUs.ts +++ b/src/api/types/ProductAndSkUs.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A product and its SKUs. diff --git a/src/api/types/ProductAndSkUsList.ts b/src/api/types/ProductAndSkUsList.ts index adbb5aad..8dbe704a 100644 --- a/src/api/types/ProductAndSkUsList.ts +++ b/src/api/types/ProductAndSkUsList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Results from product list diff --git a/src/api/types/ProductFieldData.ts b/src/api/types/ProductFieldData.ts index c83f14bb..a9989fb0 100644 --- a/src/api/types/ProductFieldData.ts +++ b/src/api/types/ProductFieldData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Contains content-specific details for a product, covering both standard (e.g., title, description) and custom fields tailored to the product setup. diff --git a/src/api/types/ProductFieldDataEcProductType.ts b/src/api/types/ProductFieldDataEcProductType.ts index 399bd0d9..13bf05f0 100644 --- a/src/api/types/ProductFieldDataEcProductType.ts +++ b/src/api/types/ProductFieldDataEcProductType.ts @@ -1,18 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Product types. Enums reflect the following values in order: Physical, Digital, Service, Advanced" - */ -export type ProductFieldDataEcProductType = - | "ff42fee0113744f693a764e3431a9cc2" - | "f22027db68002190aef89a4a2b7ac8a1" - | "c599e43b1a1c34d5a323aedf75d3adf6" - | "b6ccc1830db4b1babeb06a9ac5f6dd76"; +/** Product types. Enums reflect the following values in order: Physical, Digital, Service, Advanced" */ export const ProductFieldDataEcProductType = { Ff42Fee0113744F693A764E3431A9Cc2: "ff42fee0113744f693a764e3431a9cc2", F22027Db68002190Aef89A4A2B7Ac8A1: "f22027db68002190aef89a4a2b7ac8a1", C599E43B1A1C34D5A323Aedf75D3Adf6: "c599e43b1a1c34d5a323aedf75d3adf6", B6Ccc1830Db4B1Babeb06A9Ac5F6Dd76: "b6ccc1830db4b1babeb06a9ac5f6dd76", } as const; +export type ProductFieldDataEcProductType = + (typeof ProductFieldDataEcProductType)[keyof typeof ProductFieldDataEcProductType]; diff --git a/src/api/types/ProductFieldDataTaxCategory.ts b/src/api/types/ProductFieldDataTaxCategory.ts index 8726f67d..aae7d8a0 100644 --- a/src/api/types/ProductFieldDataTaxCategory.ts +++ b/src/api/types/ProductFieldDataTaxCategory.ts @@ -1,40 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Product tax class - */ -export type ProductFieldDataTaxCategory = - | "standard-taxable" - | "standard-exempt" - | "books-religious" - | "books-textbook" - | "clothing" - | "clothing-swimwear" - | "digital-goods" - | "digital-service" - | "drugs-non-prescription" - | "drugs-prescription" - | "food-bottled-water" - | "food-candy" - | "food-groceries" - | "food-prepared" - | "food-soda" - | "food-supplements" - | "magazine-individual" - | "magazine-subscription" - | "service-admission" - | "service-advertising" - | "service-dry-cleaning" - | "service-hairdressing" - | "service-installation" - | "service-miscellaneous" - | "service-parking" - | "service-printing" - | "service-professional" - | "service-repair" - | "service-training"; +/** Product tax class */ export const ProductFieldDataTaxCategory = { StandardTaxable: "standard-taxable", StandardExempt: "standard-exempt", @@ -66,3 +32,5 @@ export const ProductFieldDataTaxCategory = { ServiceRepair: "service-repair", ServiceTraining: "service-training", } as const; +export type ProductFieldDataTaxCategory = + (typeof ProductFieldDataTaxCategory)[keyof typeof ProductFieldDataTaxCategory]; diff --git a/src/api/types/PublishStatus.ts b/src/api/types/PublishStatus.ts index bbfb7053..59b058c7 100644 --- a/src/api/types/PublishStatus.ts +++ b/src/api/types/PublishStatus.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicate whether your Product should be set as "staging" or "live" - */ -export type PublishStatus = "staging" | "live"; +/** Indicate whether your Product should be set as "staging" or "live" */ export const PublishStatus = { Staging: "staging", Live: "live", } as const; +export type PublishStatus = (typeof PublishStatus)[keyof typeof PublishStatus]; diff --git a/src/api/types/Redirect.ts b/src/api/types/Redirect.ts index d0a7a9fc..ce5f0df2 100644 --- a/src/api/types/Redirect.ts +++ b/src/api/types/Redirect.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A single redirection rule, specifying a source URL and a destination URL. diff --git a/src/api/types/Redirects.ts b/src/api/types/Redirects.ts index f6da48d3..1cf4d147 100644 --- a/src/api/types/Redirects.ts +++ b/src/api/types/Redirects.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Site redirects response diff --git a/src/api/types/ReferenceField.ts b/src/api/types/ReferenceField.ts index 235f492a..6711f94f 100644 --- a/src/api/types/ReferenceField.ts +++ b/src/api/types/ReferenceField.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface ReferenceField { /** Unique identifier for a Field */ diff --git a/src/api/types/ReferenceFieldMetadata.ts b/src/api/types/ReferenceFieldMetadata.ts index df20cc41..e6834f1b 100644 --- a/src/api/types/ReferenceFieldMetadata.ts +++ b/src/api/types/ReferenceFieldMetadata.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The collectionId for the referenced collection. Only applicable for Reference and MultiReference fields. diff --git a/src/api/types/ReferenceFieldType.ts b/src/api/types/ReferenceFieldType.ts index de30ba70..1b9e5d67 100644 --- a/src/api/types/ReferenceFieldType.ts +++ b/src/api/types/ReferenceFieldType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Choose these appropriate field type for your collection data - */ -export type ReferenceFieldType = "MultiReference" | "Reference"; +/** Choose these appropriate field type for your collection data */ export const ReferenceFieldType = { MultiReference: "MultiReference", Reference: "Reference", } as const; +export type ReferenceFieldType = (typeof ReferenceFieldType)[keyof typeof ReferenceFieldType]; diff --git a/src/api/types/RegisteredScriptList.ts b/src/api/types/RegisteredScriptList.ts index d92cda4f..6caaccb7 100644 --- a/src/api/types/RegisteredScriptList.ts +++ b/src/api/types/RegisteredScriptList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A list of scripts registered to the site diff --git a/src/api/types/Robots.ts b/src/api/types/Robots.ts index 12242d47..94327cd8 100644 --- a/src/api/types/Robots.ts +++ b/src/api/types/Robots.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The robots.txt file for a given site diff --git a/src/api/types/RobotsRulesItem.ts b/src/api/types/RobotsRulesItem.ts index ce55b003..7b4ad0bd 100644 --- a/src/api/types/RobotsRulesItem.ts +++ b/src/api/types/RobotsRulesItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface RobotsRulesItem { /** The user agent the rules apply to. */ diff --git a/src/api/types/ScriptApply.ts b/src/api/types/ScriptApply.ts index 309a6bc0..2da7a46e 100644 --- a/src/api/types/ScriptApply.ts +++ b/src/api/types/ScriptApply.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface ScriptApply { /** ID of the registered custom code script */ diff --git a/src/api/types/ScriptApplyList.ts b/src/api/types/ScriptApplyList.ts index 3d30c3d1..596037da 100644 --- a/src/api/types/ScriptApplyList.ts +++ b/src/api/types/ScriptApplyList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface ScriptApplyList { /** A list of scripts applied to a Site or a Page */ diff --git a/src/api/types/ScriptApplyLocation.ts b/src/api/types/ScriptApplyLocation.ts index 058947d2..d3ec67a1 100644 --- a/src/api/types/ScriptApplyLocation.ts +++ b/src/api/types/ScriptApplyLocation.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Location of the script, either in the header or footer of the published site - */ -export type ScriptApplyLocation = "header" | "footer"; +/** Location of the script, either in the header or footer of the published site */ export const ScriptApplyLocation = { Header: "header", Footer: "footer", } as const; +export type ScriptApplyLocation = (typeof ScriptApplyLocation)[keyof typeof ScriptApplyLocation]; diff --git a/src/api/types/Scripts.ts b/src/api/types/Scripts.ts index e3882ce2..89f52b64 100644 --- a/src/api/types/Scripts.ts +++ b/src/api/types/Scripts.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A list of scripts applied to a Site or a Page diff --git a/src/api/types/SearchButtonNode.ts b/src/api/types/SearchButtonNode.ts index 5c05178b..bf136b82 100644 --- a/src/api/types/SearchButtonNode.ts +++ b/src/api/types/SearchButtonNode.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents search button elements within the DOM. It contains the text of the button. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/SearchButtonNodeWrite.ts b/src/api/types/SearchButtonNodeWrite.ts index b3e53d29..d2c1b82c 100644 --- a/src/api/types/SearchButtonNodeWrite.ts +++ b/src/api/types/SearchButtonNodeWrite.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Update a search button node diff --git a/src/api/types/Select.ts b/src/api/types/Select.ts index 80019663..5da581d4 100644 --- a/src/api/types/Select.ts +++ b/src/api/types/Select.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Update choices on a select node diff --git a/src/api/types/SelectNode.ts b/src/api/types/SelectNode.ts index 772862be..228650db 100644 --- a/src/api/types/SelectNode.ts +++ b/src/api/types/SelectNode.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Represents select elements within the DOM. It contains the list of choices in the select. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/SelectNodeChoicesItem.ts b/src/api/types/SelectNodeChoicesItem.ts index 770af4d6..a072da3a 100644 --- a/src/api/types/SelectNodeChoicesItem.ts +++ b/src/api/types/SelectNodeChoicesItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface SelectNodeChoicesItem { /** The value of the choice when selected. */ diff --git a/src/api/types/SelectNodeWriteChoicesItem.ts b/src/api/types/SelectNodeWriteChoicesItem.ts index eb919862..ba02166c 100644 --- a/src/api/types/SelectNodeWriteChoicesItem.ts +++ b/src/api/types/SelectNodeWriteChoicesItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface SelectNodeWriteChoicesItem { /** The value of the choice when selected. */ diff --git a/src/api/types/SingleLocaleCreatedPayload.ts b/src/api/types/SingleLocaleCreatedPayload.ts index 1cfb8ffe..2233a254 100644 --- a/src/api/types/SingleLocaleCreatedPayload.ts +++ b/src/api/types/SingleLocaleCreatedPayload.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface SingleLocaleCreatedPayload { /** Unique identifier for the Item */ diff --git a/src/api/types/SingleLocaleCreatedPayloadFieldData.ts b/src/api/types/SingleLocaleCreatedPayloadFieldData.ts index deb64844..c0694521 100644 --- a/src/api/types/SingleLocaleCreatedPayloadFieldData.ts +++ b/src/api/types/SingleLocaleCreatedPayloadFieldData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface SingleLocaleCreatedPayloadFieldData { name: string; diff --git a/src/api/types/Site.ts b/src/api/types/Site.ts index 57dcd424..c5b55454 100644 --- a/src/api/types/Site.ts +++ b/src/api/types/Site.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface Site { /** Unique identifier for the Site */ diff --git a/src/api/types/SiteActivityLogItem.ts b/src/api/types/SiteActivityLogItem.ts index 36040f5d..60414917 100644 --- a/src/api/types/SiteActivityLogItem.ts +++ b/src/api/types/SiteActivityLogItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface SiteActivityLogItem { id?: string; diff --git a/src/api/types/SiteActivityLogItemEvent.ts b/src/api/types/SiteActivityLogItemEvent.ts index ffb4deba..a352e1ba 100644 --- a/src/api/types/SiteActivityLogItemEvent.ts +++ b/src/api/types/SiteActivityLogItemEvent.ts @@ -1,50 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type SiteActivityLogItemEvent = - | "styles_modified" - | "site_published" - | "ix2_modified_on_page" - | "page_dom_modified" - | "cms_item" - | "backup_created" - | "page_custom_code_modified" - | "symbols_modified" - | "variable_modified" - | "variables_modified" - | "cms_collection" - | "page_settings_modified" - | "page_settings_custom_code_modified" - | "ix2_modified_on_component" - | "ix2_modified_on_class" - | "site_custom_code_modified" - | "page_duplicated" - | "secondary_locale_page_content_modified" - | "page_renamed" - | "page_created" - | "page_deleted" - | "site_unpublished" - | "backup_restored" - | "locale_added" - | "branch_created" - | "locale_display_name_updated" - | "locale_subdirectory_updated" - | "branch_merged" - | "locale_tag_updated" - | "branch_deleted" - | "locale_enabled" - | "locale_removed" - | "locale_disabled" - | "library_shared" - | "library_unshared" - | "library_installed" - | "library_uninstalled" - | "library_update_shared" - | "library_update_accepted" - | "branch_review_created" - | "branch_review_approved" - | "branch_review_canceled"; export const SiteActivityLogItemEvent = { StylesModified: "styles_modified", SitePublished: "site_published", @@ -89,3 +44,4 @@ export const SiteActivityLogItemEvent = { BranchReviewApproved: "branch_review_approved", BranchReviewCanceled: "branch_review_canceled", } as const; +export type SiteActivityLogItemEvent = (typeof SiteActivityLogItemEvent)[keyof typeof SiteActivityLogItemEvent]; diff --git a/src/api/types/SiteActivityLogItemResourceOperation.ts b/src/api/types/SiteActivityLogItemResourceOperation.ts index 53d4e841..c1590c71 100644 --- a/src/api/types/SiteActivityLogItemResourceOperation.ts +++ b/src/api/types/SiteActivityLogItemResourceOperation.ts @@ -1,17 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type SiteActivityLogItemResourceOperation = - | "CREATED" - | "MODIFIED" - | "PUBLISHED" - | "UNPUBLISHED" - | "DELETED" - | "GROUP_REORDERED" - | "GROUP_CREATED" - | "GROUP_DELETED" - | "REORDERED"; export const SiteActivityLogItemResourceOperation = { Created: "CREATED", Modified: "MODIFIED", @@ -23,3 +11,5 @@ export const SiteActivityLogItemResourceOperation = { GroupDeleted: "GROUP_DELETED", Reordered: "REORDERED", } as const; +export type SiteActivityLogItemResourceOperation = + (typeof SiteActivityLogItemResourceOperation)[keyof typeof SiteActivityLogItemResourceOperation]; diff --git a/src/api/types/SiteActivityLogItemUser.ts b/src/api/types/SiteActivityLogItemUser.ts index 0645923a..3c042e32 100644 --- a/src/api/types/SiteActivityLogItemUser.ts +++ b/src/api/types/SiteActivityLogItemUser.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface SiteActivityLogItemUser { id?: string; diff --git a/src/api/types/SiteActivityLogResponse.ts b/src/api/types/SiteActivityLogResponse.ts index 464261db..643c1104 100644 --- a/src/api/types/SiteActivityLogResponse.ts +++ b/src/api/types/SiteActivityLogResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface SiteActivityLogResponse { items?: Webflow.SiteActivityLogItem[]; diff --git a/src/api/types/SiteDataCollectionType.ts b/src/api/types/SiteDataCollectionType.ts index fac20f94..255a6b8f 100644 --- a/src/api/types/SiteDataCollectionType.ts +++ b/src/api/types/SiteDataCollectionType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of data collection enabled for the site. - */ -export type SiteDataCollectionType = "always" | "optOut" | "disabled"; +/** The type of data collection enabled for the site. */ export const SiteDataCollectionType = { Always: "always", OptOut: "optOut", Disabled: "disabled", } as const; +export type SiteDataCollectionType = (typeof SiteDataCollectionType)[keyof typeof SiteDataCollectionType]; diff --git a/src/api/types/SiteMembership.ts b/src/api/types/SiteMembership.ts index be0c8259..be91108a 100644 --- a/src/api/types/SiteMembership.ts +++ b/src/api/types/SiteMembership.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface SiteMembership { site?: Webflow.WorkspaceAuditLogItemPayloadSiteMembershipSite; diff --git a/src/api/types/SiteMembershipAuditLogItem.ts b/src/api/types/SiteMembershipAuditLogItem.ts index 3079e592..c7206201 100644 --- a/src/api/types/SiteMembershipAuditLogItem.ts +++ b/src/api/types/SiteMembershipAuditLogItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface SiteMembershipAuditLogItem { eventSubType?: Webflow.SiteMembershipAuditLogItemEventSubType; diff --git a/src/api/types/SiteMembershipAuditLogItemEventSubType.ts b/src/api/types/SiteMembershipAuditLogItemEventSubType.ts index 7cf2375a..39ee3185 100644 --- a/src/api/types/SiteMembershipAuditLogItemEventSubType.ts +++ b/src/api/types/SiteMembershipAuditLogItemEventSubType.ts @@ -1,15 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type SiteMembershipAuditLogItemEventSubType = - | "user_added" - | "user_removed" - | "user_role_updated" - | "user_granular_access_updated"; export const SiteMembershipAuditLogItemEventSubType = { UserAdded: "user_added", UserRemoved: "user_removed", UserRoleUpdated: "user_role_updated", UserGranularAccessUpdated: "user_granular_access_updated", } as const; +export type SiteMembershipAuditLogItemEventSubType = + (typeof SiteMembershipAuditLogItemEventSubType)[keyof typeof SiteMembershipAuditLogItemEventSubType]; diff --git a/src/api/types/SitePlan.ts b/src/api/types/SitePlan.ts index 3a1c50cf..7c2e8b7a 100644 --- a/src/api/types/SitePlan.ts +++ b/src/api/types/SitePlan.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface SitePlan { /** ID of the hosting plan. */ diff --git a/src/api/types/SitePlanId.ts b/src/api/types/SitePlanId.ts index 0dcffe41..72bc39d7 100644 --- a/src/api/types/SitePlanId.ts +++ b/src/api/types/SitePlanId.ts @@ -1,23 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * ID of the hosting plan. - */ -export type SitePlanId = - | "hosting-basic-v3" - | "hosting-cms-v3" - | "hosting-business-v3" - | "hosting-ecommerce-standard-v2" - | "hosting-ecommerce-plus-v2" - | "hosting-ecommerce-advanced-v2" - | "hosting-basic-v4" - | "hosting-cms-v4" - | "hosting-business-v4" - | "hosting-ecommerce-standard-v3" - | "hosting-ecommerce-plus-v3" - | "hosting-ecommerce-advanced-v3"; +/** ID of the hosting plan. */ export const SitePlanId = { HostingBasicV3: "hosting-basic-v3", HostingCmsV3: "hosting-cms-v3", @@ -32,3 +15,4 @@ export const SitePlanId = { HostingEcommercePlusV3: "hosting-ecommerce-plus-v3", HostingEcommerceAdvancedV3: "hosting-ecommerce-advanced-v3", } as const; +export type SitePlanId = (typeof SitePlanId)[keyof typeof SitePlanId]; diff --git a/src/api/types/SitePlanName.ts b/src/api/types/SitePlanName.ts index 0b0625c8..7d24eed8 100644 --- a/src/api/types/SitePlanName.ts +++ b/src/api/types/SitePlanName.ts @@ -1,17 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Name of the hosting plan. - */ -export type SitePlanName = - | "Basic Hosting" - | "CMS Hosting" - | "Business Hosting" - | "ECommerce Standard Hosting" - | "ECommerce Plus Hosting" - | "ECommerce Advanced Hosting"; +/** Name of the hosting plan. */ export const SitePlanName = { BasicHosting: "Basic Hosting", CmsHosting: "CMS Hosting", @@ -20,3 +9,4 @@ export const SitePlanName = { ECommercePlusHosting: "ECommerce Plus Hosting", ECommerceAdvancedHosting: "ECommerce Advanced Hosting", } as const; +export type SitePlanName = (typeof SitePlanName)[keyof typeof SitePlanName]; diff --git a/src/api/types/SitePublish.ts b/src/api/types/SitePublish.ts index 622ade36..7d36cd61 100644 --- a/src/api/types/SitePublish.ts +++ b/src/api/types/SitePublish.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when a Site is published diff --git a/src/api/types/SitePublishPayload.ts b/src/api/types/SitePublishPayload.ts index 51db8046..e715e4cc 100644 --- a/src/api/types/SitePublishPayload.ts +++ b/src/api/types/SitePublishPayload.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The payload of data sent from Webflow diff --git a/src/api/types/Sites.ts b/src/api/types/Sites.ts index 08f27116..52b14f9b 100644 --- a/src/api/types/Sites.ts +++ b/src/api/types/Sites.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface Sites { sites?: Webflow.Site[]; diff --git a/src/api/types/Sku.ts b/src/api/types/Sku.ts index 474348cd..e17d0746 100644 --- a/src/api/types/Sku.ts +++ b/src/api/types/Sku.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The SKU object diff --git a/src/api/types/SkuFieldData.ts b/src/api/types/SkuFieldData.ts index c15373e8..9ffbaf65 100644 --- a/src/api/types/SkuFieldData.ts +++ b/src/api/types/SkuFieldData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Standard and Custom fields for a SKU diff --git a/src/api/types/SkuFieldDataCompareAtPrice.ts b/src/api/types/SkuFieldDataCompareAtPrice.ts index 5de20c20..748cd30c 100644 --- a/src/api/types/SkuFieldDataCompareAtPrice.ts +++ b/src/api/types/SkuFieldDataCompareAtPrice.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * comparison price of SKU diff --git a/src/api/types/SkuFieldDataEcSkuBillingMethod.ts b/src/api/types/SkuFieldDataEcSkuBillingMethod.ts index a837c612..993c2a44 100644 --- a/src/api/types/SkuFieldDataEcSkuBillingMethod.ts +++ b/src/api/types/SkuFieldDataEcSkuBillingMethod.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * [Billing method](https://help.webflow.com/hc/en-us/articles/33961432087955-Add-and-manage-products-and-categories#billing-methods)for the SKU - */ -export type SkuFieldDataEcSkuBillingMethod = "one-time" | "subscription"; +/** [Billing method](https://help.webflow.com/hc/en-us/articles/33961432087955-Add-and-manage-products-and-categories#billing-methods)for the SKU */ export const SkuFieldDataEcSkuBillingMethod = { OneTime: "one-time", Subscription: "subscription", } as const; +export type SkuFieldDataEcSkuBillingMethod = + (typeof SkuFieldDataEcSkuBillingMethod)[keyof typeof SkuFieldDataEcSkuBillingMethod]; diff --git a/src/api/types/SkuFieldDataEcSkuSubscriptionPlan.ts b/src/api/types/SkuFieldDataEcSkuSubscriptionPlan.ts index ded3f047..38241b7e 100644 --- a/src/api/types/SkuFieldDataEcSkuSubscriptionPlan.ts +++ b/src/api/types/SkuFieldDataEcSkuSubscriptionPlan.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * [Subscription plan](https://help.webflow.com/hc/en-us/articles/33961432087955-Add-and-manage-products-and-categories#subscription) for the SKU diff --git a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts index 75c559dc..ffcdac03 100644 --- a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts +++ b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts @@ -1,14 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Interval of subscription renewal - */ -export type SkuFieldDataEcSkuSubscriptionPlanInterval = "day" | "week" | "month" | "year"; +/** Interval of subscription renewal */ export const SkuFieldDataEcSkuSubscriptionPlanInterval = { Day: "day", Week: "week", Month: "month", Year: "year", } as const; +export type SkuFieldDataEcSkuSubscriptionPlanInterval = + (typeof SkuFieldDataEcSkuSubscriptionPlanInterval)[keyof typeof SkuFieldDataEcSkuSubscriptionPlanInterval]; diff --git a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts index 16299854..59c71228 100644 --- a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts +++ b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface SkuFieldDataEcSkuSubscriptionPlanPlansItem { /** The platform of the subscription plan */ diff --git a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts index e62b0982..325fdb84 100644 --- a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts +++ b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The status of the plan - */ -export type SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus = "active" | "inactive" | "canceled"; +/** The status of the plan */ export const SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus = { Active: "active", Inactive: "inactive", Canceled: "canceled", } as const; +export type SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus = + (typeof SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus)[keyof typeof SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus]; diff --git a/src/api/types/SkuFieldDataPrice.ts b/src/api/types/SkuFieldDataPrice.ts index d37d51d9..810c1b53 100644 --- a/src/api/types/SkuFieldDataPrice.ts +++ b/src/api/types/SkuFieldDataPrice.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * price of SKU diff --git a/src/api/types/SkuPropertyList.ts b/src/api/types/SkuPropertyList.ts index c35efef4..b4b60bd2 100644 --- a/src/api/types/SkuPropertyList.ts +++ b/src/api/types/SkuPropertyList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * A variant/option type for a SKU diff --git a/src/api/types/SkuPropertyListEnumItem.ts b/src/api/types/SkuPropertyListEnumItem.ts index 037188ff..9775554b 100644 --- a/src/api/types/SkuPropertyListEnumItem.ts +++ b/src/api/types/SkuPropertyListEnumItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Enumerated Product variants/Options for the SKU diff --git a/src/api/types/SkuValueList.ts b/src/api/types/SkuValueList.ts index be5dd1f7..87d26460 100644 --- a/src/api/types/SkuValueList.ts +++ b/src/api/types/SkuValueList.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A mapping between SKU properties and their values, represented as key-value pairs. Each key represents a SKU Property ID (e.g. "color") and maps to its corresponding SKU Value ID (e.g. "blue"). This structure defines the specific variant combination for a SKU. diff --git a/src/api/types/StaticField.ts b/src/api/types/StaticField.ts index aee57fdc..0482f771 100644 --- a/src/api/types/StaticField.ts +++ b/src/api/types/StaticField.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface StaticField { /** Unique identifier for a Field */ diff --git a/src/api/types/StaticFieldType.ts b/src/api/types/StaticFieldType.ts index d590ff0c..7863c82d 100644 --- a/src/api/types/StaticFieldType.ts +++ b/src/api/types/StaticFieldType.ts @@ -1,24 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Choose these appropriate field type for your collection data - */ -export type StaticFieldType = - | "Color" - | "DateTime" - | "Email" - | "File" - | "Image" - | "Link" - | "MultiImage" - | "Number" - | "Phone" - | "PlainText" - | "RichText" - | "Switch" - | "VideoLink"; +/** Choose these appropriate field type for your collection data */ export const StaticFieldType = { Color: "Color", DateTime: "DateTime", @@ -34,3 +16,4 @@ export const StaticFieldType = { Switch: "Switch", VideoLink: "VideoLink", } as const; +export type StaticFieldType = (typeof StaticFieldType)[keyof typeof StaticFieldType]; diff --git a/src/api/types/StripeCard.ts b/src/api/types/StripeCard.ts index e8b0eca4..5b929a36 100644 --- a/src/api/types/StripeCard.ts +++ b/src/api/types/StripeCard.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Details on the card used to fulfill this order, if this order was finalized with Stripe. diff --git a/src/api/types/StripeCardBrand.ts b/src/api/types/StripeCardBrand.ts index 359400b5..0b986da1 100644 --- a/src/api/types/StripeCardBrand.ts +++ b/src/api/types/StripeCardBrand.ts @@ -1,18 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The card's brand (ie. credit card network) - */ -export type StripeCardBrand = - | "Visa" - | "American Express" - | "MasterCard" - | "Discover" - | "JCB" - | "Diners Club" - | "Unknown"; +/** The card's brand (ie. credit card network) */ export const StripeCardBrand = { Visa: "Visa", AmericanExpress: "American Express", @@ -22,3 +10,4 @@ export const StripeCardBrand = { DinersClub: "Diners Club", Unknown: "Unknown", } as const; +export type StripeCardBrand = (typeof StripeCardBrand)[keyof typeof StripeCardBrand]; diff --git a/src/api/types/StripeCardExpires.ts b/src/api/types/StripeCardExpires.ts index 219a0924..10a7d7af 100644 --- a/src/api/types/StripeCardExpires.ts +++ b/src/api/types/StripeCardExpires.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The card's expiration date. diff --git a/src/api/types/StripeDetails.ts b/src/api/types/StripeDetails.ts index f0e4f937..356bb059 100644 --- a/src/api/types/StripeDetails.ts +++ b/src/api/types/StripeDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * An object with various Stripe IDs, useful for linking into the stripe dashboard. diff --git a/src/api/types/SubmitButtonNode.ts b/src/api/types/SubmitButtonNode.ts index 18b31327..d9b55c60 100644 --- a/src/api/types/SubmitButtonNode.ts +++ b/src/api/types/SubmitButtonNode.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents submit button elements within the DOM. It contains the text and waiting text of the button. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/SubmitButtonNodeWrite.ts b/src/api/types/SubmitButtonNodeWrite.ts index f7f5e428..492109fa 100644 --- a/src/api/types/SubmitButtonNodeWrite.ts +++ b/src/api/types/SubmitButtonNodeWrite.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Update a submit button node diff --git a/src/api/types/Text.ts b/src/api/types/Text.ts index 9b62448c..438067fe 100644 --- a/src/api/types/Text.ts +++ b/src/api/types/Text.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The text content of the node diff --git a/src/api/types/TextInputNode.ts b/src/api/types/TextInputNode.ts index 17dca89c..8ccc24d2 100644 --- a/src/api/types/TextInputNode.ts +++ b/src/api/types/TextInputNode.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents text input and textarea elements within the DOM. It contains the placeholder text in the input. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/TextInputNodeWrite.ts b/src/api/types/TextInputNodeWrite.ts index 4e25aded..b6446772 100644 --- a/src/api/types/TextInputNodeWrite.ts +++ b/src/api/types/TextInputNodeWrite.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Update placeholder text on a text input node diff --git a/src/api/types/TextNode.ts b/src/api/types/TextNode.ts index 13015905..b5d1ee97 100644 --- a/src/api/types/TextNode.ts +++ b/src/api/types/TextNode.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Represents text content within the DOM. It contains both the raw text and its HTML representation. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/TextNodeText.ts b/src/api/types/TextNodeText.ts index 05f25552..6edf3291 100644 --- a/src/api/types/TextNodeText.ts +++ b/src/api/types/TextNodeText.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The text content of the node diff --git a/src/api/types/TextNodeWrite.ts b/src/api/types/TextNodeWrite.ts index 0c52cf2c..3003af32 100644 --- a/src/api/types/TextNodeWrite.ts +++ b/src/api/types/TextNodeWrite.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Update a text node diff --git a/src/api/types/TriggerType.ts b/src/api/types/TriggerType.ts index a059fadb..ed78a086 100644 --- a/src/api/types/TriggerType.ts +++ b/src/api/types/TriggerType.ts @@ -1,28 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of event that triggered the request. See the the documentation for details on [supported events](/data/reference/all-events). - */ -export type TriggerType = - | "form_submission" - | "site_publish" - | "page_created" - | "page_metadata_updated" - | "page_deleted" - | "ecomm_new_order" - | "ecomm_order_changed" - | "ecomm_inventory_changed" - | "user_account_added" - | "user_account_updated" - | "user_account_deleted" - | "collection_item_created" - | "collection_item_changed" - | "collection_item_deleted" - | "collection_item_published" - | "collection_item_unpublished" - | "comment_created"; +/** The type of event that triggered the request. See the the documentation for details on [supported events](/data/reference/all-events). */ export const TriggerType = { FormSubmission: "form_submission", SitePublish: "site_publish", @@ -42,3 +20,4 @@ export const TriggerType = { CollectionItemUnpublished: "collection_item_unpublished", CommentCreated: "comment_created", } as const; +export type TriggerType = (typeof TriggerType)[keyof typeof TriggerType]; diff --git a/src/api/types/UpdatedOrder.ts b/src/api/types/UpdatedOrder.ts index 125471d3..09265c46 100644 --- a/src/api/types/UpdatedOrder.ts +++ b/src/api/types/UpdatedOrder.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The Webhook payload for when an order is updated diff --git a/src/api/types/User.ts b/src/api/types/User.ts index 4709c50b..e8fb20ef 100644 --- a/src/api/types/User.ts +++ b/src/api/types/User.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items diff --git a/src/api/types/UserAccess.ts b/src/api/types/UserAccess.ts index bd05d769..3824f8bb 100644 --- a/src/api/types/UserAccess.ts +++ b/src/api/types/UserAccess.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface UserAccess { method?: Webflow.WorkspaceAuditLogItemPayloadUserAccessMethod; diff --git a/src/api/types/UserAccessAuditLogItem.ts b/src/api/types/UserAccessAuditLogItem.ts index bbc3d213..a0079105 100644 --- a/src/api/types/UserAccessAuditLogItem.ts +++ b/src/api/types/UserAccessAuditLogItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface UserAccessAuditLogItem { eventSubType?: Webflow.UserAccessAuditLogItemEventSubType; diff --git a/src/api/types/UserAccessAuditLogItemEventSubType.ts b/src/api/types/UserAccessAuditLogItemEventSubType.ts index ca7071a5..d4a5f31a 100644 --- a/src/api/types/UserAccessAuditLogItemEventSubType.ts +++ b/src/api/types/UserAccessAuditLogItemEventSubType.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type UserAccessAuditLogItemEventSubType = "login" | "logout"; export const UserAccessAuditLogItemEventSubType = { Login: "login", Logout: "logout", } as const; +export type UserAccessAuditLogItemEventSubType = + (typeof UserAccessAuditLogItemEventSubType)[keyof typeof UserAccessAuditLogItemEventSubType]; diff --git a/src/api/types/UserAccessGroupsItem.ts b/src/api/types/UserAccessGroupsItem.ts index 637d39f3..db535778 100644 --- a/src/api/types/UserAccessGroupsItem.ts +++ b/src/api/types/UserAccessGroupsItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * Access group slugs and types diff --git a/src/api/types/UserAccessGroupsItemType.ts b/src/api/types/UserAccessGroupsItemType.ts index ab143a12..1b9d6ee7 100644 --- a/src/api/types/UserAccessGroupsItemType.ts +++ b/src/api/types/UserAccessGroupsItemType.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The type of access group based on how it was assigned to the user. * * `admin` - Assigned to the user via API or in the designer * * `ecommerce` - Assigned to the user via an ecommerce purchase */ -export type UserAccessGroupsItemType = "admin" | "ecommerce"; export const UserAccessGroupsItemType = { Admin: "admin", Ecommerce: "ecommerce", } as const; +export type UserAccessGroupsItemType = (typeof UserAccessGroupsItemType)[keyof typeof UserAccessGroupsItemType]; diff --git a/src/api/types/UserData.ts b/src/api/types/UserData.ts index 1dacfea8..a0eba2e4 100644 --- a/src/api/types/UserData.ts +++ b/src/api/types/UserData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * An object containing the User's basic info and custom fields diff --git a/src/api/types/UserDataData.ts b/src/api/types/UserDataData.ts index ad23a6ca..3331a04b 100644 --- a/src/api/types/UserDataData.ts +++ b/src/api/types/UserDataData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface UserDataData { /** The name of the user */ diff --git a/src/api/types/UserLimitReached.ts b/src/api/types/UserLimitReached.ts index ca77b2b9..63391910 100644 --- a/src/api/types/UserLimitReached.ts +++ b/src/api/types/UserLimitReached.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type UserLimitReached = unknown; diff --git a/src/api/types/UserList.ts b/src/api/types/UserList.ts index f7b1869d..5af20e80 100644 --- a/src/api/types/UserList.ts +++ b/src/api/types/UserList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; /** * The list users results diff --git a/src/api/types/UserStatus.ts b/src/api/types/UserStatus.ts index 66168ff3..9b3f689c 100644 --- a/src/api/types/UserStatus.ts +++ b/src/api/types/UserStatus.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The status of the user - */ -export type UserStatus = "invited" | "verified" | "unverified"; +/** The status of the user */ export const UserStatus = { Invited: "invited", Verified: "verified", Unverified: "unverified", } as const; +export type UserStatus = (typeof UserStatus)[keyof typeof UserStatus]; diff --git a/src/api/types/UsersNotEnabled.ts b/src/api/types/UsersNotEnabled.ts index fe129bc3..70087df9 100644 --- a/src/api/types/UsersNotEnabled.ts +++ b/src/api/types/UsersNotEnabled.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type UsersNotEnabled = unknown; diff --git a/src/api/types/Webhook.ts b/src/api/types/Webhook.ts index e68efb78..b41baaf6 100644 --- a/src/api/types/Webhook.ts +++ b/src/api/types/Webhook.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface Webhook { /** Unique identifier for the Webhook registration */ diff --git a/src/api/types/WebhookFilter.ts b/src/api/types/WebhookFilter.ts index 36b41efb..ce31d751 100644 --- a/src/api/types/WebhookFilter.ts +++ b/src/api/types/WebhookFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Only supported for the `form_submission` trigger type. Filter for the form you want Webhooks to be sent for. diff --git a/src/api/types/WebhookList.ts b/src/api/types/WebhookList.ts index 3eb80995..b65385b8 100644 --- a/src/api/types/WebhookList.ts +++ b/src/api/types/WebhookList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface WebhookList { webhooks?: Webflow.Webhook[]; diff --git a/src/api/types/WorkspaceAuditLogItem.ts b/src/api/types/WorkspaceAuditLogItem.ts index 1372526b..f4fa42e5 100644 --- a/src/api/types/WorkspaceAuditLogItem.ts +++ b/src/api/types/WorkspaceAuditLogItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export type WorkspaceAuditLogItem = | Webflow.WorkspaceAuditLogItem.UserAccess diff --git a/src/api/types/WorkspaceAuditLogItemActor.ts b/src/api/types/WorkspaceAuditLogItemActor.ts index 1f8f45bb..f08d817d 100644 --- a/src/api/types/WorkspaceAuditLogItemActor.ts +++ b/src/api/types/WorkspaceAuditLogItemActor.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WorkspaceAuditLogItemActor { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts index 3e0fbcb7..729b3f5d 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts index 950c77de..3dda5663 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts @@ -1,14 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceAuditLogItemPayloadSiteMembershipMethod = - | "sso" - | "invite" - | "scim" - | "dashboard" - | "admin" - | "access_request"; export const WorkspaceAuditLogItemPayloadSiteMembershipMethod = { Sso: "sso", Invite: "invite", @@ -17,3 +8,5 @@ export const WorkspaceAuditLogItemPayloadSiteMembershipMethod = { Admin: "admin", AccessRequest: "access_request", } as const; +export type WorkspaceAuditLogItemPayloadSiteMembershipMethod = + (typeof WorkspaceAuditLogItemPayloadSiteMembershipMethod)[keyof typeof WorkspaceAuditLogItemPayloadSiteMembershipMethod]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts index d02ed3f9..fca5867c 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WorkspaceAuditLogItemPayloadSiteMembershipSite { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts index 19275a27..ec667773 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WorkspaceAuditLogItemPayloadSiteMembershipTargetUser { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts index 07ad34b2..2bbebd72 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts @@ -1,11 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceAuditLogItemPayloadSiteMembershipUserType = "member" | "guest" | "reviewer" | "client"; export const WorkspaceAuditLogItemPayloadSiteMembershipUserType = { Member: "member", Guest: "guest", Reviewer: "reviewer", Client: "client", } as const; +export type WorkspaceAuditLogItemPayloadSiteMembershipUserType = + (typeof WorkspaceAuditLogItemPayloadSiteMembershipUserType)[keyof typeof WorkspaceAuditLogItemPayloadSiteMembershipUserType]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts b/src/api/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts index 63ab80aa..b83c7891 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts @@ -1,11 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceAuditLogItemPayloadUserAccessMethod = "dashboard" | "sso" | "api" | "google"; export const WorkspaceAuditLogItemPayloadUserAccessMethod = { Dashboard: "dashboard", Sso: "sso", Api: "api", Google: "google", } as const; +export type WorkspaceAuditLogItemPayloadUserAccessMethod = + (typeof WorkspaceAuditLogItemPayloadUserAccessMethod)[keyof typeof WorkspaceAuditLogItemPayloadUserAccessMethod]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts index cd4e89b6..dc9a42e4 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts @@ -1,10 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod = "sso" | "dashboard" | "admin"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod = { Sso: "sso", Dashboard: "dashboard", Admin: "admin", } as const; +export type WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod = + (typeof WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod)[keyof typeof WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts index cd74ed4c..4c339687 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts index 860cdaad..dd058556 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts index a79a1f57..c57892c1 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts @@ -1,11 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType = "member" | "guest" | "reviewer" | "client"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType = { Member: "member", Guest: "guest", Reviewer: "reviewer", Client: "client", } as const; +export type WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType = + (typeof WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType)[keyof typeof WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts index 22b080cc..f31f0c0d 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts @@ -1,11 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod = "sso" | "dashboard" | "admin" | "access_request"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod = { Sso: "sso", Dashboard: "dashboard", Admin: "admin", AccessRequest: "access_request", } as const; +export type WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod = + (typeof WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod)[keyof typeof WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts index 1747e827..190dd0e8 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts index 02029299..17ef8968 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts @@ -1,11 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType = "member" | "guest" | "reviewer" | "client"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType = { Member: "member", Guest: "guest", Reviewer: "reviewer", Client: "client", } as const; +export type WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType = + (typeof WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType)[keyof typeof WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType]; diff --git a/src/api/types/WorkspaceAuditLogItemWorkspace.ts b/src/api/types/WorkspaceAuditLogItemWorkspace.ts index f60d705b..f29a357f 100644 --- a/src/api/types/WorkspaceAuditLogItemWorkspace.ts +++ b/src/api/types/WorkspaceAuditLogItemWorkspace.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WorkspaceAuditLogItemWorkspace { id?: string; diff --git a/src/api/types/WorkspaceAuditLogResponse.ts b/src/api/types/WorkspaceAuditLogResponse.ts index 4c740f8d..9c162042 100644 --- a/src/api/types/WorkspaceAuditLogResponse.ts +++ b/src/api/types/WorkspaceAuditLogResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface WorkspaceAuditLogResponse { items?: Webflow.WorkspaceAuditLogItem[]; diff --git a/src/api/types/WorkspaceInvitation.ts b/src/api/types/WorkspaceInvitation.ts index 448c82ae..0bc52872 100644 --- a/src/api/types/WorkspaceInvitation.ts +++ b/src/api/types/WorkspaceInvitation.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface WorkspaceInvitation { targetUser?: Webflow.WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser; diff --git a/src/api/types/WorkspaceInvitationAuditLogItem.ts b/src/api/types/WorkspaceInvitationAuditLogItem.ts index 0a3dea4c..1d36ecb4 100644 --- a/src/api/types/WorkspaceInvitationAuditLogItem.ts +++ b/src/api/types/WorkspaceInvitationAuditLogItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface WorkspaceInvitationAuditLogItem { eventSubType?: Webflow.WorkspaceInvitationAuditLogItemEventSubType; diff --git a/src/api/types/WorkspaceInvitationAuditLogItemEventSubType.ts b/src/api/types/WorkspaceInvitationAuditLogItemEventSubType.ts index bc474207..e58a38d6 100644 --- a/src/api/types/WorkspaceInvitationAuditLogItemEventSubType.ts +++ b/src/api/types/WorkspaceInvitationAuditLogItemEventSubType.ts @@ -1,14 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceInvitationAuditLogItemEventSubType = - | "invite_sent" - | "invite_accepted" - | "invite_updated" - | "invite_canceled" - | "invite_declined" - | "access_request_accepted"; export const WorkspaceInvitationAuditLogItemEventSubType = { InviteSent: "invite_sent", InviteAccepted: "invite_accepted", @@ -17,3 +8,5 @@ export const WorkspaceInvitationAuditLogItemEventSubType = { InviteDeclined: "invite_declined", AccessRequestAccepted: "access_request_accepted", } as const; +export type WorkspaceInvitationAuditLogItemEventSubType = + (typeof WorkspaceInvitationAuditLogItemEventSubType)[keyof typeof WorkspaceInvitationAuditLogItemEventSubType]; diff --git a/src/api/types/WorkspaceMembership.ts b/src/api/types/WorkspaceMembership.ts index 62df5b26..03212e6f 100644 --- a/src/api/types/WorkspaceMembership.ts +++ b/src/api/types/WorkspaceMembership.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface WorkspaceMembership { targetUser?: Webflow.WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser; diff --git a/src/api/types/WorkspaceMembershipAuditLogItem.ts b/src/api/types/WorkspaceMembershipAuditLogItem.ts index df5fcff1..c0ba842e 100644 --- a/src/api/types/WorkspaceMembershipAuditLogItem.ts +++ b/src/api/types/WorkspaceMembershipAuditLogItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Webflow from "../index"; +import type * as Webflow from "../index"; export interface WorkspaceMembershipAuditLogItem { eventSubType?: Webflow.WorkspaceMembershipAuditLogItemEventSubType; diff --git a/src/api/types/WorkspaceMembershipAuditLogItemEventSubType.ts b/src/api/types/WorkspaceMembershipAuditLogItemEventSubType.ts index 721ced6c..919bfd0f 100644 --- a/src/api/types/WorkspaceMembershipAuditLogItemEventSubType.ts +++ b/src/api/types/WorkspaceMembershipAuditLogItemEventSubType.ts @@ -1,10 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type WorkspaceMembershipAuditLogItemEventSubType = "user_added" | "user_removed" | "user_role_updated"; export const WorkspaceMembershipAuditLogItemEventSubType = { UserAdded: "user_added", UserRemoved: "user_removed", UserRoleUpdated: "user_role_updated", } as const; +export type WorkspaceMembershipAuditLogItemEventSubType = + (typeof WorkspaceMembershipAuditLogItemEventSubType)[keyof typeof WorkspaceMembershipAuditLogItemEventSubType]; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 226d0e81..05e2bc8a 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,264 +1,264 @@ -export * from "./ForbiddenErrorBody"; -export * from "./BadRequestErrorBody"; -export * from "./ItemsListItemsRequestLastPublished"; -export * from "./ItemsListItemsLiveRequestLastPublished"; -export * from "./ConflictErrorBody"; -export * from "./AuthorizedUser"; -export * from "./ErrorCode"; -export * from "./Error_"; +export * from "./AccessGroup"; +export * from "./AccessGroupList"; export * from "./Application"; -export * from "./AuthorizationAuthorizationAuthorizedTo"; -export * from "./AuthorizationAuthorization"; +export * from "./Asset"; +export * from "./AssetFolder"; +export * from "./AssetFolderList"; +export * from "./Assets"; +export * from "./AssetUpload"; +export * from "./AssetUploadUploadDetails"; +export * from "./AssetVariant"; export * from "./Authorization"; -export * from "./Domain"; -export * from "./Locale"; -export * from "./Locales"; -export * from "./SiteDataCollectionType"; -export * from "./Site"; -export * from "./InvalidScopes"; -export * from "./NotEnterprisePlanWorkspace"; -export * from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; -export * from "./UserAccess"; -export * from "./UserAccessAuditLogItemEventSubType"; -export * from "./UserAccessAuditLogItem"; -export * from "./CustomRole"; -export * from "./CustomRoleAuditLogItemEventSubType"; -export * from "./CustomRoleAuditLogItem"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; -export * from "./WorkspaceMembership"; -export * from "./WorkspaceMembershipAuditLogItemEventSubType"; -export * from "./WorkspaceMembershipAuditLogItem"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; -export * from "./SiteMembership"; -export * from "./SiteMembershipAuditLogItemEventSubType"; -export * from "./SiteMembershipAuditLogItem"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; -export * from "./WorkspaceInvitation"; -export * from "./WorkspaceInvitationAuditLogItemEventSubType"; -export * from "./WorkspaceInvitationAuditLogItem"; -export * from "./WorkspaceAuditLogItemActor"; -export * from "./WorkspaceAuditLogItemWorkspace"; -export * from "./WorkspaceAuditLogItem"; -export * from "./Pagination"; -export * from "./WorkspaceAuditLogResponse"; -export * from "./Sites"; -export * from "./NotEnterprisePlanSite"; -export * from "./Domains"; -export * from "./InvalidDomain"; -export * from "./NoDomains"; -export * from "./Redirect"; -export * from "./Redirects"; -export * from "./SitePlanId"; -export * from "./SitePlanName"; -export * from "./SitePlan"; -export * from "./RobotsRulesItem"; -export * from "./Robots"; -export * from "./SiteActivityLogItemEvent"; -export * from "./SiteActivityLogItemResourceOperation"; -export * from "./SiteActivityLogItemUser"; -export * from "./SiteActivityLogItem"; -export * from "./SiteActivityLogResponse"; -export * from "./CollectionListArrayItem"; -export * from "./CollectionList"; -export * from "./StaticFieldType"; -export * from "./StaticField"; -export * from "./MetadataOptionsItem"; -export * from "./Metadata"; -export * from "./OptionField"; -export * from "./ReferenceFieldType"; -export * from "./ReferenceFieldMetadata"; -export * from "./ReferenceField"; -export * from "./FieldCreate"; -export * from "./FieldType"; -export * from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; -export * from "./FieldValidationsAdditionalProperties"; -export * from "./FieldValidations"; -export * from "./Field"; +export * from "./AuthorizationAuthorization"; +export * from "./AuthorizationAuthorizationAuthorizedTo"; +export * from "./AuthorizedUser"; +export * from "./BadRequestErrorBody"; +export * from "./BulkCollectionItem"; +export * from "./BulkCollectionItemFieldData"; export * from "./Collection"; -export * from "./CollectionItemFieldData"; export * from "./CollectionItem"; -export * from "./CollectionItemListPagination"; +export * from "./CollectionItemChanged"; +export * from "./CollectionItemCreated"; +export * from "./CollectionItemFieldData"; export * from "./CollectionItemList"; -export * from "./CollectionItemPostSingleFieldData"; -export * from "./CollectionItemPostSingle"; -export * from "./CollectionItemWithIdInputFieldData"; -export * from "./CollectionItemWithIdInput"; export * from "./CollectionItemListNoPagination"; -export * from "./Conflict"; -export * from "./BulkCollectionItemFieldData"; -export * from "./BulkCollectionItem"; -export * from "./CollectionItemPatchSingleFieldData"; +export * from "./CollectionItemListPagination"; export * from "./CollectionItemPatchSingle"; -export * from "./CommentThreadAuthor"; -export * from "./CommentThreadMentionedUsersItem"; -export * from "./CommentThread"; -export * from "./CommentThreadListPagination"; -export * from "./CommentThreadList"; -export * from "./CommentReplyAuthor"; -export * from "./CommentReplyMentionedUsersItem"; +export * from "./CollectionItemPatchSingleFieldData"; +export * from "./CollectionItemPostSingle"; +export * from "./CollectionItemPostSingleFieldData"; +export * from "./CollectionItemPublished"; +export * from "./CollectionItemRemoved"; +export * from "./CollectionItemRemovedPayload"; +export * from "./CollectionItemRemovedPayloadFieldData"; +export * from "./CollectionItemUnpublished"; +export * from "./CollectionItemUnpublishedPayload"; +export * from "./CollectionItemUnpublishedPayloadFieldData"; +export * from "./CollectionItemWithIdInput"; +export * from "./CollectionItemWithIdInputFieldData"; +export * from "./CollectionList"; +export * from "./CollectionListArrayItem"; +export * from "./Comment"; +export * from "./CommentPayload"; +export * from "./CommentPayloadAuthor"; +export * from "./CommentPayloadMentionedUsersItem"; export * from "./CommentReply"; -export * from "./CommentReplyListPagination"; +export * from "./CommentReplyAuthor"; export * from "./CommentReplyList"; -export * from "./PageSeo"; -export * from "./PageOpenGraph"; -export * from "./Page"; -export * from "./PageList"; -export * from "./TextNodeText"; -export * from "./TextNode"; -export * from "./ImageNodeImage"; -export * from "./ImageNode"; -export * from "./Text"; -export * from "./ComponentPropertyType"; -export * from "./ComponentProperty"; -export * from "./ComponentNode"; -export * from "./TextInputNode"; -export * from "./SelectNodeChoicesItem"; -export * from "./SelectNode"; -export * from "./SubmitButtonNode"; -export * from "./SearchButtonNode"; -export * from "./Node"; -export * from "./Dom"; -export * from "./TextNodeWrite"; -export * from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; -export * from "./ComponentInstanceNodePropertyOverridesWrite"; -export * from "./SelectNodeWriteChoicesItem"; -export * from "./Select"; -export * from "./TextInputNodeWrite"; -export * from "./SubmitButtonNodeWrite"; -export * from "./SearchButtonNodeWrite"; +export * from "./CommentReplyListPagination"; +export * from "./CommentReplyMentionedUsersItem"; +export * from "./CommentThread"; +export * from "./CommentThreadAuthor"; +export * from "./CommentThreadList"; +export * from "./CommentThreadListPagination"; +export * from "./CommentThreadMentionedUsersItem"; export * from "./Component"; -export * from "./ComponentList"; export * from "./ComponentDom"; +export * from "./ComponentInstanceNodePropertyOverridesWrite"; +export * from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; +export * from "./ComponentList"; +export * from "./ComponentNode"; export * from "./ComponentProperties"; -export * from "./ScriptApplyLocation"; -export * from "./ScriptApply"; -export * from "./ScriptApplyList"; +export * from "./ComponentProperty"; +export * from "./ComponentPropertyType"; +export * from "./Conflict"; +export * from "./ConflictErrorBody"; +export * from "./CustomCodeBlock"; +export * from "./CustomCodeBlockType"; export * from "./CustomCodeHostedResponse"; -export * from "./RegisteredScriptList"; export * from "./CustomCodeInlineResponse"; -export * from "./Scripts"; -export * from "./CustomCodeBlockType"; -export * from "./CustomCodeBlock"; -export * from "./ListCustomCodeBlocks"; -export * from "./AssetVariant"; -export * from "./Asset"; -export * from "./Assets"; -export * from "./AssetUploadUploadDetails"; -export * from "./AssetUpload"; -export * from "./AssetFolder"; -export * from "./AssetFolderList"; -export * from "./TriggerType"; -export * from "./WebhookFilter"; -export * from "./Webhook"; -export * from "./WebhookList"; -export * from "./FormFieldValueType"; -export * from "./FormFieldValue"; -export * from "./FormField"; -export * from "./FormResponseSettings"; +export * from "./CustomRole"; +export * from "./CustomRoleAuditLogItem"; +export * from "./CustomRoleAuditLogItemEventSubType"; +export * from "./Dom"; +export * from "./Domain"; +export * from "./Domains"; +export * from "./DuplicateUserEmail"; +export * from "./EcommerceSettings"; +export * from "./Error_"; +export * from "./ErrorCode"; +export * from "./Field"; +export * from "./FieldCreate"; +export * from "./FieldType"; +export * from "./FieldValidations"; +export * from "./FieldValidationsAdditionalProperties"; +export * from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; +export * from "./ForbiddenErrorBody"; export * from "./Form"; +export * from "./FormField"; +export * from "./FormFieldValue"; +export * from "./FormFieldValueType"; export * from "./FormList"; +export * from "./FormResponseSettings"; export * from "./FormSubmission"; export * from "./FormSubmissionList"; -export * from "./UserStatus"; -export * from "./UserAccessGroupsItemType"; -export * from "./UserAccessGroupsItem"; -export * from "./UserDataData"; -export * from "./UserData"; -export * from "./User"; -export * from "./UserList"; -export * from "./UsersNotEnabled"; -export * from "./DuplicateUserEmail"; -export * from "./UserLimitReached"; -export * from "./AccessGroup"; -export * from "./AccessGroupList"; -export * from "./SkuPropertyListEnumItem"; -export * from "./SkuPropertyList"; -export * from "./ProductFieldDataTaxCategory"; -export * from "./ProductFieldDataEcProductType"; -export * from "./ProductFieldData"; +export * from "./FormSubmissionTrigger"; +export * from "./FormSubmissionTriggerPayload"; +export * from "./FormSubmissionTriggerPayloadSchemaItem"; +export * from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; +export * from "./ImageNode"; +export * from "./ImageNodeImage"; +export * from "./InvalidDomain"; +export * from "./InvalidScopes"; +export * from "./InventoryItem"; +export * from "./InventoryItemInventoryType"; +export * from "./ItemsListItemsLiveRequestLastPublished"; +export * from "./ItemsListItemsRequestLastPublished"; +export * from "./ListCustomCodeBlocks"; +export * from "./Locale"; +export * from "./Locales"; +export * from "./Metadata"; +export * from "./MetadataOptionsItem"; +export * from "./NewOrder"; +export * from "./NoDomains"; +export * from "./Node"; +export * from "./NotEnterprisePlanSite"; +export * from "./NotEnterprisePlanWorkspace"; +export * from "./OptionField"; +export * from "./Order"; +export * from "./OrderAddress"; +export * from "./OrderAddressJapanType"; +export * from "./OrderAddressType"; +export * from "./OrderBillingAddress"; +export * from "./OrderBillingAddressJapanType"; +export * from "./OrderBillingAddressType"; +export * from "./OrderCustomerInfo"; +export * from "./OrderDisputeLastStatus"; +export * from "./OrderDownloadFilesItem"; +export * from "./OrderList"; +export * from "./OrderMetadata"; +export * from "./OrderPrice"; +export * from "./OrderPurchasedItem"; +export * from "./OrderPurchasedItemVariantImage"; +export * from "./OrderPurchasedItemVariantImageFile"; +export * from "./OrderPurchasedItemVariantImageFileVariantsItem"; +export * from "./OrderShippingAddress"; +export * from "./OrderShippingAddressJapanType"; +export * from "./OrderShippingAddressType"; +export * from "./OrderStatus"; +export * from "./OrderTotals"; +export * from "./OrderTotalsExtrasItem"; +export * from "./OrderTotalsExtrasItemType"; +export * from "./Page"; +export * from "./PageCreatedWebhook"; +export * from "./PageCreatedWebhookPayload"; +export * from "./PageDeletedWebhook"; +export * from "./PageDeletedWebhookPayload"; +export * from "./PageList"; +export * from "./PageMetadataUpdatedWebhook"; +export * from "./PageMetadataUpdatedWebhookPayload"; +export * from "./PageOpenGraph"; +export * from "./PageSeo"; +export * from "./Pagination"; +export * from "./Payload"; +export * from "./PayloadFieldData"; +export * from "./PaypalDetails"; export * from "./Product"; -export * from "./SkuValueList"; -export * from "./SkuFieldDataPrice"; +export * from "./ProductAndSkUs"; +export * from "./ProductAndSkUsList"; +export * from "./ProductFieldData"; +export * from "./ProductFieldDataEcProductType"; +export * from "./ProductFieldDataTaxCategory"; +export * from "./PublishStatus"; +export * from "./Redirect"; +export * from "./Redirects"; +export * from "./ReferenceField"; +export * from "./ReferenceFieldMetadata"; +export * from "./ReferenceFieldType"; +export * from "./RegisteredScriptList"; +export * from "./Robots"; +export * from "./RobotsRulesItem"; +export * from "./ScriptApply"; +export * from "./ScriptApplyList"; +export * from "./ScriptApplyLocation"; +export * from "./Scripts"; +export * from "./SearchButtonNode"; +export * from "./SearchButtonNodeWrite"; +export * from "./Select"; +export * from "./SelectNode"; +export * from "./SelectNodeChoicesItem"; +export * from "./SelectNodeWriteChoicesItem"; +export * from "./SingleLocaleCreatedPayload"; +export * from "./SingleLocaleCreatedPayloadFieldData"; +export * from "./Site"; +export * from "./SiteActivityLogItem"; +export * from "./SiteActivityLogItemEvent"; +export * from "./SiteActivityLogItemResourceOperation"; +export * from "./SiteActivityLogItemUser"; +export * from "./SiteActivityLogResponse"; +export * from "./SiteDataCollectionType"; +export * from "./SiteMembership"; +export * from "./SiteMembershipAuditLogItem"; +export * from "./SiteMembershipAuditLogItemEventSubType"; +export * from "./SitePlan"; +export * from "./SitePlanId"; +export * from "./SitePlanName"; +export * from "./SitePublish"; +export * from "./SitePublishPayload"; +export * from "./Sites"; +export * from "./Sku"; +export * from "./SkuFieldData"; export * from "./SkuFieldDataCompareAtPrice"; export * from "./SkuFieldDataEcSkuBillingMethod"; +export * from "./SkuFieldDataEcSkuSubscriptionPlan"; export * from "./SkuFieldDataEcSkuSubscriptionPlanInterval"; -export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus"; export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItem"; -export * from "./SkuFieldDataEcSkuSubscriptionPlan"; -export * from "./SkuFieldData"; -export * from "./Sku"; -export * from "./ProductAndSkUs"; -export * from "./ProductAndSkUsList"; -export * from "./PublishStatus"; -export * from "./OrderPrice"; -export * from "./OrderAddressType"; -export * from "./OrderAddressJapanType"; -export * from "./OrderAddress"; -export * from "./OrderPurchasedItemVariantImageFileVariantsItem"; -export * from "./OrderPurchasedItemVariantImageFile"; -export * from "./OrderPurchasedItemVariantImage"; -export * from "./OrderPurchasedItem"; -export * from "./StripeDetails"; +export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus"; +export * from "./SkuFieldDataPrice"; +export * from "./SkuPropertyList"; +export * from "./SkuPropertyListEnumItem"; +export * from "./SkuValueList"; +export * from "./StaticField"; +export * from "./StaticFieldType"; +export * from "./StripeCard"; export * from "./StripeCardBrand"; export * from "./StripeCardExpires"; -export * from "./StripeCard"; -export * from "./PaypalDetails"; -export * from "./OrderStatus"; -export * from "./OrderDisputeLastStatus"; -export * from "./OrderShippingAddressType"; -export * from "./OrderShippingAddressJapanType"; -export * from "./OrderShippingAddress"; -export * from "./OrderBillingAddressType"; -export * from "./OrderBillingAddressJapanType"; -export * from "./OrderBillingAddress"; -export * from "./OrderCustomerInfo"; -export * from "./OrderMetadata"; -export * from "./OrderTotalsExtrasItemType"; -export * from "./OrderTotalsExtrasItem"; -export * from "./OrderTotals"; -export * from "./OrderDownloadFilesItem"; -export * from "./Order"; -export * from "./OrderList"; -export * from "./InventoryItemInventoryType"; -export * from "./InventoryItem"; -export * from "./EcommerceSettings"; -export * from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; -export * from "./FormSubmissionTriggerPayloadSchemaItem"; -export * from "./FormSubmissionTriggerPayload"; -export * from "./FormSubmissionTrigger"; -export * from "./SitePublishPayload"; -export * from "./SitePublish"; -export * from "./NewOrder"; +export * from "./StripeDetails"; +export * from "./SubmitButtonNode"; +export * from "./SubmitButtonNodeWrite"; +export * from "./Text"; +export * from "./TextInputNode"; +export * from "./TextInputNodeWrite"; +export * from "./TextNode"; +export * from "./TextNodeText"; +export * from "./TextNodeWrite"; +export * from "./TriggerType"; export * from "./UpdatedOrder"; -export * from "./SingleLocaleCreatedPayloadFieldData"; -export * from "./SingleLocaleCreatedPayload"; -export * from "./CollectionItemCreated"; -export * from "./CollectionItemChanged"; -export * from "./CollectionItemRemovedPayloadFieldData"; -export * from "./CollectionItemRemovedPayload"; -export * from "./CollectionItemRemoved"; -export * from "./PayloadFieldData"; -export * from "./Payload"; -export * from "./CollectionItemPublished"; -export * from "./CollectionItemUnpublishedPayloadFieldData"; -export * from "./CollectionItemUnpublishedPayload"; -export * from "./CollectionItemUnpublished"; -export * from "./PageCreatedWebhookPayload"; -export * from "./PageCreatedWebhook"; -export * from "./PageMetadataUpdatedWebhookPayload"; -export * from "./PageMetadataUpdatedWebhook"; -export * from "./PageDeletedWebhookPayload"; -export * from "./PageDeletedWebhook"; -export * from "./CommentPayloadAuthor"; -export * from "./CommentPayloadMentionedUsersItem"; -export * from "./CommentPayload"; -export * from "./Comment"; +export * from "./User"; +export * from "./UserAccess"; +export * from "./UserAccessAuditLogItem"; +export * from "./UserAccessAuditLogItemEventSubType"; +export * from "./UserAccessGroupsItem"; +export * from "./UserAccessGroupsItemType"; +export * from "./UserData"; +export * from "./UserDataData"; +export * from "./UserLimitReached"; +export * from "./UserList"; +export * from "./UserStatus"; +export * from "./UsersNotEnabled"; +export * from "./Webhook"; +export * from "./WebhookFilter"; +export * from "./WebhookList"; +export * from "./WorkspaceAuditLogItem"; +export * from "./WorkspaceAuditLogItemActor"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; +export * from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; +export * from "./WorkspaceAuditLogItemWorkspace"; +export * from "./WorkspaceAuditLogResponse"; +export * from "./WorkspaceInvitation"; +export * from "./WorkspaceInvitationAuditLogItem"; +export * from "./WorkspaceInvitationAuditLogItemEventSubType"; +export * from "./WorkspaceMembership"; +export * from "./WorkspaceMembershipAuditLogItem"; +export * from "./WorkspaceMembershipAuditLogItemEventSubType"; diff --git a/src/core/auth/AuthProvider.ts b/src/core/auth/AuthProvider.ts new file mode 100644 index 00000000..ed076ec5 --- /dev/null +++ b/src/core/auth/AuthProvider.ts @@ -0,0 +1,5 @@ +import type { AuthRequest } from "./AuthRequest"; + +export interface AuthProvider { + getAuthRequest(): Promise; +} diff --git a/src/core/auth/AuthRequest.ts b/src/core/auth/AuthRequest.ts new file mode 100644 index 00000000..f6218b42 --- /dev/null +++ b/src/core/auth/AuthRequest.ts @@ -0,0 +1,9 @@ +/** + * Request parameters for authentication requests. + */ +export interface AuthRequest { + /** + * The headers to be included in the request. + */ + headers: Record; +} diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts index 146df215..c6efa5e2 100644 --- a/src/core/auth/BasicAuth.ts +++ b/src/core/auth/BasicAuth.ts @@ -1,4 +1,4 @@ -import { Base64 } from "js-base64"; +import { base64Decode, base64Encode } from "../base64"; export interface BasicAuth { username: string; @@ -12,13 +12,14 @@ export const BasicAuth = { if (basicAuth == null) { return undefined; } - const token = Base64.encode(`${basicAuth.username}:${basicAuth.password}`); + const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`); return `Basic ${token}`; }, fromAuthorizationHeader: (header: string): BasicAuth => { const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, ""); - const decoded = Base64.decode(credentials); - const [username, password] = decoded.split(":", 2); + const decoded = base64Decode(credentials); + const [username, ...passwordParts] = decoded.split(":"); + const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined; if (username == null || password == null) { throw new Error("Invalid basic auth"); diff --git a/src/core/auth/index.ts b/src/core/auth/index.ts index ee293b34..c7786e5b 100644 --- a/src/core/auth/index.ts +++ b/src/core/auth/index.ts @@ -1,2 +1,4 @@ +export type { AuthProvider } from "./AuthProvider"; +export type { AuthRequest } from "./AuthRequest"; export { BasicAuth } from "./BasicAuth"; export { BearerToken } from "./BearerToken"; diff --git a/src/core/base64.ts b/src/core/base64.ts new file mode 100644 index 00000000..448a0db6 --- /dev/null +++ b/src/core/base64.ts @@ -0,0 +1,27 @@ +function base64ToBytes(base64: string): Uint8Array { + const binString = atob(base64); + return Uint8Array.from(binString, (m) => m.codePointAt(0)!); +} + +function bytesToBase64(bytes: Uint8Array): string { + const binString = String.fromCodePoint(...bytes); + return btoa(binString); +} + +export function base64Encode(input: string): string { + if (typeof Buffer !== "undefined") { + return Buffer.from(input, "utf8").toString("base64"); + } + + const bytes = new TextEncoder().encode(input); + return bytesToBase64(bytes); +} + +export function base64Decode(input: string): string { + if (typeof Buffer !== "undefined") { + return Buffer.from(input, "base64").toString("utf8"); + } + + const bytes = base64ToBytes(input); + return new TextDecoder().decode(bytes); +} diff --git a/src/core/fetcher/APIResponse.ts b/src/core/fetcher/APIResponse.ts index 6335291b..b703b0a4 100644 --- a/src/core/fetcher/APIResponse.ts +++ b/src/core/fetcher/APIResponse.ts @@ -1,4 +1,4 @@ -import { RawResponse } from "./RawResponse"; +import type { RawResponse } from "./RawResponse"; /** * The response of an API call. diff --git a/src/core/fetcher/BinaryResponse.ts b/src/core/fetcher/BinaryResponse.ts new file mode 100644 index 00000000..4b4d0e89 --- /dev/null +++ b/src/core/fetcher/BinaryResponse.ts @@ -0,0 +1,36 @@ +import type { ResponseWithBody } from "./ResponseWithBody.js"; + +export type BinaryResponse = { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ + bodyUsed: boolean; + /** + * Returns a ReadableStream of the response body. + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) + */ + stream: () => ReadableStream; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */ + arrayBuffer: () => Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ + blob: () => Promise; + /** + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) + * Some versions of the Fetch API may not support this method. + */ + bytes?(): Promise; +}; + +export function getBinaryResponse(response: ResponseWithBody): BinaryResponse { + const binaryResponse: BinaryResponse = { + get bodyUsed() { + return response.bodyUsed; + }, + stream: () => response.body, + arrayBuffer: response.arrayBuffer.bind(response), + blob: response.blob.bind(response), + }; + if ("bytes" in response && typeof response.bytes === "function") { + binaryResponse.bytes = response.bytes.bind(response); + } + + return binaryResponse; +} diff --git a/src/core/fetcher/EndpointMetadata.ts b/src/core/fetcher/EndpointMetadata.ts new file mode 100644 index 00000000..998d68f5 --- /dev/null +++ b/src/core/fetcher/EndpointMetadata.ts @@ -0,0 +1,13 @@ +export type SecuritySchemeKey = string; +/** + * A collection of security schemes, where the key is the name of the security scheme and the value is the list of scopes required for that scheme. + * All schemes in the collection must be satisfied for authentication to be successful. + */ +export type SecuritySchemeCollection = Record; +export type AuthScope = string; +export type EndpointMetadata = { + /** + * An array of security scheme collections. Each collection represents an alternative way to authenticate. + */ + security?: SecuritySchemeCollection[]; +}; diff --git a/src/core/fetcher/EndpointSupplier.ts b/src/core/fetcher/EndpointSupplier.ts new file mode 100644 index 00000000..f4a99783 --- /dev/null +++ b/src/core/fetcher/EndpointSupplier.ts @@ -0,0 +1,14 @@ +import type { EndpointMetadata } from "./EndpointMetadata"; +import type { Supplier } from "./Supplier"; + +type EndpointSupplierFn = (arg: { endpointMetadata: EndpointMetadata }) => T | Promise; +export type EndpointSupplier = Supplier | EndpointSupplierFn; +export const EndpointSupplier = { + get: async (supplier: EndpointSupplier, arg: { endpointMetadata: EndpointMetadata }): Promise => { + if (typeof supplier === "function") { + return (supplier as EndpointSupplierFn)(arg); + } else { + return supplier; + } + }, +}; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index ccc16a26..6c610724 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -1,12 +1,14 @@ import { toJson } from "../json"; -import { APIResponse } from "./APIResponse"; -import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; -import { Supplier } from "./Supplier"; +import type { APIResponse } from "./APIResponse"; import { createRequestUrl } from "./createRequestUrl"; +import type { EndpointMetadata } from "./EndpointMetadata"; +import { EndpointSupplier } from "./EndpointSupplier"; +import { getErrorResponseBody } from "./getErrorResponseBody"; import { getFetchFn } from "./getFetchFn"; import { getRequestBody } from "./getRequestBody"; import { getResponseBody } from "./getResponseBody"; import { makeRequest } from "./makeRequest"; +import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; import { requestWithRetries } from "./requestWithRetries"; export type FetchFunction = (args: Fetcher.Args) => Promise>; @@ -16,16 +18,17 @@ export declare namespace Fetcher { url: string; method: string; contentType?: string; - headers?: Record | undefined>; - queryParameters?: Record; + headers?: Record | null | undefined>; + queryParameters?: Record; body?: unknown; timeoutMs?: number; maxRetries?: number; withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response"; duplex?: "half"; + endpointMetadata?: EndpointMetadata; } export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; @@ -63,7 +66,7 @@ async function getHeaders(args: Fetcher.Args): Promise> { } for (const [key, value] of Object.entries(args.headers)) { - const result = await Supplier.get(value); + const result = await EndpointSupplier.get(value, { endpointMetadata: args.endpointMetadata ?? {} }); if (typeof result === "string") { newHeaders[key] = result; continue; @@ -100,12 +103,11 @@ export async function fetcherImpl(args: Fetcher.Args): Promise= 200 && response.status < 400) { return { ok: true, - body: responseBody as R, + body: (await getResponseBody(response, args.responseType)) as R, headers: response.headers, rawResponse: toRawResponse(response), }; @@ -115,13 +117,13 @@ export async function fetcherImpl(args: Fetcher.Args): Promise; +}; + +export function isResponseWithBody(response: Response): response is ResponseWithBody { + return (response as ResponseWithBody).body != null; +} diff --git a/src/core/fetcher/createRequestUrl.ts b/src/core/fetcher/createRequestUrl.ts index f1157ce7..4bcb1985 100644 --- a/src/core/fetcher/createRequestUrl.ts +++ b/src/core/fetcher/createRequestUrl.ts @@ -1,10 +1,6 @@ -import qs from "qs"; +import { toQueryString } from "../url/qs"; -export function createRequestUrl( - baseUrl: string, - queryParameters?: Record, -): string { - return Object.keys(queryParameters ?? {}).length > 0 - ? `${baseUrl}?${qs.stringify(queryParameters, { arrayFormat: "repeat" })}` - : baseUrl; +export function createRequestUrl(baseUrl: string, queryParameters?: Record): string { + const queryString = toQueryString(queryParameters, { arrayFormat: "repeat" }); + return queryString ? `${baseUrl}?${queryString}` : baseUrl; } diff --git a/src/core/fetcher/getErrorResponseBody.ts b/src/core/fetcher/getErrorResponseBody.ts new file mode 100644 index 00000000..34f0047a --- /dev/null +++ b/src/core/fetcher/getErrorResponseBody.ts @@ -0,0 +1,33 @@ +import { fromJson } from "../json"; +import { getResponseBody } from "./getResponseBody"; + +export async function getErrorResponseBody(response: Response): Promise { + let contentType = response.headers.get("Content-Type")?.toLowerCase(); + if (contentType == null || contentType.length === 0) { + return getResponseBody(response); + } + + if (contentType.indexOf(";") !== -1) { + contentType = contentType.split(";")[0]?.trim() ?? ""; + } + switch (contentType) { + case "application/hal+json": + case "application/json": + case "application/ld+json": + case "application/problem+json": + case "application/vnd.api+json": + case "text/json": { + const text = await response.text(); + return text.length > 0 ? fromJson(text) : undefined; + } + default: + if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) { + const text = await response.text(); + return text.length > 0 ? fromJson(text) : undefined; + } + + // Fallback to plain text if content type is not recognized + // Even if no body is present, the response will be an empty string + return await response.text(); + } +} diff --git a/src/core/fetcher/getFetchFn.ts b/src/core/fetcher/getFetchFn.ts index 9fd9bfc4..0900cab1 100644 --- a/src/core/fetcher/getFetchFn.ts +++ b/src/core/fetcher/getFetchFn.ts @@ -1,4 +1,4 @@ -import { RUNTIME } from "../runtime"; +import { RUNTIME } from "../runtime/index"; /** * Returns a fetch function based on the runtime @@ -16,7 +16,7 @@ export async function getFetchFn(): Promise { // Otherwise the SDK uses global fetch if available, // and falls back to node-fetch. - if (typeof fetch == "function") { + if (typeof fetch === "function") { return fetch; } diff --git a/src/core/fetcher/getResponseBody.ts b/src/core/fetcher/getResponseBody.ts index d046e6ea..c103c6aa 100644 --- a/src/core/fetcher/getResponseBody.ts +++ b/src/core/fetcher/getResponseBody.ts @@ -1,34 +1,45 @@ +import { fromJson } from "../json"; +import { getBinaryResponse } from "./BinaryResponse"; +import { isResponseWithBody } from "./ResponseWithBody"; + import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { - if (response.body != null && responseType === "blob") { - return await response.blob(); - } else if (response.body != null && responseType === "arrayBuffer") { - return await response.arrayBuffer(); - } else if (response.body != null && responseType === "sse") { - return response.body; - } else if (response.body != null && responseType === "streaming") { - return chooseStreamWrapper(response.body); - } else if (response.body != null && responseType === "text") { - return await response.text(); - } else { - const text = await response.text(); - if (text.length > 0) { - try { - let responseBody = JSON.parse(text); - return responseBody; - } catch (err) { - return { - ok: false, - error: { - reason: "non-json", - statusCode: response.status, - rawBody: text, - }, - }; - } - } else { - return undefined; + if (!isResponseWithBody(response)) { + return undefined; + } + switch (responseType) { + case "binary-response": + return getBinaryResponse(response); + case "blob": + return await response.blob(); + case "arrayBuffer": + return await response.arrayBuffer(); + case "sse": + return response.body; + case "streaming": + return chooseStreamWrapper(response.body); + + case "text": + return await response.text(); + } + + // if responseType is "json" or not specified, try to parse as JSON + const text = await response.text(); + if (text.length > 0) { + try { + const responseBody = fromJson(text); + return responseBody; + } catch (_err) { + return { + ok: false, + error: { + reason: "non-json", + statusCode: response.status, + rawBody: text, + }, + }; } } + return undefined; } diff --git a/src/core/fetcher/index.ts b/src/core/fetcher/index.ts index 249f5176..2f32091e 100644 --- a/src/core/fetcher/index.ts +++ b/src/core/fetcher/index.ts @@ -1,8 +1,11 @@ export type { APIResponse } from "./APIResponse"; -export { fetcher } from "./Fetcher"; +export type { BinaryResponse } from "./BinaryResponse"; +export type { EndpointMetadata } from "./EndpointMetadata"; +export { EndpointSupplier } from "./EndpointSupplier"; export type { Fetcher, FetchFunction } from "./Fetcher"; +export { fetcher } from "./Fetcher"; export { getHeader } from "./getHeader"; -export { Supplier } from "./Supplier"; -export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; -export type { RawResponse, WithRawResponse } from "./RawResponse"; export { HttpResponsePromise } from "./HttpResponsePromise"; +export type { RawResponse, WithRawResponse } from "./RawResponse"; +export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; +export { Supplier } from "./Supplier"; diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts index 1af42bb9..8788d1bb 100644 --- a/src/core/fetcher/makeRequest.ts +++ b/src/core/fetcher/makeRequest.ts @@ -14,7 +14,7 @@ export const makeRequest = async ( const signals: AbortSignal[] = []; // Add timeout signal - let timeoutAbortId: NodeJS.Timeout | undefined = undefined; + let timeoutAbortId: NodeJS.Timeout | undefined; if (timeoutMs != null) { const { signal, abortId } = getTimeoutSignal(timeoutMs); timeoutAbortId = abortId; @@ -25,7 +25,7 @@ export const makeRequest = async ( if (abortSignal != null) { signals.push(abortSignal); } - let newSignals = anySignal(signals); + const newSignals = anySignal(signals); const response = await fetchFn(url, { method: method, headers, diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index add3cce0..3d30bd1c 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -3,12 +3,55 @@ const MAX_RETRY_DELAY = 60000; // in milliseconds const DEFAULT_MAX_RETRIES = 2; const JITTER_FACTOR = 0.2; // 20% random jitter -function addJitter(delay: number): number { - // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR - const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR; +function addPositiveJitter(delay: number): number { + // Generate a random value between 0 and +JITTER_FACTOR + const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; return delay * jitterMultiplier; } +function addSymmetricJitter(delay: number): number { + // Generate a random value in a JITTER_FACTOR-sized percentage range around delay + const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR; + return delay * jitterMultiplier; +} + +function getRetryDelayFromHeaders(response: Response, retryAttempt: number): number { + // Check for Retry-After header first (RFC 7231), with no jitter + const retryAfter = response.headers.get("Retry-After"); + if (retryAfter) { + // Parse as number of seconds... + const retryAfterSeconds = parseInt(retryAfter, 10); + if (!Number.isNaN(retryAfterSeconds) && retryAfterSeconds > 0) { + return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY); + } + + // ...or as an HTTP date; both are valid + const retryAfterDate = new Date(retryAfter); + if (!Number.isNaN(retryAfterDate.getTime())) { + const delay = retryAfterDate.getTime() - Date.now(); + if (delay > 0) { + return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); + } + } + } + + // Then check for industry-standard X-RateLimit-Reset header, with positive jitter + const rateLimitReset = response.headers.get("X-RateLimit-Reset"); + if (rateLimitReset) { + const resetTime = parseInt(rateLimitReset, 10); + if (!Number.isNaN(resetTime)) { + // Assume Unix timestamp in epoch seconds + const delay = resetTime * 1000 - Date.now(); + if (delay > 0) { + return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); + } + } + } + + // Fall back to exponential backoff, with symmetric jitter + return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * 2 ** retryAttempt, MAX_RETRY_DELAY)); +} + export async function requestWithRetries( requestFn: () => Promise, maxRetries: number = DEFAULT_MAX_RETRIES, @@ -17,13 +60,10 @@ export async function requestWithRetries( for (let i = 0; i < maxRetries; ++i) { if ([408, 429].includes(response.status) || response.status >= 500) { - // Calculate base delay using exponential backoff (in milliseconds) - const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY); - - // Add jitter to the delay - const delayWithJitter = addJitter(baseDelay); + // Get delay with appropriate jitter applied + const delay = getRetryDelayFromHeaders(response, i); - await new Promise((resolve) => setTimeout(resolve, delayWithJitter)); + await new Promise((resolve) => setTimeout(resolve, delay)); response = await requestFn(); } else { break; diff --git a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7d83aef2..aae72d2f 100644 --- a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -1,13 +1,11 @@ import type { Writable } from "readable-stream"; -import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; +import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; -export class Node18UniversalStreamWrapper< - ReadFormat extends Uint8Array | Uint16Array | Uint32Array, -> implements StreamWrapper< - Node18UniversalStreamWrapper | Writable | WritableStream, - ReadFormat -> { +export class Node18UniversalStreamWrapper + implements + StreamWrapper | Writable | WritableStream, ReadFormat> +{ private readableStream: ReadableStream; private reader: ReadableStreamDefaultReader; private events: Record; diff --git a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts index 23c01a1a..e0896d9c 100644 --- a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts @@ -1,6 +1,6 @@ import type { Readable, Writable } from "readable-stream"; -import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; +import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; export class NodePre18StreamWrapper implements StreamWrapper { private readableStream: Readable; diff --git a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index e5e8b680..262ac130 100644 --- a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -1,11 +1,10 @@ -import { StreamWrapper } from "./chooseStreamWrapper"; +import type { StreamWrapper } from "./chooseStreamWrapper"; type EventCallback = (data?: any) => void; -export class UndiciStreamWrapper implements StreamWrapper< - UndiciStreamWrapper | WritableStream, - ReadFormat -> { +export class UndiciStreamWrapper + implements StreamWrapper | WritableStream, ReadFormat> +{ private readableStream: ReadableStream; private reader: ReadableStreamDefaultReader; private events: Record; diff --git a/src/core/headers.ts b/src/core/headers.ts index 561314d2..a723d228 100644 --- a/src/core/headers.ts +++ b/src/core/headers.ts @@ -1,9 +1,7 @@ -import * as core from "./index.js"; - -export function mergeHeaders( - ...headersArray: (Record | undefined> | undefined)[] -): Record> { - const result: Record> = {}; +export function mergeHeaders( + ...headersArray: (Record | null | undefined)[] +): Record { + const result: Record = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) @@ -18,10 +16,10 @@ export function mergeHeaders( return result; } -export function mergeOnlyDefinedHeaders( - ...headersArray: (Record | undefined> | undefined)[] -): Record> { - const result: Record> = {}; +export function mergeOnlyDefinedHeaders( + ...headersArray: (Record | null | undefined)[] +): Record { + const result: Record = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) diff --git a/src/core/index.ts b/src/core/index.ts index 53948f45..b2fa80b1 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1,4 +1,6 @@ +export * from "./auth"; +export * from "./base64"; export * from "./fetcher"; export * from "./runtime"; -export * from "./auth"; export * as serialization from "./schemas"; +export * as url from "./url"; diff --git a/src/core/schemas/Schema.ts b/src/core/schemas/Schema.ts index 921a1546..57b782b0 100644 --- a/src/core/schemas/Schema.ts +++ b/src/core/schemas/Schema.ts @@ -1,4 +1,4 @@ -import { SchemaUtils } from "./builders"; +import type { SchemaUtils } from "./builders/index"; export type Schema = BaseSchema & SchemaUtils; diff --git a/src/core/schemas/builders/bigint/bigint.ts b/src/core/schemas/builders/bigint/bigint.ts index e69bb791..9d8a63d4 100644 --- a/src/core/schemas/builders/bigint/bigint.ts +++ b/src/core/schemas/builders/bigint/bigint.ts @@ -1,7 +1,7 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; +import { getSchemaUtils } from "../schema-utils/index"; export function bigint(): Schema { const baseSchema: BaseSchema = { diff --git a/src/core/schemas/builders/date/date.ts b/src/core/schemas/builders/date/date.ts index b70f24b0..bc507e08 100644 --- a/src/core/schemas/builders/date/date.ts +++ b/src/core/schemas/builders/date/date.ts @@ -1,7 +1,7 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; +import { getSchemaUtils } from "../schema-utils/index"; // https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime const ISO_8601_REGEX = diff --git a/src/core/schemas/builders/enum/enum.ts b/src/core/schemas/builders/enum/enum.ts index 69aced6b..c2c49a32 100644 --- a/src/core/schemas/builders/enum/enum.ts +++ b/src/core/schemas/builders/enum/enum.ts @@ -1,4 +1,4 @@ -import { Schema, SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/index.ts b/src/core/schemas/builders/index.ts index 65211f92..be23de25 100644 --- a/src/core/schemas/builders/index.ts +++ b/src/core/schemas/builders/index.ts @@ -1,14 +1,14 @@ -export * from "./bigint"; -export * from "./date"; -export * from "./enum"; -export * from "./lazy"; -export * from "./list"; -export * from "./literals"; -export * from "./object"; -export * from "./object-like"; -export * from "./primitives"; -export * from "./record"; -export * from "./schema-utils"; -export * from "./set"; -export * from "./undiscriminated-union"; -export * from "./union"; +export * from "./bigint/index"; +export * from "./date/index"; +export * from "./enum/index"; +export * from "./lazy/index"; +export * from "./list/index"; +export * from "./literals/index"; +export * from "./object/index"; +export * from "./object-like/index"; +export * from "./primitives/index"; +export * from "./record/index"; +export * from "./schema-utils/index"; +export * from "./set/index"; +export * from "./undiscriminated-union/index"; +export * from "./union/index"; diff --git a/src/core/schemas/builders/lazy/index.ts b/src/core/schemas/builders/lazy/index.ts index 77420fb0..2221abd8 100644 --- a/src/core/schemas/builders/lazy/index.ts +++ b/src/core/schemas/builders/lazy/index.ts @@ -1,3 +1,3 @@ -export { lazy } from "./lazy"; export type { SchemaGetter } from "./lazy"; +export { lazy } from "./lazy"; export { lazyObject } from "./lazyObject"; diff --git a/src/core/schemas/builders/lazy/lazy.ts b/src/core/schemas/builders/lazy/lazy.ts index 2962bdfe..a7273518 100644 --- a/src/core/schemas/builders/lazy/lazy.ts +++ b/src/core/schemas/builders/lazy/lazy.ts @@ -1,5 +1,5 @@ -import { BaseSchema, Schema } from "../../Schema"; -import { getSchemaUtils } from "../schema-utils"; +import type { BaseSchema, Schema } from "../../Schema"; +import { getSchemaUtils } from "../schema-utils/index"; export type SchemaGetter> = () => SchemaType; diff --git a/src/core/schemas/builders/lazy/lazyObject.ts b/src/core/schemas/builders/lazy/lazyObject.ts index d8ee6ec5..2a58a2ab 100644 --- a/src/core/schemas/builders/lazy/lazyObject.ts +++ b/src/core/schemas/builders/lazy/lazyObject.ts @@ -1,8 +1,8 @@ -import { getObjectUtils } from "../object"; -import { getObjectLikeUtils } from "../object-like"; -import { BaseObjectSchema, ObjectSchema } from "../object/types"; -import { getSchemaUtils } from "../schema-utils"; -import { SchemaGetter, constructLazyBaseSchema, getMemoizedSchema } from "./lazy"; +import { getObjectUtils } from "../object/index"; +import type { BaseObjectSchema, ObjectSchema } from "../object/types"; +import { getObjectLikeUtils } from "../object-like/index"; +import { getSchemaUtils } from "../schema-utils/index"; +import { constructLazyBaseSchema, getMemoizedSchema, type SchemaGetter } from "./lazy"; export function lazyObject(getter: SchemaGetter>): ObjectSchema { const baseSchema: BaseObjectSchema = { diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts index a6167a5b..7c8fd6e8 100644 --- a/src/core/schemas/builders/list/list.ts +++ b/src/core/schemas/builders/list/list.ts @@ -1,7 +1,7 @@ -import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { type BaseSchema, type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; +import { getSchemaUtils } from "../schema-utils/index"; export function list(schema: Schema): Schema { const baseSchema: BaseSchema = { diff --git a/src/core/schemas/builders/literals/booleanLiteral.ts b/src/core/schemas/builders/literals/booleanLiteral.ts index 5c004133..fb06cc00 100644 --- a/src/core/schemas/builders/literals/booleanLiteral.ts +++ b/src/core/schemas/builders/literals/booleanLiteral.ts @@ -1,4 +1,4 @@ -import { Schema, SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/literals/index.ts b/src/core/schemas/builders/literals/index.ts index d2bf08fc..ae738906 100644 --- a/src/core/schemas/builders/literals/index.ts +++ b/src/core/schemas/builders/literals/index.ts @@ -1,2 +1,2 @@ -export { stringLiteral } from "./stringLiteral"; export { booleanLiteral } from "./booleanLiteral"; +export { stringLiteral } from "./stringLiteral"; diff --git a/src/core/schemas/builders/literals/stringLiteral.ts b/src/core/schemas/builders/literals/stringLiteral.ts index 334bbdc4..98fe0622 100644 --- a/src/core/schemas/builders/literals/stringLiteral.ts +++ b/src/core/schemas/builders/literals/stringLiteral.ts @@ -1,4 +1,4 @@ -import { Schema, SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts index 8885586e..ed96cf77 100644 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -1,9 +1,9 @@ -import { BaseSchema } from "../../Schema"; +import type { BaseSchema } from "../../Schema"; import { filterObject } from "../../utils/filterObject"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; -import { getSchemaUtils } from "../schema-utils"; -import { ObjectLikeSchema, ObjectLikeUtils } from "./types"; +import { getSchemaUtils } from "../schema-utils/index"; +import type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { return { diff --git a/src/core/schemas/builders/object-like/types.ts b/src/core/schemas/builders/object-like/types.ts index 75b36987..a8401d7c 100644 --- a/src/core/schemas/builders/object-like/types.ts +++ b/src/core/schemas/builders/object-like/types.ts @@ -1,11 +1,13 @@ -import { BaseSchema, Schema } from "../../Schema"; +import type { BaseSchema, Schema } from "../../Schema"; export type ObjectLikeSchema = Schema & BaseSchema & ObjectLikeUtils; export interface ObjectLikeUtils { - withParsedProperties: >(properties: { - [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); - }) => ObjectLikeSchema; + withParsedProperties: >( + properties: { + [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); + }, + ) => ObjectLikeSchema; } diff --git a/src/core/schemas/builders/object/index.ts b/src/core/schemas/builders/object/index.ts index e3f4388d..58ce0b48 100644 --- a/src/core/schemas/builders/object/index.ts +++ b/src/core/schemas/builders/object/index.ts @@ -1,11 +1,11 @@ export { getObjectUtils, object } from "./object"; -export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; export type { inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, } from "./objectWithoutOptionalProperties"; -export { isProperty, property } from "./property"; +export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; export type { Property } from "./property"; +export { isProperty, property } from "./property"; export type { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts index 05fbca8a..c239249e 100644 --- a/src/core/schemas/builders/object/object.ts +++ b/src/core/schemas/builders/object/object.ts @@ -1,4 +1,4 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; import { entries } from "../../utils/entries"; import { filterObject } from "../../utils/filterObject"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; @@ -6,17 +6,17 @@ import { isPlainObject } from "../../utils/isPlainObject"; import { keys } from "../../utils/keys"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; import { partition } from "../../utils/partition"; -import { getObjectLikeUtils } from "../object-like"; -import { getSchemaUtils } from "../schema-utils"; +import { getObjectLikeUtils } from "../object-like/index"; +import { getSchemaUtils } from "../schema-utils/index"; import { isProperty } from "./property"; -import { +import type { BaseObjectSchema, - ObjectSchema, - ObjectUtils, - PropertySchemas, inferObjectSchemaFromPropertySchemas, inferParsedObjectFromPropertySchemas, inferRawObjectFromPropertySchemas, + ObjectSchema, + ObjectUtils, + PropertySchemas, } from "./types"; interface ObjectPropertyWithRawKey { diff --git a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts index ce4d3edc..bac2e1e1 100644 --- a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts +++ b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts @@ -1,5 +1,10 @@ import { object } from "./object"; -import { ObjectSchema, PropertySchemas, inferParsedPropertySchema, inferRawObjectFromPropertySchemas } from "./types"; +import type { + inferParsedPropertySchema, + inferRawObjectFromPropertySchemas, + ObjectSchema, + PropertySchemas, +} from "./types"; export function objectWithoutOptionalProperties>( schemas: T, diff --git a/src/core/schemas/builders/object/property.ts b/src/core/schemas/builders/object/property.ts index fa9a9be8..ef07c2a7 100644 --- a/src/core/schemas/builders/object/property.ts +++ b/src/core/schemas/builders/object/property.ts @@ -1,4 +1,4 @@ -import { Schema } from "../../Schema"; +import type { Schema } from "../../Schema"; export function property( rawKey: RawKey, diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts index b4f49c88..57f87486 100644 --- a/src/core/schemas/builders/object/types.ts +++ b/src/core/schemas/builders/object/types.ts @@ -1,8 +1,8 @@ -import { BaseSchema, Schema, inferParsed, inferRaw } from "../../Schema"; -import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; -import { ObjectLikeUtils } from "../object-like"; -import { SchemaUtils } from "../schema-utils"; -import { Property } from "./property"; +import type { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema"; +import type { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; +import type { ObjectLikeUtils } from "../object-like/index"; +import type { SchemaUtils } from "../schema-utils/index"; +import type { Property } from "./property"; export type ObjectSchema = BaseObjectSchema & ObjectLikeUtils & @@ -23,8 +23,9 @@ export interface ObjectUtils { export type inferRawObject> = O extends ObjectSchema ? Raw : never; -export type inferParsedObject> = - O extends ObjectSchema ? Parsed : never; +export type inferParsedObject> = O extends ObjectSchema + ? Parsed + : never; export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< inferRawObjectFromPropertySchemas, @@ -46,11 +47,25 @@ export type PropertySchemas = Recor Property | Schema >; -export type inferRawPropertySchema

| Schema> = - P extends Property ? Raw : P extends Schema ? inferRaw

: never; +export type inferRawPropertySchema

| Schema> = P extends Property< + any, + infer Raw, + any +> + ? Raw + : P extends Schema + ? inferRaw

+ : never; -export type inferParsedPropertySchema

| Schema> = - P extends Property ? Parsed : P extends Schema ? inferParsed

: never; +export type inferParsedPropertySchema

| Schema> = P extends Property< + any, + any, + infer Parsed +> + ? Parsed + : P extends Schema + ? inferParsed

+ : never; export type inferRawKey< ParsedKey extends string | number | symbol, diff --git a/src/core/schemas/builders/primitives/any.ts b/src/core/schemas/builders/primitives/any.ts index fcaeb042..0652f893 100644 --- a/src/core/schemas/builders/primitives/any.ts +++ b/src/core/schemas/builders/primitives/any.ts @@ -1,4 +1,7 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -export const any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value })); +export const any: () => Schema = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ + ok: true, + value, +})); diff --git a/src/core/schemas/builders/primitives/boolean.ts b/src/core/schemas/builders/primitives/boolean.ts index 2b559881..d90a6924 100644 --- a/src/core/schemas/builders/primitives/boolean.ts +++ b/src/core/schemas/builders/primitives/boolean.ts @@ -1,8 +1,8 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const boolean = createIdentitySchemaCreator( +export const boolean: () => Schema = createIdentitySchemaCreator( SchemaType.BOOLEAN, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "boolean") { diff --git a/src/core/schemas/builders/primitives/number.ts b/src/core/schemas/builders/primitives/number.ts index 3d6be6ff..8b3b32cd 100644 --- a/src/core/schemas/builders/primitives/number.ts +++ b/src/core/schemas/builders/primitives/number.ts @@ -1,8 +1,8 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const number = createIdentitySchemaCreator( +export const number: () => Schema = createIdentitySchemaCreator( SchemaType.NUMBER, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "number") { diff --git a/src/core/schemas/builders/primitives/string.ts b/src/core/schemas/builders/primitives/string.ts index e09aceec..f9f8e477 100644 --- a/src/core/schemas/builders/primitives/string.ts +++ b/src/core/schemas/builders/primitives/string.ts @@ -1,8 +1,8 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const string = createIdentitySchemaCreator( +export const string: () => Schema = createIdentitySchemaCreator( SchemaType.STRING, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "string") { diff --git a/src/core/schemas/builders/primitives/unknown.ts b/src/core/schemas/builders/primitives/unknown.ts index 4d524957..41c9d770 100644 --- a/src/core/schemas/builders/primitives/unknown.ts +++ b/src/core/schemas/builders/primitives/unknown.ts @@ -1,4 +1,7 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); +export const unknown: () => Schema = createIdentitySchemaCreator( + SchemaType.UNKNOWN, + (value) => ({ ok: true, value }), +); diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts index eb3e9a99..ba5307a6 100644 --- a/src/core/schemas/builders/record/record.ts +++ b/src/core/schemas/builders/record/record.ts @@ -1,10 +1,10 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; import { entries } from "../../utils/entries"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; -import { BaseRecordSchema, RecordSchema } from "./types"; +import { getSchemaUtils } from "../schema-utils/index"; +import type { BaseRecordSchema, RecordSchema } from "./types"; export function record( keySchema: Schema, @@ -90,7 +90,7 @@ function validateAndTransformRecord 0 ? Number(stringKey) : NaN; - if (!isNaN(numberKey)) { + if (!Number.isNaN(numberKey)) { key = numberKey; } } diff --git a/src/core/schemas/builders/record/types.ts b/src/core/schemas/builders/record/types.ts index fec431d4..b99bb9d8 100644 --- a/src/core/schemas/builders/record/types.ts +++ b/src/core/schemas/builders/record/types.ts @@ -1,5 +1,5 @@ -import { BaseSchema } from "../../Schema"; -import { SchemaUtils } from "../schema-utils"; +import type { BaseSchema } from "../../Schema"; +import type { SchemaUtils } from "../schema-utils/index"; export type RecordSchema< RawKey extends string | number, diff --git a/src/core/schemas/builders/schema-utils/JsonError.ts b/src/core/schemas/builders/schema-utils/JsonError.ts index 2b89ca0e..7573c76b 100644 --- a/src/core/schemas/builders/schema-utils/JsonError.ts +++ b/src/core/schemas/builders/schema-utils/JsonError.ts @@ -1,4 +1,4 @@ -import { ValidationError } from "../../Schema"; +import type { ValidationError } from "../../Schema"; import { stringifyValidationError } from "./stringifyValidationErrors"; export class JsonError extends Error { diff --git a/src/core/schemas/builders/schema-utils/ParseError.ts b/src/core/schemas/builders/schema-utils/ParseError.ts index d056eb45..f1914b59 100644 --- a/src/core/schemas/builders/schema-utils/ParseError.ts +++ b/src/core/schemas/builders/schema-utils/ParseError.ts @@ -1,4 +1,4 @@ -import { ValidationError } from "../../Schema"; +import type { ValidationError } from "../../Schema"; import { stringifyValidationError } from "./stringifyValidationErrors"; export class ParseError extends Error { diff --git a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts index d5e7a955..91381a1d 100644 --- a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts +++ b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts @@ -1,4 +1,4 @@ -import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema"; +import { type BaseSchema, type Schema, type SchemaOptions, SchemaType } from "../../Schema"; import { JsonError } from "./JsonError"; import { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/index.ts b/src/core/schemas/builders/schema-utils/index.ts index aa04e051..9d0eed7a 100644 --- a/src/core/schemas/builders/schema-utils/index.ts +++ b/src/core/schemas/builders/schema-utils/index.ts @@ -1,4 +1,4 @@ -export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; export type { SchemaUtils } from "./getSchemaUtils"; +export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; export { JsonError } from "./JsonError"; export { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts index 4160f0a2..1066d003 100644 --- a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts +++ b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts @@ -1,4 +1,4 @@ -import { ValidationError } from "../../Schema"; +import type { ValidationError } from "../../Schema"; export function stringifyValidationError(error: ValidationError): string { if (error.path.length === 0) { diff --git a/src/core/schemas/builders/set/set.ts b/src/core/schemas/builders/set/set.ts index e9e6bb7e..bf31bc5f 100644 --- a/src/core/schemas/builders/set/set.ts +++ b/src/core/schemas/builders/set/set.ts @@ -1,8 +1,8 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { list } from "../list"; -import { getSchemaUtils } from "../schema-utils"; +import { list } from "../list/index"; +import { getSchemaUtils } from "../schema-utils/index"; export function set(schema: Schema): Schema> { const listSchema = list(schema); diff --git a/src/core/schemas/builders/undiscriminated-union/types.ts b/src/core/schemas/builders/undiscriminated-union/types.ts index 4f0888aa..3ef19e2c 100644 --- a/src/core/schemas/builders/undiscriminated-union/types.ts +++ b/src/core/schemas/builders/undiscriminated-union/types.ts @@ -1,4 +1,4 @@ -import { Schema, inferParsed, inferRaw } from "../../Schema"; +import type { inferParsed, inferRaw, Schema } from "../../Schema"; export type UndiscriminatedUnionSchema = Schema< inferRawUnidiscriminatedUnionSchema, diff --git a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts index a5cf01fa..26ad5f9b 100644 --- a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts +++ b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts @@ -1,7 +1,14 @@ -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema"; +import { + type BaseSchema, + type MaybeValid, + type Schema, + type SchemaOptions, + SchemaType, + type ValidationError, +} from "../../Schema"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; -import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; +import { getSchemaUtils } from "../schema-utils/index"; +import type { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; export function undiscriminatedUnion, ...Schema[]]>( schemas: Schemas, diff --git a/src/core/schemas/builders/union/index.ts b/src/core/schemas/builders/union/index.ts index 85fc008a..22289b66 100644 --- a/src/core/schemas/builders/union/index.ts +++ b/src/core/schemas/builders/union/index.ts @@ -1,5 +1,5 @@ -export { discriminant } from "./discriminant"; export type { Discriminant } from "./discriminant"; +export { discriminant } from "./discriminant"; export type { inferParsedDiscriminant, inferParsedUnion, diff --git a/src/core/schemas/builders/union/types.ts b/src/core/schemas/builders/union/types.ts index 7ac9d16d..79753436 100644 --- a/src/core/schemas/builders/union/types.ts +++ b/src/core/schemas/builders/union/types.ts @@ -1,5 +1,5 @@ -import { ObjectSchema, inferParsedObject, inferRawObject } from "../object"; -import { Discriminant } from "./discriminant"; +import type { inferParsedObject, inferRawObject, ObjectSchema } from "../object/index"; +import type { Discriminant } from "./discriminant"; export type UnionSubtypes = { [K in DiscriminantValues]: ObjectSchema; diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts index afdd5a1f..7da4271a 100644 --- a/src/core/schemas/builders/union/union.ts +++ b/src/core/schemas/builders/union/union.ts @@ -1,14 +1,20 @@ -import { BaseSchema, MaybeValid, SchemaType } from "../../Schema"; +import { type BaseSchema, type MaybeValid, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { keys } from "../../utils/keys"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { enum_ } from "../enum"; -import { ObjectSchema } from "../object"; -import { ObjectLikeSchema, getObjectLikeUtils } from "../object-like"; -import { getSchemaUtils } from "../schema-utils"; -import { Discriminant } from "./discriminant"; -import { UnionSubtypes, inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion } from "./types"; +import { enum_ } from "../enum/index"; +import type { ObjectSchema } from "../object/index"; +import { getObjectLikeUtils, type ObjectLikeSchema } from "../object-like"; +import { getSchemaUtils } from "../schema-utils/index"; +import type { Discriminant } from "./discriminant"; +import type { + inferParsedDiscriminant, + inferParsedUnion, + inferRawDiscriminant, + inferRawUnion, + UnionSubtypes, +} from "./types"; export function union, U extends UnionSubtypes>( discriminant: D, diff --git a/src/core/schemas/index.ts b/src/core/schemas/index.ts index 5429d8b4..60c0b598 100644 --- a/src/core/schemas/index.ts +++ b/src/core/schemas/index.ts @@ -1,2 +1,2 @@ -export * from "./builders"; +export * from "./builders/index"; export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema"; diff --git a/src/core/schemas/utils/createIdentitySchemaCreator.ts b/src/core/schemas/utils/createIdentitySchemaCreator.ts index 4db71be4..d299ada7 100644 --- a/src/core/schemas/utils/createIdentitySchemaCreator.ts +++ b/src/core/schemas/utils/createIdentitySchemaCreator.ts @@ -1,5 +1,5 @@ -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; -import { getSchemaUtils } from "../builders/schema-utils"; +import { getSchemaUtils } from "../builders/schema-utils/index"; +import type { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; import { maybeSkipValidation } from "./maybeSkipValidation"; export function createIdentitySchemaCreator( diff --git a/src/core/schemas/utils/maybeSkipValidation.ts b/src/core/schemas/utils/maybeSkipValidation.ts index 950d5f9c..70be6478 100644 --- a/src/core/schemas/utils/maybeSkipValidation.ts +++ b/src/core/schemas/utils/maybeSkipValidation.ts @@ -1,4 +1,4 @@ -import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; +import type { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; export function maybeSkipValidation, Raw, Parsed>(schema: S): S { return { @@ -15,7 +15,7 @@ function transformAndMaybeSkipValidation( const transformed = transform(value, opts); const { skipValidation = false } = opts ?? {}; if (!transformed.ok && skipValidation) { - // eslint-disable-next-line no-console + // biome-ignore lint/suspicious/noConsole: allow console console.warn( [ "Failed to validate.", diff --git a/src/core/url/encodePathParam.ts b/src/core/url/encodePathParam.ts new file mode 100644 index 00000000..19b90124 --- /dev/null +++ b/src/core/url/encodePathParam.ts @@ -0,0 +1,18 @@ +export function encodePathParam(param: unknown): string { + if (param === null) { + return "null"; + } + const typeofParam = typeof param; + switch (typeofParam) { + case "undefined": + return "undefined"; + case "string": + case "number": + case "boolean": + break; + default: + param = String(param); + break; + } + return encodeURIComponent(param as string | number | boolean); +} diff --git a/src/core/url/index.ts b/src/core/url/index.ts new file mode 100644 index 00000000..62f9123b --- /dev/null +++ b/src/core/url/index.ts @@ -0,0 +1,3 @@ +export { encodePathParam } from "./encodePathParam"; +export { join } from "./join"; +export { toQueryString } from "./qs"; diff --git a/src/core/url/join.ts b/src/core/url/join.ts new file mode 100644 index 00000000..b872a90a --- /dev/null +++ b/src/core/url/join.ts @@ -0,0 +1,80 @@ +export function join(base: string, ...segments: string[]): string { + if (!base) { + return ""; + } + + if (segments.length === 0) { + return base; + } + + if (base.includes("://")) { + let url: URL; + try { + url = new URL(base); + } catch { + // Fallback to path joining if URL is malformed + return joinPath(base, ...segments); + } + + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); + + for (const segment of segments) { + const cleanSegment = trimSlashes(segment); + if (cleanSegment) { + url.pathname = joinPathSegments(url.pathname, cleanSegment); + } + } + + if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) { + url.pathname += "/"; + } + + return url.toString(); + } + + return joinPath(base, ...segments); +} + +function joinPath(base: string, ...segments: string[]): string { + if (segments.length === 0) { + return base; + } + + let result = base; + + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); + + for (const segment of segments) { + const cleanSegment = trimSlashes(segment); + if (cleanSegment) { + result = joinPathSegments(result, cleanSegment); + } + } + + if (shouldPreserveTrailingSlash && !result.endsWith("/")) { + result += "/"; + } + + return result; +} + +function joinPathSegments(left: string, right: string): string { + if (left.endsWith("/")) { + return left + right; + } + return `${left}/${right}`; +} + +function trimSlashes(str: string): string { + if (!str) return str; + + let start = 0; + let end = str.length; + + if (str.startsWith("/")) start = 1; + if (str.endsWith("/")) end = str.length - 1; + + return start === 0 && end === str.length ? str : str.slice(start, end); +} diff --git a/src/core/url/qs.ts b/src/core/url/qs.ts new file mode 100644 index 00000000..13e89be9 --- /dev/null +++ b/src/core/url/qs.ts @@ -0,0 +1,74 @@ +interface QueryStringOptions { + arrayFormat?: "indices" | "repeat"; + encode?: boolean; +} + +const defaultQsOptions: Required = { + arrayFormat: "indices", + encode: true, +} as const; + +function encodeValue(value: unknown, shouldEncode: boolean): string { + if (value === undefined) { + return ""; + } + if (value === null) { + return ""; + } + const stringValue = String(value); + return shouldEncode ? encodeURIComponent(stringValue) : stringValue; +} + +function stringifyObject(obj: Record, prefix = "", options: Required): string[] { + const parts: string[] = []; + + for (const [key, value] of Object.entries(obj)) { + const fullKey = prefix ? `${prefix}[${key}]` : key; + + if (value === undefined) { + continue; + } + + if (Array.isArray(value)) { + if (value.length === 0) { + continue; + } + for (let i = 0; i < value.length; i++) { + const item = value[i]; + if (item === undefined) { + continue; + } + if (typeof item === "object" && !Array.isArray(item) && item !== null) { + const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + parts.push(...stringifyObject(item as Record, arrayKey, options)); + } else { + const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; + parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } + } + } else if (typeof value === "object" && value !== null) { + if (Object.keys(value as Record).length === 0) { + continue; + } + parts.push(...stringifyObject(value as Record, fullKey, options)); + } else { + const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; + parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`); + } + } + + return parts; +} + +export function toQueryString(obj: unknown, options?: QueryStringOptions): string { + if (obj == null || typeof obj !== "object") { + return ""; + } + + const parts = stringifyObject(obj as Record, "", { + ...defaultQsOptions, + ...options, + }); + return parts.join("&"); +} diff --git a/src/environments.ts b/src/environments.ts index 33bf50cf..844257d6 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface WebflowEnvironmentUrls { base: string; diff --git a/src/errors/WebflowError.ts b/src/errors/WebflowError.ts index 7c2de9ae..3a1f3843 100644 --- a/src/errors/WebflowError.ts +++ b/src/errors/WebflowError.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as core from "../core"; +import type * as core from "../core"; import { toJson } from "../core/json"; export class WebflowError extends Error { @@ -38,7 +36,7 @@ function buildMessage({ statusCode: number | undefined; body: unknown | undefined; }): string { - let lines: string[] = []; + const lines: string[] = []; if (message != null) { lines.push(message); } diff --git a/src/errors/WebflowTimeoutError.ts b/src/errors/WebflowTimeoutError.ts index 40bd92c0..e0901513 100644 --- a/src/errors/WebflowTimeoutError.ts +++ b/src/errors/WebflowTimeoutError.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export class WebflowTimeoutError extends Error { constructor(message: string) { diff --git a/src/serialization/resources/accessGroups/types/AccessGroupsListRequestSort.ts b/src/serialization/resources/accessGroups/types/AccessGroupsListRequestSort.ts index 273e80c3..22c6f9ea 100644 --- a/src/serialization/resources/accessGroups/types/AccessGroupsListRequestSort.ts +++ b/src/serialization/resources/accessGroups/types/AccessGroupsListRequestSort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const AccessGroupsListRequestSort: core.serialization.Schema< serializers.AccessGroupsListRequestSort.Raw, diff --git a/src/serialization/resources/assets/client/requests/AssetsCreateFolderRequest.ts b/src/serialization/resources/assets/client/requests/AssetsCreateFolderRequest.ts index 70145288..544cea0c 100644 --- a/src/serialization/resources/assets/client/requests/AssetsCreateFolderRequest.ts +++ b/src/serialization/resources/assets/client/requests/AssetsCreateFolderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const AssetsCreateFolderRequest: core.serialization.Schema< serializers.AssetsCreateFolderRequest.Raw, diff --git a/src/serialization/resources/assets/client/requests/AssetsCreateRequest.ts b/src/serialization/resources/assets/client/requests/AssetsCreateRequest.ts index 98c2d74c..221cc53d 100644 --- a/src/serialization/resources/assets/client/requests/AssetsCreateRequest.ts +++ b/src/serialization/resources/assets/client/requests/AssetsCreateRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const AssetsCreateRequest: core.serialization.Schema< serializers.AssetsCreateRequest.Raw, diff --git a/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts b/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts index d95d8d35..6ac25a9b 100644 --- a/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts +++ b/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const AssetsUpdateRequest: core.serialization.Schema< serializers.AssetsUpdateRequest.Raw, diff --git a/src/serialization/resources/assets/client/requests/index.ts b/src/serialization/resources/assets/client/requests/index.ts index 54ebd265..60527e36 100644 --- a/src/serialization/resources/assets/client/requests/index.ts +++ b/src/serialization/resources/assets/client/requests/index.ts @@ -1,3 +1,3 @@ +export { AssetsCreateFolderRequest } from "./AssetsCreateFolderRequest"; export { AssetsCreateRequest } from "./AssetsCreateRequest"; export { AssetsUpdateRequest } from "./AssetsUpdateRequest"; -export { AssetsCreateFolderRequest } from "./AssetsCreateFolderRequest"; diff --git a/src/serialization/resources/collections/client/requests/CollectionsCreateRequest.ts b/src/serialization/resources/collections/client/requests/CollectionsCreateRequest.ts index a9b6b9bc..67bf1866 100644 --- a/src/serialization/resources/collections/client/requests/CollectionsCreateRequest.ts +++ b/src/serialization/resources/collections/client/requests/CollectionsCreateRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { FieldCreate } from "../../../../types/FieldCreate"; export const CollectionsCreateRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/index.ts b/src/serialization/resources/collections/index.ts index 4ce0f390..33a87f10 100644 --- a/src/serialization/resources/collections/index.ts +++ b/src/serialization/resources/collections/index.ts @@ -1,2 +1,2 @@ -export * from "./resources"; export * from "./client"; +export * from "./resources"; diff --git a/src/serialization/resources/collections/resources/fields/client/requests/FieldUpdate.ts b/src/serialization/resources/collections/resources/fields/client/requests/FieldUpdate.ts index adfbb029..4b72790b 100644 --- a/src/serialization/resources/collections/resources/fields/client/requests/FieldUpdate.ts +++ b/src/serialization/resources/collections/resources/fields/client/requests/FieldUpdate.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; export const FieldUpdate: core.serialization.Schema< serializers.collections.FieldUpdate.Raw, diff --git a/src/serialization/resources/collections/resources/index.ts b/src/serialization/resources/collections/resources/index.ts index 2452d24a..db2e1bdc 100644 --- a/src/serialization/resources/collections/resources/index.ts +++ b/src/serialization/resources/collections/resources/index.ts @@ -1,5 +1,5 @@ -export * as items from "./items"; -export * from "./items/types"; export * as fields from "./fields"; export * from "./fields/client/requests"; +export * as items from "./items"; export * from "./items/client/requests"; +export * from "./items/types"; diff --git a/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts b/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts index ba128962..b83ac3d4 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CreateBulkCollectionItemRequestBodyFieldData } from "../../types/CreateBulkCollectionItemRequestBodyFieldData"; export const CreateBulkCollectionItemRequestBody: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts index 1ca3ae62..a41d5922 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { ItemsDeleteItemsLiveRequestItemsItem } from "../../types/ItemsDeleteItemsLiveRequestItemsItem"; export const ItemsDeleteItemsLiveRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts index 1863b108..8cc6653f 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { ItemsDeleteItemsRequestItemsItem } from "../../types/ItemsDeleteItemsRequestItemsItem"; export const ItemsDeleteItemsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts index 92e07f4f..888ea4f5 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CollectionItemWithIdInput } from "../../../../../../types/CollectionItemWithIdInput"; export const ItemsUpdateItemsLiveRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts index b2ab9fba..28ecdac7 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CollectionItemWithIdInput } from "../../../../../../types/CollectionItemWithIdInput"; export const ItemsUpdateItemsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/index.ts b/src/serialization/resources/collections/resources/items/client/requests/index.ts index 70354e75..1db833c1 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/index.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/index.ts @@ -1,5 +1,5 @@ -export { ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; -export { ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; +export { CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; export { ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; +export { ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; export { ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; -export { CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; +export { ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; diff --git a/src/serialization/resources/collections/resources/items/index.ts b/src/serialization/resources/collections/resources/items/index.ts index c9240f83..d2ec2302 100644 --- a/src/serialization/resources/collections/resources/items/index.ts +++ b/src/serialization/resources/collections/resources/items/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts index 75bea9db..2e83eb18 100644 --- a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts +++ b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import { SingleCmsItem } from "./SingleCmsItem"; +import type * as serializers from "../../../../../index"; import { CreateBulkCollectionItemRequestBodyFieldDataItem } from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; +import { SingleCmsItem } from "./SingleCmsItem"; export const CreateBulkCollectionItemRequestBodyFieldData: core.serialization.Schema< serializers.collections.CreateBulkCollectionItemRequestBodyFieldData.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts index 86f617fc..64841788 100644 --- a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts +++ b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const CreateBulkCollectionItemRequestBodyFieldDataItem: core.serialization.ObjectSchema< serializers.collections.CreateBulkCollectionItemRequestBodyFieldDataItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemIDs.ts b/src/serialization/resources/collections/resources/items/types/ItemIDs.ts index f1e8e450..c4f35bf3 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemIDs.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemIDs.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemIDs: core.serialization.ObjectSchema< serializers.collections.ItemIDs.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemIDsWithLocales.ts b/src/serialization/resources/collections/resources/items/types/ItemIDsWithLocales.ts index 284a17f9..3cd12321 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemIDsWithLocales.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemIDsWithLocales.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; import { ItemsPublishItemRequestItemsItemsItem } from "./ItemsPublishItemRequestItemsItemsItem"; export const ItemIDsWithLocales: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts index 489cf386..58cf9760 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; import { CollectionItem } from "../../../../../types/CollectionItem"; import { MultipleLiveItems } from "./MultipleLiveItems"; diff --git a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts index f570760f..7d3a4197 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; import { CollectionItemPostSingle } from "../../../../../types/CollectionItemPostSingle"; import { MultipleItems } from "./MultipleItems"; diff --git a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts index 54db2b67..d0753c8a 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemsDeleteItemsLiveRequestItemsItem: core.serialization.ObjectSchema< serializers.collections.ItemsDeleteItemsLiveRequestItemsItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts index 6642af2f..07fc880b 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemsDeleteItemsRequestItemsItem: core.serialization.ObjectSchema< serializers.collections.ItemsDeleteItemsRequestItemsItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts b/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts index 54abd267..695cd759 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemsListItemsLiveRequestSortBy: core.serialization.Schema< serializers.collections.ItemsListItemsLiveRequestSortBy.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts b/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts index 5373cffe..7dcae2b1 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemsListItemsLiveRequestSortOrder: core.serialization.Schema< serializers.collections.ItemsListItemsLiveRequestSortOrder.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts b/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts index d85d93e3..3da20a13 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemsListItemsRequestSortBy: core.serialization.Schema< serializers.collections.ItemsListItemsRequestSortBy.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts b/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts index ab399b53..3f6e1606 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemsListItemsRequestSortOrder: core.serialization.Schema< serializers.collections.ItemsListItemsRequestSortOrder.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequest.ts b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequest.ts index d792a450..b418dc06 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequest.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; import { ItemIDs } from "./ItemIDs"; import { ItemIDsWithLocales } from "./ItemIDsWithLocales"; diff --git a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts index 761d5469..561c7e90 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemsPublishItemRequestItemsItemsItem: core.serialization.ObjectSchema< serializers.collections.ItemsPublishItemRequestItemsItemsItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.ts b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.ts index 29994807..9e4d4c42 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const ItemsPublishItemResponse: core.serialization.ObjectSchema< serializers.collections.ItemsPublishItemResponse.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts b/src/serialization/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts index 426375fc..cd681549 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; import { CollectionItem } from "../../../../../types/CollectionItem"; import { CollectionItemList } from "../../../../../types/CollectionItemList"; diff --git a/src/serialization/resources/collections/resources/items/types/MultipleItems.ts b/src/serialization/resources/collections/resources/items/types/MultipleItems.ts index c4e98048..a9b60927 100644 --- a/src/serialization/resources/collections/resources/items/types/MultipleItems.ts +++ b/src/serialization/resources/collections/resources/items/types/MultipleItems.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; import { CollectionItemPostSingle } from "../../../../../types/CollectionItemPostSingle"; export const MultipleItems: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/collections/resources/items/types/MultipleLiveItems.ts b/src/serialization/resources/collections/resources/items/types/MultipleLiveItems.ts index 33f9bf01..d6b19ce5 100644 --- a/src/serialization/resources/collections/resources/items/types/MultipleLiveItems.ts +++ b/src/serialization/resources/collections/resources/items/types/MultipleLiveItems.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; import { CollectionItem } from "../../../../../types/CollectionItem"; export const MultipleLiveItems: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/collections/resources/items/types/SingleCmsItem.ts b/src/serialization/resources/collections/resources/items/types/SingleCmsItem.ts index 366e8d1e..d1d43a05 100644 --- a/src/serialization/resources/collections/resources/items/types/SingleCmsItem.ts +++ b/src/serialization/resources/collections/resources/items/types/SingleCmsItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const SingleCmsItem: core.serialization.ObjectSchema< serializers.collections.SingleCmsItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/index.ts b/src/serialization/resources/collections/resources/items/types/index.ts index 92acdcb3..423ca368 100644 --- a/src/serialization/resources/collections/resources/items/types/index.ts +++ b/src/serialization/resources/collections/resources/items/types/index.ts @@ -1,19 +1,19 @@ -export * from "./ItemsListItemsRequestSortBy"; -export * from "./ItemsListItemsRequestSortOrder"; -export * from "./MultipleItems"; +export * from "./CreateBulkCollectionItemRequestBodyFieldData"; +export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; +export * from "./ItemIDs"; +export * from "./ItemIDsWithLocales"; +export * from "./ItemsCreateItemLiveRequestBody"; export * from "./ItemsCreateItemRequestBody"; +export * from "./ItemsDeleteItemsLiveRequestItemsItem"; export * from "./ItemsDeleteItemsRequestItemsItem"; -export * from "./ItemsUpdateItemsResponse"; export * from "./ItemsListItemsLiveRequestSortBy"; export * from "./ItemsListItemsLiveRequestSortOrder"; -export * from "./MultipleLiveItems"; -export * from "./ItemsCreateItemLiveRequestBody"; -export * from "./ItemsDeleteItemsLiveRequestItemsItem"; -export * from "./SingleCmsItem"; -export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; -export * from "./CreateBulkCollectionItemRequestBodyFieldData"; -export * from "./ItemIDs"; -export * from "./ItemsPublishItemRequestItemsItemsItem"; -export * from "./ItemIDsWithLocales"; +export * from "./ItemsListItemsRequestSortBy"; +export * from "./ItemsListItemsRequestSortOrder"; export * from "./ItemsPublishItemRequest"; +export * from "./ItemsPublishItemRequestItemsItemsItem"; export * from "./ItemsPublishItemResponse"; +export * from "./ItemsUpdateItemsResponse"; +export * from "./MultipleItems"; +export * from "./MultipleLiveItems"; +export * from "./SingleCmsItem"; diff --git a/src/serialization/resources/components/client/requests/ComponentDomWrite.ts b/src/serialization/resources/components/client/requests/ComponentDomWrite.ts index 71ec0033..f8a828ac 100644 --- a/src/serialization/resources/components/client/requests/ComponentDomWrite.ts +++ b/src/serialization/resources/components/client/requests/ComponentDomWrite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { ComponentDomWriteNodesItem } from "../../types/ComponentDomWriteNodesItem"; export const ComponentDomWrite: core.serialization.Schema< diff --git a/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts b/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts index aca78c09..8b5b50fe 100644 --- a/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts +++ b/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { ComponentPropertiesWritePropertiesItem } from "../../types/ComponentPropertiesWritePropertiesItem"; export const ComponentPropertiesWrite: core.serialization.Schema< diff --git a/src/serialization/resources/components/index.ts b/src/serialization/resources/components/index.ts index c9240f83..d2ec2302 100644 --- a/src/serialization/resources/components/index.ts +++ b/src/serialization/resources/components/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts b/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts index b26c150f..5eb74e5f 100644 --- a/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts +++ b/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts @@ -1,16 +1,14 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import { TextNodeWrite } from "../../../types/TextNodeWrite"; +import type * as serializers from "../../../index"; import { ComponentInstanceNodePropertyOverridesWrite } from "../../../types/ComponentInstanceNodePropertyOverridesWrite"; +import { SearchButtonNodeWrite } from "../../../types/SearchButtonNodeWrite"; import { Select } from "../../../types/Select"; -import { TextInputNodeWrite } from "../../../types/TextInputNodeWrite"; import { SubmitButtonNodeWrite } from "../../../types/SubmitButtonNodeWrite"; -import { SearchButtonNodeWrite } from "../../../types/SearchButtonNodeWrite"; +import { TextInputNodeWrite } from "../../../types/TextInputNodeWrite"; +import { TextNodeWrite } from "../../../types/TextNodeWrite"; export const ComponentDomWriteNodesItem: core.serialization.Schema< serializers.ComponentDomWriteNodesItem.Raw, diff --git a/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts b/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts index c101100b..a34ed53e 100644 --- a/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts +++ b/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const ComponentPropertiesWritePropertiesItem: core.serialization.ObjectSchema< serializers.ComponentPropertiesWritePropertiesItem.Raw, diff --git a/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts b/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts index d664736a..8a65923a 100644 --- a/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts +++ b/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const ComponentsUpdateContentResponse: core.serialization.ObjectSchema< serializers.ComponentsUpdateContentResponse.Raw, diff --git a/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts b/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts index 65d0b158..6abec8dd 100644 --- a/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts +++ b/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const ComponentsUpdatePropertiesResponse: core.serialization.ObjectSchema< serializers.ComponentsUpdatePropertiesResponse.Raw, diff --git a/src/serialization/resources/components/types/index.ts b/src/serialization/resources/components/types/index.ts index 1bdf297c..d72e3728 100644 --- a/src/serialization/resources/components/types/index.ts +++ b/src/serialization/resources/components/types/index.ts @@ -1,4 +1,4 @@ export * from "./ComponentDomWriteNodesItem"; -export * from "./ComponentsUpdateContentResponse"; export * from "./ComponentPropertiesWritePropertiesItem"; +export * from "./ComponentsUpdateContentResponse"; export * from "./ComponentsUpdatePropertiesResponse"; diff --git a/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts b/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts index d64e58c1..9289cf55 100644 --- a/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts +++ b/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const FormsUpdateSubmissionRequest: core.serialization.Schema< serializers.FormsUpdateSubmissionRequest.Raw, diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index dbcf7a65..4a47a0db 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,32 +1,32 @@ -export * as sites from "./sites"; -export * from "./sites/types"; -export * as pages from "./pages"; -export * from "./pages/types"; -export * as components from "./components"; -export * from "./components/types"; -export * as users from "./users"; -export * from "./users/types"; export * as accessGroups from "./accessGroups"; export * from "./accessGroups/types"; -export * as products from "./products"; -export * from "./products/types"; -export * as orders from "./orders"; -export * from "./orders/types"; -export * as inventory from "./inventory"; -export * from "./inventory/types"; +export * as assets from "./assets"; +export * from "./assets/client/requests"; export * as collections from "./collections"; -export * as workspaces from "./workspaces"; -export * from "./sites/client/requests"; export * from "./collections/client/requests"; -export * from "./pages/client/requests"; +export * as components from "./components"; export * from "./components/client/requests"; -export * as scripts from "./scripts"; -export * from "./scripts/client/requests"; -export * as assets from "./assets"; -export * from "./assets/client/requests"; +export * from "./components/types"; export * as forms from "./forms"; export * from "./forms/client/requests"; -export * from "./users/client/requests"; -export * from "./products/client/requests"; -export * from "./orders/client/requests"; +export * as inventory from "./inventory"; export * from "./inventory/client/requests"; +export * from "./inventory/types"; +export * as orders from "./orders"; +export * from "./orders/client/requests"; +export * from "./orders/types"; +export * as pages from "./pages"; +export * from "./pages/client/requests"; +export * from "./pages/types"; +export * as products from "./products"; +export * from "./products/client/requests"; +export * from "./products/types"; +export * as scripts from "./scripts"; +export * from "./scripts/client/requests"; +export * as sites from "./sites"; +export * from "./sites/client/requests"; +export * from "./sites/types"; +export * as users from "./users"; +export * from "./users/client/requests"; +export * from "./users/types"; +export * as workspaces from "./workspaces"; diff --git a/src/serialization/resources/inventory/client/requests/InventoryUpdateRequest.ts b/src/serialization/resources/inventory/client/requests/InventoryUpdateRequest.ts index c54efef5..f3c965cc 100644 --- a/src/serialization/resources/inventory/client/requests/InventoryUpdateRequest.ts +++ b/src/serialization/resources/inventory/client/requests/InventoryUpdateRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { InventoryUpdateRequestInventoryType } from "../../types/InventoryUpdateRequestInventoryType"; export const InventoryUpdateRequest: core.serialization.Schema< diff --git a/src/serialization/resources/inventory/index.ts b/src/serialization/resources/inventory/index.ts index c9240f83..d2ec2302 100644 --- a/src/serialization/resources/inventory/index.ts +++ b/src/serialization/resources/inventory/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/inventory/types/EcommInventoryChangedPayload.ts b/src/serialization/resources/inventory/types/EcommInventoryChangedPayload.ts index 0ca81bd6..948b36c4 100644 --- a/src/serialization/resources/inventory/types/EcommInventoryChangedPayload.ts +++ b/src/serialization/resources/inventory/types/EcommInventoryChangedPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { InventoryItem } from "../../../types/InventoryItem"; export const EcommInventoryChangedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/inventory/types/InventoryUpdateRequestInventoryType.ts b/src/serialization/resources/inventory/types/InventoryUpdateRequestInventoryType.ts index 260d366c..3fc0d8f6 100644 --- a/src/serialization/resources/inventory/types/InventoryUpdateRequestInventoryType.ts +++ b/src/serialization/resources/inventory/types/InventoryUpdateRequestInventoryType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const InventoryUpdateRequestInventoryType: core.serialization.Schema< serializers.InventoryUpdateRequestInventoryType.Raw, diff --git a/src/serialization/resources/inventory/types/index.ts b/src/serialization/resources/inventory/types/index.ts index a225550f..f48b48ca 100644 --- a/src/serialization/resources/inventory/types/index.ts +++ b/src/serialization/resources/inventory/types/index.ts @@ -1,2 +1,2 @@ -export * from "./InventoryUpdateRequestInventoryType"; export * from "./EcommInventoryChangedPayload"; +export * from "./InventoryUpdateRequestInventoryType"; diff --git a/src/serialization/resources/orders/client/requests/OrdersRefundRequest.ts b/src/serialization/resources/orders/client/requests/OrdersRefundRequest.ts index 971bffcb..aca8b9d5 100644 --- a/src/serialization/resources/orders/client/requests/OrdersRefundRequest.ts +++ b/src/serialization/resources/orders/client/requests/OrdersRefundRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { OrdersRefundRequestReason } from "../../types/OrdersRefundRequestReason"; export const OrdersRefundRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts b/src/serialization/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts index a87f7ed6..dad38fc8 100644 --- a/src/serialization/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts +++ b/src/serialization/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const OrdersUpdateFulfillRequest: core.serialization.Schema< serializers.OrdersUpdateFulfillRequest.Raw, diff --git a/src/serialization/resources/orders/client/requests/OrdersUpdateRequest.ts b/src/serialization/resources/orders/client/requests/OrdersUpdateRequest.ts index 30d1daed..25dad88e 100644 --- a/src/serialization/resources/orders/client/requests/OrdersUpdateRequest.ts +++ b/src/serialization/resources/orders/client/requests/OrdersUpdateRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const OrdersUpdateRequest: core.serialization.Schema< serializers.OrdersUpdateRequest.Raw, diff --git a/src/serialization/resources/orders/client/requests/index.ts b/src/serialization/resources/orders/client/requests/index.ts index 18ba18f8..f40362bb 100644 --- a/src/serialization/resources/orders/client/requests/index.ts +++ b/src/serialization/resources/orders/client/requests/index.ts @@ -1,3 +1,3 @@ -export { OrdersUpdateRequest } from "./OrdersUpdateRequest"; -export { OrdersUpdateFulfillRequest } from "./OrdersUpdateFulfillRequest"; export { OrdersRefundRequest } from "./OrdersRefundRequest"; +export { OrdersUpdateFulfillRequest } from "./OrdersUpdateFulfillRequest"; +export { OrdersUpdateRequest } from "./OrdersUpdateRequest"; diff --git a/src/serialization/resources/orders/index.ts b/src/serialization/resources/orders/index.ts index c9240f83..d2ec2302 100644 --- a/src/serialization/resources/orders/index.ts +++ b/src/serialization/resources/orders/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/orders/types/OrdersListRequestStatus.ts b/src/serialization/resources/orders/types/OrdersListRequestStatus.ts index f1dcd801..a05da95d 100644 --- a/src/serialization/resources/orders/types/OrdersListRequestStatus.ts +++ b/src/serialization/resources/orders/types/OrdersListRequestStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const OrdersListRequestStatus: core.serialization.Schema< serializers.OrdersListRequestStatus.Raw, diff --git a/src/serialization/resources/orders/types/OrdersRefundRequestReason.ts b/src/serialization/resources/orders/types/OrdersRefundRequestReason.ts index 0dcafad1..c7277254 100644 --- a/src/serialization/resources/orders/types/OrdersRefundRequestReason.ts +++ b/src/serialization/resources/orders/types/OrdersRefundRequestReason.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const OrdersRefundRequestReason: core.serialization.Schema< serializers.OrdersRefundRequestReason.Raw, diff --git a/src/serialization/resources/pages/client/requests/PageDomWrite.ts b/src/serialization/resources/pages/client/requests/PageDomWrite.ts index 01d8cc2f..2d0c8979 100644 --- a/src/serialization/resources/pages/client/requests/PageDomWrite.ts +++ b/src/serialization/resources/pages/client/requests/PageDomWrite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { PageDomWriteNodesItem } from "../../types/PageDomWriteNodesItem"; export const PageDomWrite: core.serialization.Schema< diff --git a/src/serialization/resources/pages/client/requests/PageMetadataWrite.ts b/src/serialization/resources/pages/client/requests/PageMetadataWrite.ts index 62a18c26..02e29c28 100644 --- a/src/serialization/resources/pages/client/requests/PageMetadataWrite.ts +++ b/src/serialization/resources/pages/client/requests/PageMetadataWrite.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import { PageMetadataWriteSeo } from "../../types/PageMetadataWriteSeo"; +import type * as serializers from "../../../../index"; import { PageMetadataWriteOpenGraph } from "../../types/PageMetadataWriteOpenGraph"; +import { PageMetadataWriteSeo } from "../../types/PageMetadataWriteSeo"; export const PageMetadataWrite: core.serialization.Schema< serializers.PageMetadataWrite.Raw, diff --git a/src/serialization/resources/pages/client/requests/index.ts b/src/serialization/resources/pages/client/requests/index.ts index 9bebff04..8633cf29 100644 --- a/src/serialization/resources/pages/client/requests/index.ts +++ b/src/serialization/resources/pages/client/requests/index.ts @@ -1,2 +1,2 @@ -export { PageMetadataWrite } from "./PageMetadataWrite"; export { PageDomWrite } from "./PageDomWrite"; +export { PageMetadataWrite } from "./PageMetadataWrite"; diff --git a/src/serialization/resources/pages/index.ts b/src/serialization/resources/pages/index.ts index c9240f83..d2ec2302 100644 --- a/src/serialization/resources/pages/index.ts +++ b/src/serialization/resources/pages/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts b/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts index e6c3c944..65db5715 100644 --- a/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts +++ b/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts @@ -1,16 +1,14 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import { TextNodeWrite } from "../../../types/TextNodeWrite"; +import type * as serializers from "../../../index"; import { ComponentInstanceNodePropertyOverridesWrite } from "../../../types/ComponentInstanceNodePropertyOverridesWrite"; +import { SearchButtonNodeWrite } from "../../../types/SearchButtonNodeWrite"; import { Select } from "../../../types/Select"; -import { TextInputNodeWrite } from "../../../types/TextInputNodeWrite"; import { SubmitButtonNodeWrite } from "../../../types/SubmitButtonNodeWrite"; -import { SearchButtonNodeWrite } from "../../../types/SearchButtonNodeWrite"; +import { TextInputNodeWrite } from "../../../types/TextInputNodeWrite"; +import { TextNodeWrite } from "../../../types/TextNodeWrite"; export const PageDomWriteNodesItem: core.serialization.Schema< serializers.PageDomWriteNodesItem.Raw, diff --git a/src/serialization/resources/pages/types/PageMetadataWriteOpenGraph.ts b/src/serialization/resources/pages/types/PageMetadataWriteOpenGraph.ts index 39bb91f1..51949d7e 100644 --- a/src/serialization/resources/pages/types/PageMetadataWriteOpenGraph.ts +++ b/src/serialization/resources/pages/types/PageMetadataWriteOpenGraph.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const PageMetadataWriteOpenGraph: core.serialization.ObjectSchema< serializers.PageMetadataWriteOpenGraph.Raw, diff --git a/src/serialization/resources/pages/types/PageMetadataWriteSeo.ts b/src/serialization/resources/pages/types/PageMetadataWriteSeo.ts index 925d84ea..4ba81fb3 100644 --- a/src/serialization/resources/pages/types/PageMetadataWriteSeo.ts +++ b/src/serialization/resources/pages/types/PageMetadataWriteSeo.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const PageMetadataWriteSeo: core.serialization.ObjectSchema< serializers.PageMetadataWriteSeo.Raw, diff --git a/src/serialization/resources/pages/types/UpdateStaticContentResponse.ts b/src/serialization/resources/pages/types/UpdateStaticContentResponse.ts index df1f81f3..3c17710f 100644 --- a/src/serialization/resources/pages/types/UpdateStaticContentResponse.ts +++ b/src/serialization/resources/pages/types/UpdateStaticContentResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const UpdateStaticContentResponse: core.serialization.ObjectSchema< serializers.UpdateStaticContentResponse.Raw, diff --git a/src/serialization/resources/pages/types/index.ts b/src/serialization/resources/pages/types/index.ts index 9fecb32e..f2f4beb2 100644 --- a/src/serialization/resources/pages/types/index.ts +++ b/src/serialization/resources/pages/types/index.ts @@ -1,4 +1,4 @@ -export * from "./PageMetadataWriteSeo"; -export * from "./PageMetadataWriteOpenGraph"; export * from "./PageDomWriteNodesItem"; +export * from "./PageMetadataWriteOpenGraph"; +export * from "./PageMetadataWriteSeo"; export * from "./UpdateStaticContentResponse"; diff --git a/src/serialization/resources/products/client/requests/ProductSkuCreate.ts b/src/serialization/resources/products/client/requests/ProductSkuCreate.ts index 6a03ccbb..6f32b2d6 100644 --- a/src/serialization/resources/products/client/requests/ProductSkuCreate.ts +++ b/src/serialization/resources/products/client/requests/ProductSkuCreate.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { PublishStatus } from "../../../../types/PublishStatus"; import { ProductSkuCreateProduct } from "../../types/ProductSkuCreateProduct"; import { ProductSkuCreateSku } from "../../types/ProductSkuCreateSku"; diff --git a/src/serialization/resources/products/client/requests/ProductSkuUpdate.ts b/src/serialization/resources/products/client/requests/ProductSkuUpdate.ts index 27efda47..7d1f48b7 100644 --- a/src/serialization/resources/products/client/requests/ProductSkuUpdate.ts +++ b/src/serialization/resources/products/client/requests/ProductSkuUpdate.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import { PublishStatus } from "../../../../types/PublishStatus"; +import type * as serializers from "../../../../index"; import { Product } from "../../../../types/Product"; +import { PublishStatus } from "../../../../types/PublishStatus"; import { Sku } from "../../../../types/Sku"; export const ProductSkuUpdate: core.serialization.Schema = diff --git a/src/serialization/resources/products/client/requests/ProductsCreateSkuRequest.ts b/src/serialization/resources/products/client/requests/ProductsCreateSkuRequest.ts index c9f275db..b7f3ea1f 100644 --- a/src/serialization/resources/products/client/requests/ProductsCreateSkuRequest.ts +++ b/src/serialization/resources/products/client/requests/ProductsCreateSkuRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { PublishStatus } from "../../../../types/PublishStatus"; import { Sku } from "../../../../types/Sku"; diff --git a/src/serialization/resources/products/client/requests/ProductsUpdateSkuRequest.ts b/src/serialization/resources/products/client/requests/ProductsUpdateSkuRequest.ts index 4a05dc69..7329e44e 100644 --- a/src/serialization/resources/products/client/requests/ProductsUpdateSkuRequest.ts +++ b/src/serialization/resources/products/client/requests/ProductsUpdateSkuRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { PublishStatus } from "../../../../types/PublishStatus"; import { Sku } from "../../../../types/Sku"; diff --git a/src/serialization/resources/products/index.ts b/src/serialization/resources/products/index.ts index c9240f83..d2ec2302 100644 --- a/src/serialization/resources/products/index.ts +++ b/src/serialization/resources/products/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/products/types/ProductSkuCreateProduct.ts b/src/serialization/resources/products/types/ProductSkuCreateProduct.ts index 8b88d2e9..47675b5e 100644 --- a/src/serialization/resources/products/types/ProductSkuCreateProduct.ts +++ b/src/serialization/resources/products/types/ProductSkuCreateProduct.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { ProductFieldData } from "../../../types/ProductFieldData"; export const ProductSkuCreateProduct: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/products/types/ProductSkuCreateSku.ts b/src/serialization/resources/products/types/ProductSkuCreateSku.ts index 7bf5f95b..570195be 100644 --- a/src/serialization/resources/products/types/ProductSkuCreateSku.ts +++ b/src/serialization/resources/products/types/ProductSkuCreateSku.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { SkuFieldData } from "../../../types/SkuFieldData"; export const ProductSkuCreateSku: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts b/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts index a562379c..2a112efd 100644 --- a/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts +++ b/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { Sku } from "../../../types/Sku"; export const ProductsCreateSkuResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/scripts/client/requests/CustomCodeHostedRequest.ts b/src/serialization/resources/scripts/client/requests/CustomCodeHostedRequest.ts index b893f4eb..cf048e85 100644 --- a/src/serialization/resources/scripts/client/requests/CustomCodeHostedRequest.ts +++ b/src/serialization/resources/scripts/client/requests/CustomCodeHostedRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CustomCodeHostedRequest: core.serialization.Schema< serializers.CustomCodeHostedRequest.Raw, diff --git a/src/serialization/resources/scripts/client/requests/CustomCodeInlineRequest.ts b/src/serialization/resources/scripts/client/requests/CustomCodeInlineRequest.ts index 2052a553..73e18732 100644 --- a/src/serialization/resources/scripts/client/requests/CustomCodeInlineRequest.ts +++ b/src/serialization/resources/scripts/client/requests/CustomCodeInlineRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CustomCodeInlineRequest: core.serialization.Schema< serializers.CustomCodeInlineRequest.Raw, diff --git a/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts b/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts index bed8836d..62596f32 100644 --- a/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts +++ b/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const SitesCreateRequest: core.serialization.Schema< serializers.SitesCreateRequest.Raw, diff --git a/src/serialization/resources/sites/client/requests/SitesPublishRequest.ts b/src/serialization/resources/sites/client/requests/SitesPublishRequest.ts index ff467a89..8cb1612c 100644 --- a/src/serialization/resources/sites/client/requests/SitesPublishRequest.ts +++ b/src/serialization/resources/sites/client/requests/SitesPublishRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const SitesPublishRequest: core.serialization.Schema< serializers.SitesPublishRequest.Raw, diff --git a/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts b/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts index 838d8455..deb7afdf 100644 --- a/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts +++ b/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const SitesUpdateRequest: core.serialization.Schema< serializers.SitesUpdateRequest.Raw, diff --git a/src/serialization/resources/sites/client/requests/index.ts b/src/serialization/resources/sites/client/requests/index.ts index 1a807906..0ce9c8d8 100644 --- a/src/serialization/resources/sites/client/requests/index.ts +++ b/src/serialization/resources/sites/client/requests/index.ts @@ -1,3 +1,3 @@ export { SitesCreateRequest } from "./SitesCreateRequest"; -export { SitesUpdateRequest } from "./SitesUpdateRequest"; export { SitesPublishRequest } from "./SitesPublishRequest"; +export { SitesUpdateRequest } from "./SitesUpdateRequest"; diff --git a/src/serialization/resources/sites/index.ts b/src/serialization/resources/sites/index.ts index a931b363..fb00ab43 100644 --- a/src/serialization/resources/sites/index.ts +++ b/src/serialization/resources/sites/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * from "./resources"; export * from "./client"; +export * from "./resources"; +export * from "./types"; diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts index 4bfd02d0..4fbf07b8 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const CommentsGetCommentThreadRequestSortBy: core.serialization.Schema< serializers.sites.CommentsGetCommentThreadRequestSortBy.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts index 04f43e62..2bbc3297 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const CommentsGetCommentThreadRequestSortOrder: core.serialization.Schema< serializers.sites.CommentsGetCommentThreadRequestSortOrder.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts index 1bb5f3e9..9f9f8b55 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const CommentsListCommentRepliesRequestSortBy: core.serialization.Schema< serializers.sites.CommentsListCommentRepliesRequestSortBy.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts index 9163ca20..98ddd0a1 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const CommentsListCommentRepliesRequestSortOrder: core.serialization.Schema< serializers.sites.CommentsListCommentRepliesRequestSortOrder.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts index da330041..6a7ff17a 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const CommentsListCommentThreadsRequestSortBy: core.serialization.Schema< serializers.sites.CommentsListCommentThreadsRequestSortBy.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts index 9f2e751e..f49e4a18 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const CommentsListCommentThreadsRequestSortOrder: core.serialization.Schema< serializers.sites.CommentsListCommentThreadsRequestSortOrder.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/index.ts b/src/serialization/resources/sites/resources/comments/types/index.ts index 0d2c5090..b2ed8e9b 100644 --- a/src/serialization/resources/sites/resources/comments/types/index.ts +++ b/src/serialization/resources/sites/resources/comments/types/index.ts @@ -1,6 +1,6 @@ -export * from "./CommentsListCommentThreadsRequestSortBy"; -export * from "./CommentsListCommentThreadsRequestSortOrder"; export * from "./CommentsGetCommentThreadRequestSortBy"; export * from "./CommentsGetCommentThreadRequestSortOrder"; export * from "./CommentsListCommentRepliesRequestSortBy"; export * from "./CommentsListCommentRepliesRequestSortOrder"; +export * from "./CommentsListCommentThreadsRequestSortBy"; +export * from "./CommentsListCommentThreadsRequestSortOrder"; diff --git a/src/serialization/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts b/src/serialization/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts index d2975c47..668ef58c 100644 --- a/src/serialization/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts +++ b/src/serialization/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; export const FormsUpdateSubmissionRequest: core.serialization.Schema< serializers.sites.FormsUpdateSubmissionRequest.Raw, diff --git a/src/serialization/resources/sites/resources/index.ts b/src/serialization/resources/sites/resources/index.ts index 6feaa6ba..fbc66e1d 100644 --- a/src/serialization/resources/sites/resources/index.ts +++ b/src/serialization/resources/sites/resources/index.ts @@ -1,7 +1,7 @@ -export * as wellKnown from "./wellKnown"; -export * from "./wellKnown/types"; export * as comments from "./comments"; export * from "./comments/types"; -export * from "./wellKnown/client/requests"; export * as forms from "./forms"; export * from "./forms/client/requests"; +export * as wellKnown from "./wellKnown"; +export * from "./wellKnown/client/requests"; +export * from "./wellKnown/types"; diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts index 0f9f14db..6d070a7c 100644 --- a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; export const WellKnownDeleteRequest: core.serialization.Schema< serializers.sites.WellKnownDeleteRequest.Raw, diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts index 3357d6b3..68d8c1c0 100644 --- a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Webflow from "../../../../../../../api/index"; +import type * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { WellKnownFileContentType } from "../../types/WellKnownFileContentType"; export const WellKnownFile: core.serialization.Schema< diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts index 64acd63b..600ad068 100644 --- a/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts @@ -1,2 +1,2 @@ -export { WellKnownFile } from "./WellKnownFile"; export { WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; +export { WellKnownFile } from "./WellKnownFile"; diff --git a/src/serialization/resources/sites/resources/wellKnown/index.ts b/src/serialization/resources/sites/resources/wellKnown/index.ts index c9240f83..d2ec2302 100644 --- a/src/serialization/resources/sites/resources/wellKnown/index.ts +++ b/src/serialization/resources/sites/resources/wellKnown/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts b/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts index 02fc2bfe..f1f3c649 100644 --- a/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts +++ b/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const WellKnownFileContentType: core.serialization.Schema< serializers.sites.WellKnownFileContentType.Raw, diff --git a/src/serialization/resources/sites/types/SitesPublishResponse.ts b/src/serialization/resources/sites/types/SitesPublishResponse.ts index cc634504..f0589df6 100644 --- a/src/serialization/resources/sites/types/SitesPublishResponse.ts +++ b/src/serialization/resources/sites/types/SitesPublishResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { Domain } from "../../../types/Domain"; export const SitesPublishResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/users/client/requests/UsersInviteRequest.ts b/src/serialization/resources/users/client/requests/UsersInviteRequest.ts index cd4ea653..937a3d1d 100644 --- a/src/serialization/resources/users/client/requests/UsersInviteRequest.ts +++ b/src/serialization/resources/users/client/requests/UsersInviteRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; +import type * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const UsersInviteRequest: core.serialization.Schema< serializers.UsersInviteRequest.Raw, diff --git a/src/serialization/resources/users/index.ts b/src/serialization/resources/users/index.ts index c9240f83..d2ec2302 100644 --- a/src/serialization/resources/users/index.ts +++ b/src/serialization/resources/users/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/users/types/UserAccountAddedPayload.ts b/src/serialization/resources/users/types/UserAccountAddedPayload.ts index 1d82484b..6f742927 100644 --- a/src/serialization/resources/users/types/UserAccountAddedPayload.ts +++ b/src/serialization/resources/users/types/UserAccountAddedPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { UserAccountAddedPayloadPayload } from "./UserAccountAddedPayloadPayload"; export const UserAccountAddedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/users/types/UserAccountAddedPayloadPayload.ts b/src/serialization/resources/users/types/UserAccountAddedPayloadPayload.ts index aea444b8..ddc6fa26 100644 --- a/src/serialization/resources/users/types/UserAccountAddedPayloadPayload.ts +++ b/src/serialization/resources/users/types/UserAccountAddedPayloadPayload.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import { UserAccountAddedPayloadPayloadData } from "./UserAccountAddedPayloadPayloadData"; -import { UserStatus } from "../../../types/UserStatus"; +import type * as serializers from "../../../index"; import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; +import { UserStatus } from "../../../types/UserStatus"; +import { UserAccountAddedPayloadPayloadData } from "./UserAccountAddedPayloadPayloadData"; export const UserAccountAddedPayloadPayload: core.serialization.ObjectSchema< serializers.UserAccountAddedPayloadPayload.Raw, diff --git a/src/serialization/resources/users/types/UserAccountAddedPayloadPayloadData.ts b/src/serialization/resources/users/types/UserAccountAddedPayloadPayloadData.ts index 0590ec01..6802d035 100644 --- a/src/serialization/resources/users/types/UserAccountAddedPayloadPayloadData.ts +++ b/src/serialization/resources/users/types/UserAccountAddedPayloadPayloadData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const UserAccountAddedPayloadPayloadData: core.serialization.ObjectSchema< serializers.UserAccountAddedPayloadPayloadData.Raw, diff --git a/src/serialization/resources/users/types/UserAccountDeletedPayload.ts b/src/serialization/resources/users/types/UserAccountDeletedPayload.ts index 5f5c7a6a..0f8bca78 100644 --- a/src/serialization/resources/users/types/UserAccountDeletedPayload.ts +++ b/src/serialization/resources/users/types/UserAccountDeletedPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { UserAccountDeletedPayloadPayload } from "./UserAccountDeletedPayloadPayload"; export const UserAccountDeletedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/users/types/UserAccountDeletedPayloadPayload.ts b/src/serialization/resources/users/types/UserAccountDeletedPayloadPayload.ts index 722f726e..de75d2c6 100644 --- a/src/serialization/resources/users/types/UserAccountDeletedPayloadPayload.ts +++ b/src/serialization/resources/users/types/UserAccountDeletedPayloadPayload.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import { UserAccountDeletedPayloadPayloadData } from "./UserAccountDeletedPayloadPayloadData"; -import { UserStatus } from "../../../types/UserStatus"; +import type * as serializers from "../../../index"; import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; +import { UserStatus } from "../../../types/UserStatus"; +import { UserAccountDeletedPayloadPayloadData } from "./UserAccountDeletedPayloadPayloadData"; export const UserAccountDeletedPayloadPayload: core.serialization.ObjectSchema< serializers.UserAccountDeletedPayloadPayload.Raw, diff --git a/src/serialization/resources/users/types/UserAccountDeletedPayloadPayloadData.ts b/src/serialization/resources/users/types/UserAccountDeletedPayloadPayloadData.ts index 21a4156e..238c6710 100644 --- a/src/serialization/resources/users/types/UserAccountDeletedPayloadPayloadData.ts +++ b/src/serialization/resources/users/types/UserAccountDeletedPayloadPayloadData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const UserAccountDeletedPayloadPayloadData: core.serialization.ObjectSchema< serializers.UserAccountDeletedPayloadPayloadData.Raw, diff --git a/src/serialization/resources/users/types/UserAccountUpdatedPayload.ts b/src/serialization/resources/users/types/UserAccountUpdatedPayload.ts index 3a1a87d2..c0b2a577 100644 --- a/src/serialization/resources/users/types/UserAccountUpdatedPayload.ts +++ b/src/serialization/resources/users/types/UserAccountUpdatedPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { UserAccountUpdatedPayloadPayload } from "./UserAccountUpdatedPayloadPayload"; export const UserAccountUpdatedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayload.ts b/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayload.ts index d07675a2..88bdde1a 100644 --- a/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayload.ts +++ b/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayload.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import { UserAccountUpdatedPayloadPayloadData } from "./UserAccountUpdatedPayloadPayloadData"; -import { UserStatus } from "../../../types/UserStatus"; +import type * as serializers from "../../../index"; import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; +import { UserStatus } from "../../../types/UserStatus"; +import { UserAccountUpdatedPayloadPayloadData } from "./UserAccountUpdatedPayloadPayloadData"; export const UserAccountUpdatedPayloadPayload: core.serialization.ObjectSchema< serializers.UserAccountUpdatedPayloadPayload.Raw, diff --git a/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts b/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts index ecb5998c..42a481fd 100644 --- a/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts +++ b/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const UserAccountUpdatedPayloadPayloadData: core.serialization.ObjectSchema< serializers.UserAccountUpdatedPayloadPayloadData.Raw, diff --git a/src/serialization/resources/users/types/UsersListRequestSort.ts b/src/serialization/resources/users/types/UsersListRequestSort.ts index 54e734ff..6c687d52 100644 --- a/src/serialization/resources/users/types/UsersListRequestSort.ts +++ b/src/serialization/resources/users/types/UsersListRequestSort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Webflow from "../../../../api/index"; +import type * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; export const UsersListRequestSort: core.serialization.Schema< serializers.UsersListRequestSort.Raw, diff --git a/src/serialization/resources/users/types/index.ts b/src/serialization/resources/users/types/index.ts index 258617f4..38625be7 100644 --- a/src/serialization/resources/users/types/index.ts +++ b/src/serialization/resources/users/types/index.ts @@ -1,10 +1,10 @@ -export * from "./UsersListRequestSort"; -export * from "./UserAccountAddedPayloadPayloadData"; -export * from "./UserAccountAddedPayloadPayload"; export * from "./UserAccountAddedPayload"; -export * from "./UserAccountUpdatedPayloadPayloadData"; -export * from "./UserAccountUpdatedPayloadPayload"; -export * from "./UserAccountUpdatedPayload"; -export * from "./UserAccountDeletedPayloadPayloadData"; -export * from "./UserAccountDeletedPayloadPayload"; +export * from "./UserAccountAddedPayloadPayload"; +export * from "./UserAccountAddedPayloadPayloadData"; export * from "./UserAccountDeletedPayload"; +export * from "./UserAccountDeletedPayloadPayload"; +export * from "./UserAccountDeletedPayloadPayloadData"; +export * from "./UserAccountUpdatedPayload"; +export * from "./UserAccountUpdatedPayloadPayload"; +export * from "./UserAccountUpdatedPayloadPayloadData"; +export * from "./UsersListRequestSort"; diff --git a/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts b/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts index 85417093..c6826f67 100644 --- a/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts +++ b/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const AuditLogsGetWorkspaceAuditLogsRequestEventType: core.serialization.Schema< serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestEventType.Raw, diff --git a/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts b/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts index 2866b8e0..d24aab0a 100644 --- a/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts +++ b/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../index"; -import * as Webflow from "../../../../../../api/index"; +import type * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; +import type * as serializers from "../../../../../index"; export const AuditLogsGetWorkspaceAuditLogsRequestSortOrder: core.serialization.Schema< serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestSortOrder.Raw, diff --git a/src/serialization/resources/workspaces/resources/auditLogs/types/index.ts b/src/serialization/resources/workspaces/resources/auditLogs/types/index.ts index cfaf464d..41fb105c 100644 --- a/src/serialization/resources/workspaces/resources/auditLogs/types/index.ts +++ b/src/serialization/resources/workspaces/resources/auditLogs/types/index.ts @@ -1,2 +1,2 @@ -export * from "./AuditLogsGetWorkspaceAuditLogsRequestSortOrder"; export * from "./AuditLogsGetWorkspaceAuditLogsRequestEventType"; +export * from "./AuditLogsGetWorkspaceAuditLogsRequestSortOrder"; diff --git a/src/serialization/types/AccessGroup.ts b/src/serialization/types/AccessGroup.ts index a468c49d..64b74c06 100644 --- a/src/serialization/types/AccessGroup.ts +++ b/src/serialization/types/AccessGroup.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AccessGroup: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/AccessGroupList.ts b/src/serialization/types/AccessGroupList.ts index c2f27df0..fd104194 100644 --- a/src/serialization/types/AccessGroupList.ts +++ b/src/serialization/types/AccessGroupList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { AccessGroup } from "./AccessGroup"; export const AccessGroupList: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Application.ts b/src/serialization/types/Application.ts index 5a705ef6..06f1b581 100644 --- a/src/serialization/types/Application.ts +++ b/src/serialization/types/Application.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Application: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Asset.ts b/src/serialization/types/Asset.ts index da74fc7d..3c9b0b10 100644 --- a/src/serialization/types/Asset.ts +++ b/src/serialization/types/Asset.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { AssetVariant } from "./AssetVariant"; export const Asset: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/AssetFolder.ts b/src/serialization/types/AssetFolder.ts index 67f88d4c..5229d922 100644 --- a/src/serialization/types/AssetFolder.ts +++ b/src/serialization/types/AssetFolder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AssetFolder: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/AssetFolderList.ts b/src/serialization/types/AssetFolderList.ts index 5ba02b2b..6b585bca 100644 --- a/src/serialization/types/AssetFolderList.ts +++ b/src/serialization/types/AssetFolderList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { AssetFolder } from "./AssetFolder"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/AssetUpload.ts b/src/serialization/types/AssetUpload.ts index 0fe1c171..8eb9929e 100644 --- a/src/serialization/types/AssetUpload.ts +++ b/src/serialization/types/AssetUpload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { AssetUploadUploadDetails } from "./AssetUploadUploadDetails"; export const AssetUpload: core.serialization.ObjectSchema = diff --git a/src/serialization/types/AssetUploadUploadDetails.ts b/src/serialization/types/AssetUploadUploadDetails.ts index 2207ea67..3f8c0ade 100644 --- a/src/serialization/types/AssetUploadUploadDetails.ts +++ b/src/serialization/types/AssetUploadUploadDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AssetUploadUploadDetails: core.serialization.ObjectSchema< serializers.AssetUploadUploadDetails.Raw, diff --git a/src/serialization/types/AssetVariant.ts b/src/serialization/types/AssetVariant.ts index 85fee020..bc12da46 100644 --- a/src/serialization/types/AssetVariant.ts +++ b/src/serialization/types/AssetVariant.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AssetVariant: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Assets.ts b/src/serialization/types/Assets.ts index 14196a1d..0a34543f 100644 --- a/src/serialization/types/Assets.ts +++ b/src/serialization/types/Assets.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Asset } from "./Asset"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/Authorization.ts b/src/serialization/types/Authorization.ts index c1bf5990..0c0f0cbf 100644 --- a/src/serialization/types/Authorization.ts +++ b/src/serialization/types/Authorization.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { AuthorizationAuthorization } from "./AuthorizationAuthorization"; +import type * as serializers from "../index"; import { Application } from "./Application"; +import { AuthorizationAuthorization } from "./AuthorizationAuthorization"; export const Authorization: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/AuthorizationAuthorization.ts b/src/serialization/types/AuthorizationAuthorization.ts index 232124c1..cbbd2997 100644 --- a/src/serialization/types/AuthorizationAuthorization.ts +++ b/src/serialization/types/AuthorizationAuthorization.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { AuthorizationAuthorizationAuthorizedTo } from "./AuthorizationAuthorizationAuthorizedTo"; export const AuthorizationAuthorization: core.serialization.ObjectSchema< diff --git a/src/serialization/types/AuthorizationAuthorizationAuthorizedTo.ts b/src/serialization/types/AuthorizationAuthorizationAuthorizedTo.ts index abcfa91f..36e431cb 100644 --- a/src/serialization/types/AuthorizationAuthorizationAuthorizedTo.ts +++ b/src/serialization/types/AuthorizationAuthorizationAuthorizedTo.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AuthorizationAuthorizationAuthorizedTo: core.serialization.ObjectSchema< serializers.AuthorizationAuthorizationAuthorizedTo.Raw, diff --git a/src/serialization/types/AuthorizedUser.ts b/src/serialization/types/AuthorizedUser.ts index 55607dbb..25c505c6 100644 --- a/src/serialization/types/AuthorizedUser.ts +++ b/src/serialization/types/AuthorizedUser.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AuthorizedUser: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/BadRequestErrorBody.ts b/src/serialization/types/BadRequestErrorBody.ts index a37fbb21..5617c9cf 100644 --- a/src/serialization/types/BadRequestErrorBody.ts +++ b/src/serialization/types/BadRequestErrorBody.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvalidDomain } from "./InvalidDomain"; import { NoDomains } from "./NoDomains"; diff --git a/src/serialization/types/BulkCollectionItem.ts b/src/serialization/types/BulkCollectionItem.ts index f84884e8..00f73fd2 100644 --- a/src/serialization/types/BulkCollectionItem.ts +++ b/src/serialization/types/BulkCollectionItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BulkCollectionItemFieldData } from "./BulkCollectionItemFieldData"; export const BulkCollectionItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BulkCollectionItemFieldData.ts b/src/serialization/types/BulkCollectionItemFieldData.ts index 267c676a..9c69f648 100644 --- a/src/serialization/types/BulkCollectionItemFieldData.ts +++ b/src/serialization/types/BulkCollectionItemFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BulkCollectionItemFieldData: core.serialization.ObjectSchema< serializers.BulkCollectionItemFieldData.Raw, diff --git a/src/serialization/types/Collection.ts b/src/serialization/types/Collection.ts index 9075f7d3..9e3b601b 100644 --- a/src/serialization/types/Collection.ts +++ b/src/serialization/types/Collection.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Field } from "./Field"; export const Collection: core.serialization.ObjectSchema = diff --git a/src/serialization/types/CollectionItem.ts b/src/serialization/types/CollectionItem.ts index b744b3b0..ef999b2c 100644 --- a/src/serialization/types/CollectionItem.ts +++ b/src/serialization/types/CollectionItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItemFieldData } from "./CollectionItemFieldData"; export const CollectionItem: core.serialization.ObjectSchema = diff --git a/src/serialization/types/CollectionItemChanged.ts b/src/serialization/types/CollectionItemChanged.ts index 93bad748..ba6295e8 100644 --- a/src/serialization/types/CollectionItemChanged.ts +++ b/src/serialization/types/CollectionItemChanged.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SingleLocaleCreatedPayload } from "./SingleLocaleCreatedPayload"; export const CollectionItemChanged: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemCreated.ts b/src/serialization/types/CollectionItemCreated.ts index 0d508596..3aefef03 100644 --- a/src/serialization/types/CollectionItemCreated.ts +++ b/src/serialization/types/CollectionItemCreated.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SingleLocaleCreatedPayload } from "./SingleLocaleCreatedPayload"; export const CollectionItemCreated: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemFieldData.ts b/src/serialization/types/CollectionItemFieldData.ts index 387dbaaa..905a3bee 100644 --- a/src/serialization/types/CollectionItemFieldData.ts +++ b/src/serialization/types/CollectionItemFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CollectionItemFieldData: core.serialization.ObjectSchema< serializers.CollectionItemFieldData.Raw, diff --git a/src/serialization/types/CollectionItemList.ts b/src/serialization/types/CollectionItemList.ts index 475bcbb6..e807f1c9 100644 --- a/src/serialization/types/CollectionItemList.ts +++ b/src/serialization/types/CollectionItemList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItem } from "./CollectionItem"; import { CollectionItemListPagination } from "./CollectionItemListPagination"; diff --git a/src/serialization/types/CollectionItemListNoPagination.ts b/src/serialization/types/CollectionItemListNoPagination.ts index 80bc4d76..f83766ce 100644 --- a/src/serialization/types/CollectionItemListNoPagination.ts +++ b/src/serialization/types/CollectionItemListNoPagination.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItem } from "./CollectionItem"; export const CollectionItemListNoPagination: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemListPagination.ts b/src/serialization/types/CollectionItemListPagination.ts index 840a77ad..8dc8ed53 100644 --- a/src/serialization/types/CollectionItemListPagination.ts +++ b/src/serialization/types/CollectionItemListPagination.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CollectionItemListPagination: core.serialization.ObjectSchema< serializers.CollectionItemListPagination.Raw, diff --git a/src/serialization/types/CollectionItemPatchSingle.ts b/src/serialization/types/CollectionItemPatchSingle.ts index 401794ec..b5a48041 100644 --- a/src/serialization/types/CollectionItemPatchSingle.ts +++ b/src/serialization/types/CollectionItemPatchSingle.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItemPatchSingleFieldData } from "./CollectionItemPatchSingleFieldData"; export const CollectionItemPatchSingle: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemPatchSingleFieldData.ts b/src/serialization/types/CollectionItemPatchSingleFieldData.ts index 17aef009..1f524cf1 100644 --- a/src/serialization/types/CollectionItemPatchSingleFieldData.ts +++ b/src/serialization/types/CollectionItemPatchSingleFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CollectionItemPatchSingleFieldData: core.serialization.ObjectSchema< serializers.CollectionItemPatchSingleFieldData.Raw, diff --git a/src/serialization/types/CollectionItemPostSingle.ts b/src/serialization/types/CollectionItemPostSingle.ts index 7991fcb6..0ff73f6f 100644 --- a/src/serialization/types/CollectionItemPostSingle.ts +++ b/src/serialization/types/CollectionItemPostSingle.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItemPostSingleFieldData } from "./CollectionItemPostSingleFieldData"; export const CollectionItemPostSingle: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemPostSingleFieldData.ts b/src/serialization/types/CollectionItemPostSingleFieldData.ts index a5125e94..3f8542c4 100644 --- a/src/serialization/types/CollectionItemPostSingleFieldData.ts +++ b/src/serialization/types/CollectionItemPostSingleFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CollectionItemPostSingleFieldData: core.serialization.ObjectSchema< serializers.CollectionItemPostSingleFieldData.Raw, diff --git a/src/serialization/types/CollectionItemPublished.ts b/src/serialization/types/CollectionItemPublished.ts index dd096d58..794ad685 100644 --- a/src/serialization/types/CollectionItemPublished.ts +++ b/src/serialization/types/CollectionItemPublished.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Payload } from "./Payload"; export const CollectionItemPublished: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemRemoved.ts b/src/serialization/types/CollectionItemRemoved.ts index e5320343..d7ab7e89 100644 --- a/src/serialization/types/CollectionItemRemoved.ts +++ b/src/serialization/types/CollectionItemRemoved.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItemRemovedPayload } from "./CollectionItemRemovedPayload"; export const CollectionItemRemoved: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemRemovedPayload.ts b/src/serialization/types/CollectionItemRemovedPayload.ts index a9c07d47..91912f2b 100644 --- a/src/serialization/types/CollectionItemRemovedPayload.ts +++ b/src/serialization/types/CollectionItemRemovedPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItemRemovedPayloadFieldData } from "./CollectionItemRemovedPayloadFieldData"; export const CollectionItemRemovedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemRemovedPayloadFieldData.ts b/src/serialization/types/CollectionItemRemovedPayloadFieldData.ts index 9bf7296c..4eba5773 100644 --- a/src/serialization/types/CollectionItemRemovedPayloadFieldData.ts +++ b/src/serialization/types/CollectionItemRemovedPayloadFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CollectionItemRemovedPayloadFieldData: core.serialization.ObjectSchema< serializers.CollectionItemRemovedPayloadFieldData.Raw, diff --git a/src/serialization/types/CollectionItemUnpublished.ts b/src/serialization/types/CollectionItemUnpublished.ts index 384b1f28..4f1a4d9a 100644 --- a/src/serialization/types/CollectionItemUnpublished.ts +++ b/src/serialization/types/CollectionItemUnpublished.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItemUnpublishedPayload } from "./CollectionItemUnpublishedPayload"; export const CollectionItemUnpublished: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemUnpublishedPayload.ts b/src/serialization/types/CollectionItemUnpublishedPayload.ts index 2c3c9f63..62fb4a1d 100644 --- a/src/serialization/types/CollectionItemUnpublishedPayload.ts +++ b/src/serialization/types/CollectionItemUnpublishedPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItemUnpublishedPayloadFieldData } from "./CollectionItemUnpublishedPayloadFieldData"; export const CollectionItemUnpublishedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemUnpublishedPayloadFieldData.ts b/src/serialization/types/CollectionItemUnpublishedPayloadFieldData.ts index 8bcfc545..fffffa28 100644 --- a/src/serialization/types/CollectionItemUnpublishedPayloadFieldData.ts +++ b/src/serialization/types/CollectionItemUnpublishedPayloadFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CollectionItemUnpublishedPayloadFieldData: core.serialization.ObjectSchema< serializers.CollectionItemUnpublishedPayloadFieldData.Raw, diff --git a/src/serialization/types/CollectionItemWithIdInput.ts b/src/serialization/types/CollectionItemWithIdInput.ts index 5bb61e20..d40e2e55 100644 --- a/src/serialization/types/CollectionItemWithIdInput.ts +++ b/src/serialization/types/CollectionItemWithIdInput.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionItemWithIdInputFieldData } from "./CollectionItemWithIdInputFieldData"; export const CollectionItemWithIdInput: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemWithIdInputFieldData.ts b/src/serialization/types/CollectionItemWithIdInputFieldData.ts index e3af0be8..d59e0709 100644 --- a/src/serialization/types/CollectionItemWithIdInputFieldData.ts +++ b/src/serialization/types/CollectionItemWithIdInputFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CollectionItemWithIdInputFieldData: core.serialization.ObjectSchema< serializers.CollectionItemWithIdInputFieldData.Raw, diff --git a/src/serialization/types/CollectionList.ts b/src/serialization/types/CollectionList.ts index 6dc49a6f..e8d6c763 100644 --- a/src/serialization/types/CollectionList.ts +++ b/src/serialization/types/CollectionList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CollectionListArrayItem } from "./CollectionListArrayItem"; export const CollectionList: core.serialization.ObjectSchema = diff --git a/src/serialization/types/CollectionListArrayItem.ts b/src/serialization/types/CollectionListArrayItem.ts index 2acdf4d0..6bd8ebfd 100644 --- a/src/serialization/types/CollectionListArrayItem.ts +++ b/src/serialization/types/CollectionListArrayItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CollectionListArrayItem: core.serialization.ObjectSchema< serializers.CollectionListArrayItem.Raw, diff --git a/src/serialization/types/Comment.ts b/src/serialization/types/Comment.ts index cfe42f0c..f4708692 100644 --- a/src/serialization/types/Comment.ts +++ b/src/serialization/types/Comment.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CommentPayload } from "./CommentPayload"; export const Comment: core.serialization.ObjectSchema = diff --git a/src/serialization/types/CommentPayload.ts b/src/serialization/types/CommentPayload.ts index 0e7d17ef..5bbda6da 100644 --- a/src/serialization/types/CommentPayload.ts +++ b/src/serialization/types/CommentPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CommentPayloadAuthor } from "./CommentPayloadAuthor"; import { CommentPayloadMentionedUsersItem } from "./CommentPayloadMentionedUsersItem"; diff --git a/src/serialization/types/CommentPayloadAuthor.ts b/src/serialization/types/CommentPayloadAuthor.ts index 27533914..716f6b96 100644 --- a/src/serialization/types/CommentPayloadAuthor.ts +++ b/src/serialization/types/CommentPayloadAuthor.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CommentPayloadAuthor: core.serialization.ObjectSchema< serializers.CommentPayloadAuthor.Raw, diff --git a/src/serialization/types/CommentPayloadMentionedUsersItem.ts b/src/serialization/types/CommentPayloadMentionedUsersItem.ts index c7b383c8..020d18c6 100644 --- a/src/serialization/types/CommentPayloadMentionedUsersItem.ts +++ b/src/serialization/types/CommentPayloadMentionedUsersItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CommentPayloadMentionedUsersItem: core.serialization.ObjectSchema< serializers.CommentPayloadMentionedUsersItem.Raw, diff --git a/src/serialization/types/CommentReply.ts b/src/serialization/types/CommentReply.ts index 5e8c0c18..9d39797c 100644 --- a/src/serialization/types/CommentReply.ts +++ b/src/serialization/types/CommentReply.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CommentReplyAuthor } from "./CommentReplyAuthor"; import { CommentReplyMentionedUsersItem } from "./CommentReplyMentionedUsersItem"; diff --git a/src/serialization/types/CommentReplyAuthor.ts b/src/serialization/types/CommentReplyAuthor.ts index d27aad58..2274b523 100644 --- a/src/serialization/types/CommentReplyAuthor.ts +++ b/src/serialization/types/CommentReplyAuthor.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CommentReplyAuthor: core.serialization.ObjectSchema< serializers.CommentReplyAuthor.Raw, diff --git a/src/serialization/types/CommentReplyList.ts b/src/serialization/types/CommentReplyList.ts index b06554ac..30952023 100644 --- a/src/serialization/types/CommentReplyList.ts +++ b/src/serialization/types/CommentReplyList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CommentReply } from "./CommentReply"; import { CommentReplyListPagination } from "./CommentReplyListPagination"; diff --git a/src/serialization/types/CommentReplyListPagination.ts b/src/serialization/types/CommentReplyListPagination.ts index 162c6ee0..151251e6 100644 --- a/src/serialization/types/CommentReplyListPagination.ts +++ b/src/serialization/types/CommentReplyListPagination.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CommentReplyListPagination: core.serialization.ObjectSchema< serializers.CommentReplyListPagination.Raw, diff --git a/src/serialization/types/CommentReplyMentionedUsersItem.ts b/src/serialization/types/CommentReplyMentionedUsersItem.ts index 9428f294..930dfa29 100644 --- a/src/serialization/types/CommentReplyMentionedUsersItem.ts +++ b/src/serialization/types/CommentReplyMentionedUsersItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CommentReplyMentionedUsersItem: core.serialization.ObjectSchema< serializers.CommentReplyMentionedUsersItem.Raw, diff --git a/src/serialization/types/CommentThread.ts b/src/serialization/types/CommentThread.ts index 858a4782..d9efd1f1 100644 --- a/src/serialization/types/CommentThread.ts +++ b/src/serialization/types/CommentThread.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CommentThreadAuthor } from "./CommentThreadAuthor"; import { CommentThreadMentionedUsersItem } from "./CommentThreadMentionedUsersItem"; diff --git a/src/serialization/types/CommentThreadAuthor.ts b/src/serialization/types/CommentThreadAuthor.ts index 9f7b9439..af16553b 100644 --- a/src/serialization/types/CommentThreadAuthor.ts +++ b/src/serialization/types/CommentThreadAuthor.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CommentThreadAuthor: core.serialization.ObjectSchema< serializers.CommentThreadAuthor.Raw, diff --git a/src/serialization/types/CommentThreadList.ts b/src/serialization/types/CommentThreadList.ts index 4ebc968b..c9fb99fe 100644 --- a/src/serialization/types/CommentThreadList.ts +++ b/src/serialization/types/CommentThreadList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CommentThread } from "./CommentThread"; import { CommentThreadListPagination } from "./CommentThreadListPagination"; diff --git a/src/serialization/types/CommentThreadListPagination.ts b/src/serialization/types/CommentThreadListPagination.ts index 4f4d85be..b054373f 100644 --- a/src/serialization/types/CommentThreadListPagination.ts +++ b/src/serialization/types/CommentThreadListPagination.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CommentThreadListPagination: core.serialization.ObjectSchema< serializers.CommentThreadListPagination.Raw, diff --git a/src/serialization/types/CommentThreadMentionedUsersItem.ts b/src/serialization/types/CommentThreadMentionedUsersItem.ts index 6867e9a6..dba8924c 100644 --- a/src/serialization/types/CommentThreadMentionedUsersItem.ts +++ b/src/serialization/types/CommentThreadMentionedUsersItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CommentThreadMentionedUsersItem: core.serialization.ObjectSchema< serializers.CommentThreadMentionedUsersItem.Raw, diff --git a/src/serialization/types/Component.ts b/src/serialization/types/Component.ts index fb8ce0b7..9763fe40 100644 --- a/src/serialization/types/Component.ts +++ b/src/serialization/types/Component.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Component: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/ComponentDom.ts b/src/serialization/types/ComponentDom.ts index b46b6d96..38e207af 100644 --- a/src/serialization/types/ComponentDom.ts +++ b/src/serialization/types/ComponentDom.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Node } from "./Node"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts b/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts index b8c3596b..fb762386 100644 --- a/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts +++ b/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem } from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; export const ComponentInstanceNodePropertyOverridesWrite: core.serialization.ObjectSchema< diff --git a/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts b/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts index 25f155f6..34c069ef 100644 --- a/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts +++ b/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem: core.serialization.ObjectSchema< serializers.ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.Raw, diff --git a/src/serialization/types/ComponentList.ts b/src/serialization/types/ComponentList.ts index 00d800e8..7adb4c2e 100644 --- a/src/serialization/types/ComponentList.ts +++ b/src/serialization/types/ComponentList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Component } from "./Component"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/ComponentNode.ts b/src/serialization/types/ComponentNode.ts index ac0e54c9..e9603f99 100644 --- a/src/serialization/types/ComponentNode.ts +++ b/src/serialization/types/ComponentNode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ComponentProperty } from "./ComponentProperty"; export const ComponentNode: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ComponentProperties.ts b/src/serialization/types/ComponentProperties.ts index ab8038a5..6fee89bf 100644 --- a/src/serialization/types/ComponentProperties.ts +++ b/src/serialization/types/ComponentProperties.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ComponentProperty } from "./ComponentProperty"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/ComponentProperty.ts b/src/serialization/types/ComponentProperty.ts index fc1fa626..c0fce8d6 100644 --- a/src/serialization/types/ComponentProperty.ts +++ b/src/serialization/types/ComponentProperty.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ComponentPropertyType } from "./ComponentPropertyType"; import { Text } from "./Text"; diff --git a/src/serialization/types/ComponentPropertyType.ts b/src/serialization/types/ComponentPropertyType.ts index 808cd3b5..654a85ae 100644 --- a/src/serialization/types/ComponentPropertyType.ts +++ b/src/serialization/types/ComponentPropertyType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ComponentPropertyType: core.serialization.Schema< serializers.ComponentPropertyType.Raw, diff --git a/src/serialization/types/Conflict.ts b/src/serialization/types/Conflict.ts index 5ba4873e..f2c8a2bf 100644 --- a/src/serialization/types/Conflict.ts +++ b/src/serialization/types/Conflict.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Conflict: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/ConflictErrorBody.ts b/src/serialization/types/ConflictErrorBody.ts index 11c1161e..cce5bdcc 100644 --- a/src/serialization/types/ConflictErrorBody.ts +++ b/src/serialization/types/ConflictErrorBody.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DuplicateUserEmail } from "./DuplicateUserEmail"; import { UserLimitReached } from "./UserLimitReached"; diff --git a/src/serialization/types/CustomCodeBlock.ts b/src/serialization/types/CustomCodeBlock.ts index fe5d22c2..6b7d0d03 100644 --- a/src/serialization/types/CustomCodeBlock.ts +++ b/src/serialization/types/CustomCodeBlock.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomCodeBlockType } from "./CustomCodeBlockType"; import { Scripts } from "./Scripts"; -import { ScriptApply } from "./ScriptApply"; export const CustomCodeBlock: core.serialization.ObjectSchema< serializers.CustomCodeBlock.Raw, diff --git a/src/serialization/types/CustomCodeBlockType.ts b/src/serialization/types/CustomCodeBlockType.ts index 19189c8b..076a7a20 100644 --- a/src/serialization/types/CustomCodeBlockType.ts +++ b/src/serialization/types/CustomCodeBlockType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomCodeBlockType: core.serialization.Schema< serializers.CustomCodeBlockType.Raw, diff --git a/src/serialization/types/CustomCodeHostedResponse.ts b/src/serialization/types/CustomCodeHostedResponse.ts index a03b60d3..78e81122 100644 --- a/src/serialization/types/CustomCodeHostedResponse.ts +++ b/src/serialization/types/CustomCodeHostedResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomCodeHostedResponse: core.serialization.ObjectSchema< serializers.CustomCodeHostedResponse.Raw, diff --git a/src/serialization/types/CustomCodeInlineResponse.ts b/src/serialization/types/CustomCodeInlineResponse.ts index 3e2fe040..be9f6997 100644 --- a/src/serialization/types/CustomCodeInlineResponse.ts +++ b/src/serialization/types/CustomCodeInlineResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomCodeInlineResponse: core.serialization.ObjectSchema< serializers.CustomCodeInlineResponse.Raw, diff --git a/src/serialization/types/CustomRole.ts b/src/serialization/types/CustomRole.ts index d0383251..1fa03c7d 100644 --- a/src/serialization/types/CustomRole.ts +++ b/src/serialization/types/CustomRole.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomRole: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CustomRoleAuditLogItem.ts b/src/serialization/types/CustomRoleAuditLogItem.ts index 400d6e07..3b2b4755 100644 --- a/src/serialization/types/CustomRoleAuditLogItem.ts +++ b/src/serialization/types/CustomRoleAuditLogItem.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { CustomRoleAuditLogItemEventSubType } from "./CustomRoleAuditLogItemEventSubType"; +import type * as serializers from "../index"; import { CustomRole } from "./CustomRole"; +import { CustomRoleAuditLogItemEventSubType } from "./CustomRoleAuditLogItemEventSubType"; export const CustomRoleAuditLogItem: core.serialization.ObjectSchema< serializers.CustomRoleAuditLogItem.Raw, diff --git a/src/serialization/types/CustomRoleAuditLogItemEventSubType.ts b/src/serialization/types/CustomRoleAuditLogItemEventSubType.ts index 1c7f4925..13dcb460 100644 --- a/src/serialization/types/CustomRoleAuditLogItemEventSubType.ts +++ b/src/serialization/types/CustomRoleAuditLogItemEventSubType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomRoleAuditLogItemEventSubType: core.serialization.Schema< serializers.CustomRoleAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/Dom.ts b/src/serialization/types/Dom.ts index 1e9191ca..a9b09d23 100644 --- a/src/serialization/types/Dom.ts +++ b/src/serialization/types/Dom.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Node } from "./Node"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/Domain.ts b/src/serialization/types/Domain.ts index 8e1db208..a8fdd430 100644 --- a/src/serialization/types/Domain.ts +++ b/src/serialization/types/Domain.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Domain: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Domains.ts b/src/serialization/types/Domains.ts index 945ae35c..f1adf425 100644 --- a/src/serialization/types/Domains.ts +++ b/src/serialization/types/Domains.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Domain } from "./Domain"; export const Domains: core.serialization.ObjectSchema = diff --git a/src/serialization/types/DuplicateUserEmail.ts b/src/serialization/types/DuplicateUserEmail.ts index 2444c7b0..1e930a19 100644 --- a/src/serialization/types/DuplicateUserEmail.ts +++ b/src/serialization/types/DuplicateUserEmail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DuplicateUserEmail: core.serialization.Schema< serializers.DuplicateUserEmail.Raw, diff --git a/src/serialization/types/EcommerceSettings.ts b/src/serialization/types/EcommerceSettings.ts index f3a702b2..4c62c909 100644 --- a/src/serialization/types/EcommerceSettings.ts +++ b/src/serialization/types/EcommerceSettings.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const EcommerceSettings: core.serialization.ObjectSchema< serializers.EcommerceSettings.Raw, diff --git a/src/serialization/types/ErrorCode.ts b/src/serialization/types/ErrorCode.ts index 3f389c28..36e3fe74 100644 --- a/src/serialization/types/ErrorCode.ts +++ b/src/serialization/types/ErrorCode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ErrorCode: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/Error_.ts b/src/serialization/types/Error_.ts index 1f0b2f9a..cfc822dc 100644 --- a/src/serialization/types/Error_.ts +++ b/src/serialization/types/Error_.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ErrorCode } from "./ErrorCode"; export const Error_: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Field.ts b/src/serialization/types/Field.ts index 5ff572c2..bc0393f1 100644 --- a/src/serialization/types/Field.ts +++ b/src/serialization/types/Field.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FieldType } from "./FieldType"; import { FieldValidations } from "./FieldValidations"; diff --git a/src/serialization/types/FieldCreate.ts b/src/serialization/types/FieldCreate.ts index 1de23f4f..77024f79 100644 --- a/src/serialization/types/FieldCreate.ts +++ b/src/serialization/types/FieldCreate.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { StaticField } from "./StaticField"; +import type * as serializers from "../index"; import { OptionField } from "./OptionField"; import { ReferenceField } from "./ReferenceField"; +import { StaticField } from "./StaticField"; export const FieldCreate: core.serialization.Schema = core.serialization.undiscriminatedUnion([StaticField, OptionField, ReferenceField]); diff --git a/src/serialization/types/FieldType.ts b/src/serialization/types/FieldType.ts index cf674fc2..16357cf0 100644 --- a/src/serialization/types/FieldType.ts +++ b/src/serialization/types/FieldType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FieldType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/FieldValidations.ts b/src/serialization/types/FieldValidations.ts index 37080409..5728014c 100644 --- a/src/serialization/types/FieldValidations.ts +++ b/src/serialization/types/FieldValidations.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FieldValidationsAdditionalProperties } from "./FieldValidationsAdditionalProperties"; export const FieldValidations: core.serialization.ObjectSchema< diff --git a/src/serialization/types/FieldValidationsAdditionalProperties.ts b/src/serialization/types/FieldValidationsAdditionalProperties.ts index a1f33741..4331fb42 100644 --- a/src/serialization/types/FieldValidationsAdditionalProperties.ts +++ b/src/serialization/types/FieldValidationsAdditionalProperties.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FieldValidationsAdditionalPropertiesAdditionalProperties } from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; export const FieldValidationsAdditionalProperties: core.serialization.Schema< diff --git a/src/serialization/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts b/src/serialization/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts index 8d75dec8..0fb06eaa 100644 --- a/src/serialization/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts +++ b/src/serialization/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FieldValidationsAdditionalPropertiesAdditionalProperties: core.serialization.ObjectSchema< serializers.FieldValidationsAdditionalPropertiesAdditionalProperties.Raw, diff --git a/src/serialization/types/ForbiddenErrorBody.ts b/src/serialization/types/ForbiddenErrorBody.ts index 32edae7e..40c3c7bc 100644 --- a/src/serialization/types/ForbiddenErrorBody.ts +++ b/src/serialization/types/ForbiddenErrorBody.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvalidScopes } from "./InvalidScopes"; import { UsersNotEnabled } from "./UsersNotEnabled"; diff --git a/src/serialization/types/Form.ts b/src/serialization/types/Form.ts index ae0ecbcc..795e8ed0 100644 --- a/src/serialization/types/Form.ts +++ b/src/serialization/types/Form.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FormField } from "./FormField"; import { FormResponseSettings } from "./FormResponseSettings"; -import { FormFieldValue } from "./FormFieldValue"; export const Form: core.serialization.ObjectSchema = core.serialization.object({ displayName: core.serialization.string().optional(), diff --git a/src/serialization/types/FormField.ts b/src/serialization/types/FormField.ts index b6691873..a6f10222 100644 --- a/src/serialization/types/FormField.ts +++ b/src/serialization/types/FormField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FormFieldValue } from "./FormFieldValue"; export const FormField: core.serialization.Schema = diff --git a/src/serialization/types/FormFieldValue.ts b/src/serialization/types/FormFieldValue.ts index 62894755..4fc03633 100644 --- a/src/serialization/types/FormFieldValue.ts +++ b/src/serialization/types/FormFieldValue.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FormFieldValueType } from "./FormFieldValueType"; export const FormFieldValue: core.serialization.ObjectSchema = diff --git a/src/serialization/types/FormFieldValueType.ts b/src/serialization/types/FormFieldValueType.ts index 898f16de..4ecb9a5d 100644 --- a/src/serialization/types/FormFieldValueType.ts +++ b/src/serialization/types/FormFieldValueType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FormFieldValueType: core.serialization.Schema< serializers.FormFieldValueType.Raw, diff --git a/src/serialization/types/FormList.ts b/src/serialization/types/FormList.ts index cc171f16..fdc54d82 100644 --- a/src/serialization/types/FormList.ts +++ b/src/serialization/types/FormList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Form } from "./Form"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/FormResponseSettings.ts b/src/serialization/types/FormResponseSettings.ts index 0b6f3f6f..1ef9ebc8 100644 --- a/src/serialization/types/FormResponseSettings.ts +++ b/src/serialization/types/FormResponseSettings.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FormResponseSettings: core.serialization.ObjectSchema< serializers.FormResponseSettings.Raw, diff --git a/src/serialization/types/FormSubmission.ts b/src/serialization/types/FormSubmission.ts index f56e5948..d091353d 100644 --- a/src/serialization/types/FormSubmission.ts +++ b/src/serialization/types/FormSubmission.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FormSubmission: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/FormSubmissionList.ts b/src/serialization/types/FormSubmissionList.ts index 4628143b..faedc5a9 100644 --- a/src/serialization/types/FormSubmissionList.ts +++ b/src/serialization/types/FormSubmissionList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FormSubmission } from "./FormSubmission"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/FormSubmissionTrigger.ts b/src/serialization/types/FormSubmissionTrigger.ts index 57cdd891..82e415d4 100644 --- a/src/serialization/types/FormSubmissionTrigger.ts +++ b/src/serialization/types/FormSubmissionTrigger.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FormSubmissionTriggerPayload } from "./FormSubmissionTriggerPayload"; export const FormSubmissionTrigger: core.serialization.ObjectSchema< diff --git a/src/serialization/types/FormSubmissionTriggerPayload.ts b/src/serialization/types/FormSubmissionTriggerPayload.ts index 8613025a..e0e7f9a9 100644 --- a/src/serialization/types/FormSubmissionTriggerPayload.ts +++ b/src/serialization/types/FormSubmissionTriggerPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FormSubmissionTriggerPayloadSchemaItem } from "./FormSubmissionTriggerPayloadSchemaItem"; export const FormSubmissionTriggerPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/types/FormSubmissionTriggerPayloadSchemaItem.ts b/src/serialization/types/FormSubmissionTriggerPayloadSchemaItem.ts index b7e170e3..65cc474f 100644 --- a/src/serialization/types/FormSubmissionTriggerPayloadSchemaItem.ts +++ b/src/serialization/types/FormSubmissionTriggerPayloadSchemaItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FormSubmissionTriggerPayloadSchemaItemFieldType } from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; export const FormSubmissionTriggerPayloadSchemaItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts b/src/serialization/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts index d9d3915c..c1d2faf7 100644 --- a/src/serialization/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts +++ b/src/serialization/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FormSubmissionTriggerPayloadSchemaItemFieldType: core.serialization.Schema< serializers.FormSubmissionTriggerPayloadSchemaItemFieldType.Raw, diff --git a/src/serialization/types/ImageNode.ts b/src/serialization/types/ImageNode.ts index a95eb1b7..5b03ec57 100644 --- a/src/serialization/types/ImageNode.ts +++ b/src/serialization/types/ImageNode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ImageNodeImage } from "./ImageNodeImage"; export const ImageNode: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ImageNodeImage.ts b/src/serialization/types/ImageNodeImage.ts index ef4340f4..e0e2c933 100644 --- a/src/serialization/types/ImageNodeImage.ts +++ b/src/serialization/types/ImageNodeImage.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ImageNodeImage: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/InvalidDomain.ts b/src/serialization/types/InvalidDomain.ts index ad4832a8..6bacd931 100644 --- a/src/serialization/types/InvalidDomain.ts +++ b/src/serialization/types/InvalidDomain.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvalidDomain: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/InvalidScopes.ts b/src/serialization/types/InvalidScopes.ts index e33b236f..5e0e0a6a 100644 --- a/src/serialization/types/InvalidScopes.ts +++ b/src/serialization/types/InvalidScopes.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvalidScopes: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/InventoryItem.ts b/src/serialization/types/InventoryItem.ts index 8c04d934..05beae46 100644 --- a/src/serialization/types/InventoryItem.ts +++ b/src/serialization/types/InventoryItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InventoryItemInventoryType } from "./InventoryItemInventoryType"; export const InventoryItem: core.serialization.ObjectSchema = diff --git a/src/serialization/types/InventoryItemInventoryType.ts b/src/serialization/types/InventoryItemInventoryType.ts index 6509ef29..26dbaf75 100644 --- a/src/serialization/types/InventoryItemInventoryType.ts +++ b/src/serialization/types/InventoryItemInventoryType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InventoryItemInventoryType: core.serialization.Schema< serializers.InventoryItemInventoryType.Raw, diff --git a/src/serialization/types/ItemsListItemsLiveRequestLastPublished.ts b/src/serialization/types/ItemsListItemsLiveRequestLastPublished.ts index 1389d533..65fbf435 100644 --- a/src/serialization/types/ItemsListItemsLiveRequestLastPublished.ts +++ b/src/serialization/types/ItemsListItemsLiveRequestLastPublished.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ItemsListItemsLiveRequestLastPublished: core.serialization.ObjectSchema< serializers.ItemsListItemsLiveRequestLastPublished.Raw, diff --git a/src/serialization/types/ItemsListItemsRequestLastPublished.ts b/src/serialization/types/ItemsListItemsRequestLastPublished.ts index c15212f3..0df27009 100644 --- a/src/serialization/types/ItemsListItemsRequestLastPublished.ts +++ b/src/serialization/types/ItemsListItemsRequestLastPublished.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ItemsListItemsRequestLastPublished: core.serialization.ObjectSchema< serializers.ItemsListItemsRequestLastPublished.Raw, diff --git a/src/serialization/types/ListCustomCodeBlocks.ts b/src/serialization/types/ListCustomCodeBlocks.ts index a08eeb41..7ecdbde4 100644 --- a/src/serialization/types/ListCustomCodeBlocks.ts +++ b/src/serialization/types/ListCustomCodeBlocks.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomCodeBlock } from "./CustomCodeBlock"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/Locale.ts b/src/serialization/types/Locale.ts index 4c65e9f9..8c3b4f99 100644 --- a/src/serialization/types/Locale.ts +++ b/src/serialization/types/Locale.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Locale: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Locales.ts b/src/serialization/types/Locales.ts index 331b2369..b12738b7 100644 --- a/src/serialization/types/Locales.ts +++ b/src/serialization/types/Locales.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Locale } from "./Locale"; export const Locales: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Metadata.ts b/src/serialization/types/Metadata.ts index b5718a3d..59a82bd7 100644 --- a/src/serialization/types/Metadata.ts +++ b/src/serialization/types/Metadata.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { MetadataOptionsItem } from "./MetadataOptionsItem"; export const Metadata: core.serialization.ObjectSchema = diff --git a/src/serialization/types/MetadataOptionsItem.ts b/src/serialization/types/MetadataOptionsItem.ts index 062ee622..76b6ce9a 100644 --- a/src/serialization/types/MetadataOptionsItem.ts +++ b/src/serialization/types/MetadataOptionsItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MetadataOptionsItem: core.serialization.ObjectSchema< serializers.MetadataOptionsItem.Raw, diff --git a/src/serialization/types/NewOrder.ts b/src/serialization/types/NewOrder.ts index 336ff8da..828eefc3 100644 --- a/src/serialization/types/NewOrder.ts +++ b/src/serialization/types/NewOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Order } from "./Order"; export const NewOrder: core.serialization.ObjectSchema = diff --git a/src/serialization/types/NoDomains.ts b/src/serialization/types/NoDomains.ts index fd176b87..a8fd4d23 100644 --- a/src/serialization/types/NoDomains.ts +++ b/src/serialization/types/NoDomains.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const NoDomains: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/Node.ts b/src/serialization/types/Node.ts index dc6acf73..50c5efbc 100644 --- a/src/serialization/types/Node.ts +++ b/src/serialization/types/Node.ts @@ -1,17 +1,15 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { TextNode } from "./TextNode"; -import { ImageNode } from "./ImageNode"; +import type * as serializers from "../index"; import { ComponentNode } from "./ComponentNode"; -import { TextInputNode } from "./TextInputNode"; +import { ImageNode } from "./ImageNode"; +import { SearchButtonNode } from "./SearchButtonNode"; import { SelectNode } from "./SelectNode"; import { SubmitButtonNode } from "./SubmitButtonNode"; -import { SearchButtonNode } from "./SearchButtonNode"; +import { TextInputNode } from "./TextInputNode"; +import { TextNode } from "./TextNode"; export const Node: core.serialization.Schema = core.serialization .union("type", { diff --git a/src/serialization/types/NotEnterprisePlanSite.ts b/src/serialization/types/NotEnterprisePlanSite.ts index 6e0fcb72..2f1be62f 100644 --- a/src/serialization/types/NotEnterprisePlanSite.ts +++ b/src/serialization/types/NotEnterprisePlanSite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const NotEnterprisePlanSite: core.serialization.Schema< serializers.NotEnterprisePlanSite.Raw, diff --git a/src/serialization/types/NotEnterprisePlanWorkspace.ts b/src/serialization/types/NotEnterprisePlanWorkspace.ts index 566e4a60..537cb9e1 100644 --- a/src/serialization/types/NotEnterprisePlanWorkspace.ts +++ b/src/serialization/types/NotEnterprisePlanWorkspace.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const NotEnterprisePlanWorkspace: core.serialization.Schema< serializers.NotEnterprisePlanWorkspace.Raw, diff --git a/src/serialization/types/OptionField.ts b/src/serialization/types/OptionField.ts index 711e63d2..beb1b9a7 100644 --- a/src/serialization/types/OptionField.ts +++ b/src/serialization/types/OptionField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Metadata } from "./Metadata"; export const OptionField: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Order.ts b/src/serialization/types/Order.ts index 2bfe0cb3..f8ea7ff8 100644 --- a/src/serialization/types/Order.ts +++ b/src/serialization/types/Order.ts @@ -1,24 +1,22 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { OrderStatus } from "./OrderStatus"; -import { OrderDisputeLastStatus } from "./OrderDisputeLastStatus"; -import { OrderPrice } from "./OrderPrice"; +import type * as serializers from "../index"; import { OrderAddress } from "./OrderAddress"; -import { OrderShippingAddress } from "./OrderShippingAddress"; import { OrderBillingAddress } from "./OrderBillingAddress"; import { OrderCustomerInfo } from "./OrderCustomerInfo"; -import { OrderPurchasedItem } from "./OrderPurchasedItem"; -import { StripeDetails } from "./StripeDetails"; -import { StripeCard } from "./StripeCard"; -import { PaypalDetails } from "./PaypalDetails"; +import { OrderDisputeLastStatus } from "./OrderDisputeLastStatus"; +import { OrderDownloadFilesItem } from "./OrderDownloadFilesItem"; import { OrderMetadata } from "./OrderMetadata"; +import { OrderPrice } from "./OrderPrice"; +import { OrderPurchasedItem } from "./OrderPurchasedItem"; +import { OrderShippingAddress } from "./OrderShippingAddress"; +import { OrderStatus } from "./OrderStatus"; import { OrderTotals } from "./OrderTotals"; -import { OrderDownloadFilesItem } from "./OrderDownloadFilesItem"; +import { PaypalDetails } from "./PaypalDetails"; +import { StripeCard } from "./StripeCard"; +import { StripeDetails } from "./StripeDetails"; export const Order: core.serialization.ObjectSchema = core.serialization.object({ orderId: core.serialization.string().optional(), diff --git a/src/serialization/types/OrderAddress.ts b/src/serialization/types/OrderAddress.ts index 3618faa7..a3e26d63 100644 --- a/src/serialization/types/OrderAddress.ts +++ b/src/serialization/types/OrderAddress.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { OrderAddressType } from "./OrderAddressType"; +import type * as serializers from "../index"; import { OrderAddressJapanType } from "./OrderAddressJapanType"; +import { OrderAddressType } from "./OrderAddressType"; export const OrderAddress: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/OrderAddressJapanType.ts b/src/serialization/types/OrderAddressJapanType.ts index 4dd4dfd1..801cd48f 100644 --- a/src/serialization/types/OrderAddressJapanType.ts +++ b/src/serialization/types/OrderAddressJapanType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderAddressJapanType: core.serialization.Schema< serializers.OrderAddressJapanType.Raw, diff --git a/src/serialization/types/OrderAddressType.ts b/src/serialization/types/OrderAddressType.ts index 6acce07d..090ba6dc 100644 --- a/src/serialization/types/OrderAddressType.ts +++ b/src/serialization/types/OrderAddressType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderAddressType: core.serialization.Schema = core.serialization.enum_(["shipping", "billing"]); diff --git a/src/serialization/types/OrderBillingAddress.ts b/src/serialization/types/OrderBillingAddress.ts index c31476e4..d708ba2b 100644 --- a/src/serialization/types/OrderBillingAddress.ts +++ b/src/serialization/types/OrderBillingAddress.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { OrderBillingAddressType } from "./OrderBillingAddressType"; +import type * as serializers from "../index"; import { OrderBillingAddressJapanType } from "./OrderBillingAddressJapanType"; +import { OrderBillingAddressType } from "./OrderBillingAddressType"; export const OrderBillingAddress: core.serialization.ObjectSchema< serializers.OrderBillingAddress.Raw, diff --git a/src/serialization/types/OrderBillingAddressJapanType.ts b/src/serialization/types/OrderBillingAddressJapanType.ts index 5edc32c9..0ab6cace 100644 --- a/src/serialization/types/OrderBillingAddressJapanType.ts +++ b/src/serialization/types/OrderBillingAddressJapanType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderBillingAddressJapanType: core.serialization.Schema< serializers.OrderBillingAddressJapanType.Raw, diff --git a/src/serialization/types/OrderBillingAddressType.ts b/src/serialization/types/OrderBillingAddressType.ts index f70d77b0..42db9262 100644 --- a/src/serialization/types/OrderBillingAddressType.ts +++ b/src/serialization/types/OrderBillingAddressType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderBillingAddressType: core.serialization.Schema< serializers.OrderBillingAddressType.Raw, diff --git a/src/serialization/types/OrderCustomerInfo.ts b/src/serialization/types/OrderCustomerInfo.ts index daa399a8..4c39dadc 100644 --- a/src/serialization/types/OrderCustomerInfo.ts +++ b/src/serialization/types/OrderCustomerInfo.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderCustomerInfo: core.serialization.ObjectSchema< serializers.OrderCustomerInfo.Raw, diff --git a/src/serialization/types/OrderDisputeLastStatus.ts b/src/serialization/types/OrderDisputeLastStatus.ts index 7c561d38..97cd3273 100644 --- a/src/serialization/types/OrderDisputeLastStatus.ts +++ b/src/serialization/types/OrderDisputeLastStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderDisputeLastStatus: core.serialization.Schema< serializers.OrderDisputeLastStatus.Raw, diff --git a/src/serialization/types/OrderDownloadFilesItem.ts b/src/serialization/types/OrderDownloadFilesItem.ts index 94005846..df58bf76 100644 --- a/src/serialization/types/OrderDownloadFilesItem.ts +++ b/src/serialization/types/OrderDownloadFilesItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderDownloadFilesItem: core.serialization.ObjectSchema< serializers.OrderDownloadFilesItem.Raw, diff --git a/src/serialization/types/OrderList.ts b/src/serialization/types/OrderList.ts index d7d13853..3f8f26df 100644 --- a/src/serialization/types/OrderList.ts +++ b/src/serialization/types/OrderList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Order } from "./Order"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/OrderMetadata.ts b/src/serialization/types/OrderMetadata.ts index c7bbbd22..043f0e2c 100644 --- a/src/serialization/types/OrderMetadata.ts +++ b/src/serialization/types/OrderMetadata.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderMetadata: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/OrderPrice.ts b/src/serialization/types/OrderPrice.ts index 07cf76c9..1e483e90 100644 --- a/src/serialization/types/OrderPrice.ts +++ b/src/serialization/types/OrderPrice.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderPrice: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/OrderPurchasedItem.ts b/src/serialization/types/OrderPurchasedItem.ts index 028d8647..56585fd6 100644 --- a/src/serialization/types/OrderPurchasedItem.ts +++ b/src/serialization/types/OrderPurchasedItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { OrderPrice } from "./OrderPrice"; import { OrderPurchasedItemVariantImage } from "./OrderPurchasedItemVariantImage"; diff --git a/src/serialization/types/OrderPurchasedItemVariantImage.ts b/src/serialization/types/OrderPurchasedItemVariantImage.ts index 6aae08ab..3082bb2e 100644 --- a/src/serialization/types/OrderPurchasedItemVariantImage.ts +++ b/src/serialization/types/OrderPurchasedItemVariantImage.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { OrderPurchasedItemVariantImageFile } from "./OrderPurchasedItemVariantImageFile"; export const OrderPurchasedItemVariantImage: core.serialization.ObjectSchema< diff --git a/src/serialization/types/OrderPurchasedItemVariantImageFile.ts b/src/serialization/types/OrderPurchasedItemVariantImageFile.ts index d412f892..4a810c85 100644 --- a/src/serialization/types/OrderPurchasedItemVariantImageFile.ts +++ b/src/serialization/types/OrderPurchasedItemVariantImageFile.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { OrderPurchasedItemVariantImageFileVariantsItem } from "./OrderPurchasedItemVariantImageFileVariantsItem"; export const OrderPurchasedItemVariantImageFile: core.serialization.ObjectSchema< diff --git a/src/serialization/types/OrderPurchasedItemVariantImageFileVariantsItem.ts b/src/serialization/types/OrderPurchasedItemVariantImageFileVariantsItem.ts index 27d4bae8..8a29ce20 100644 --- a/src/serialization/types/OrderPurchasedItemVariantImageFileVariantsItem.ts +++ b/src/serialization/types/OrderPurchasedItemVariantImageFileVariantsItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderPurchasedItemVariantImageFileVariantsItem: core.serialization.ObjectSchema< serializers.OrderPurchasedItemVariantImageFileVariantsItem.Raw, diff --git a/src/serialization/types/OrderShippingAddress.ts b/src/serialization/types/OrderShippingAddress.ts index 0e0b6f6d..7100f7ff 100644 --- a/src/serialization/types/OrderShippingAddress.ts +++ b/src/serialization/types/OrderShippingAddress.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { OrderShippingAddressType } from "./OrderShippingAddressType"; +import type * as serializers from "../index"; import { OrderShippingAddressJapanType } from "./OrderShippingAddressJapanType"; +import { OrderShippingAddressType } from "./OrderShippingAddressType"; export const OrderShippingAddress: core.serialization.ObjectSchema< serializers.OrderShippingAddress.Raw, diff --git a/src/serialization/types/OrderShippingAddressJapanType.ts b/src/serialization/types/OrderShippingAddressJapanType.ts index e1db409e..0c6d413f 100644 --- a/src/serialization/types/OrderShippingAddressJapanType.ts +++ b/src/serialization/types/OrderShippingAddressJapanType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderShippingAddressJapanType: core.serialization.Schema< serializers.OrderShippingAddressJapanType.Raw, diff --git a/src/serialization/types/OrderShippingAddressType.ts b/src/serialization/types/OrderShippingAddressType.ts index 50b24c85..2bb5fa07 100644 --- a/src/serialization/types/OrderShippingAddressType.ts +++ b/src/serialization/types/OrderShippingAddressType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderShippingAddressType: core.serialization.Schema< serializers.OrderShippingAddressType.Raw, diff --git a/src/serialization/types/OrderStatus.ts b/src/serialization/types/OrderStatus.ts index c648fb9b..122f091c 100644 --- a/src/serialization/types/OrderStatus.ts +++ b/src/serialization/types/OrderStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderStatus: core.serialization.Schema = core.serialization.enum_(["pending", "unfulfilled", "fulfilled", "disputed", "dispute-lost", "refunded"]); diff --git a/src/serialization/types/OrderTotals.ts b/src/serialization/types/OrderTotals.ts index 3aa91c03..0e9fed36 100644 --- a/src/serialization/types/OrderTotals.ts +++ b/src/serialization/types/OrderTotals.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { OrderPrice } from "./OrderPrice"; import { OrderTotalsExtrasItem } from "./OrderTotalsExtrasItem"; diff --git a/src/serialization/types/OrderTotalsExtrasItem.ts b/src/serialization/types/OrderTotalsExtrasItem.ts index 95f76dc2..c899ea35 100644 --- a/src/serialization/types/OrderTotalsExtrasItem.ts +++ b/src/serialization/types/OrderTotalsExtrasItem.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { OrderTotalsExtrasItemType } from "./OrderTotalsExtrasItemType"; +import type * as serializers from "../index"; import { OrderPrice } from "./OrderPrice"; +import { OrderTotalsExtrasItemType } from "./OrderTotalsExtrasItemType"; export const OrderTotalsExtrasItem: core.serialization.ObjectSchema< serializers.OrderTotalsExtrasItem.Raw, diff --git a/src/serialization/types/OrderTotalsExtrasItemType.ts b/src/serialization/types/OrderTotalsExtrasItemType.ts index 4e16c0ee..4d19441c 100644 --- a/src/serialization/types/OrderTotalsExtrasItemType.ts +++ b/src/serialization/types/OrderTotalsExtrasItemType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderTotalsExtrasItemType: core.serialization.Schema< serializers.OrderTotalsExtrasItemType.Raw, diff --git a/src/serialization/types/Page.ts b/src/serialization/types/Page.ts index 450e4638..9b9e2a1f 100644 --- a/src/serialization/types/Page.ts +++ b/src/serialization/types/Page.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { PageSeo } from "./PageSeo"; +import type * as serializers from "../index"; import { PageOpenGraph } from "./PageOpenGraph"; +import { PageSeo } from "./PageSeo"; export const Page: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string(), diff --git a/src/serialization/types/PageCreatedWebhook.ts b/src/serialization/types/PageCreatedWebhook.ts index 478a14c3..c60e01d9 100644 --- a/src/serialization/types/PageCreatedWebhook.ts +++ b/src/serialization/types/PageCreatedWebhook.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PageCreatedWebhookPayload } from "./PageCreatedWebhookPayload"; export const PageCreatedWebhook: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PageCreatedWebhookPayload.ts b/src/serialization/types/PageCreatedWebhookPayload.ts index 9a8ab194..b61870d0 100644 --- a/src/serialization/types/PageCreatedWebhookPayload.ts +++ b/src/serialization/types/PageCreatedWebhookPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PageCreatedWebhookPayload: core.serialization.ObjectSchema< serializers.PageCreatedWebhookPayload.Raw, diff --git a/src/serialization/types/PageDeletedWebhook.ts b/src/serialization/types/PageDeletedWebhook.ts index 0044c3d6..cede0799 100644 --- a/src/serialization/types/PageDeletedWebhook.ts +++ b/src/serialization/types/PageDeletedWebhook.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PageDeletedWebhookPayload } from "./PageDeletedWebhookPayload"; export const PageDeletedWebhook: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PageDeletedWebhookPayload.ts b/src/serialization/types/PageDeletedWebhookPayload.ts index 97979d06..45ce0c48 100644 --- a/src/serialization/types/PageDeletedWebhookPayload.ts +++ b/src/serialization/types/PageDeletedWebhookPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PageDeletedWebhookPayload: core.serialization.ObjectSchema< serializers.PageDeletedWebhookPayload.Raw, diff --git a/src/serialization/types/PageList.ts b/src/serialization/types/PageList.ts index 9ef9e51c..d9f21b80 100644 --- a/src/serialization/types/PageList.ts +++ b/src/serialization/types/PageList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Page } from "./Page"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/PageMetadataUpdatedWebhook.ts b/src/serialization/types/PageMetadataUpdatedWebhook.ts index 27628074..75a47eb3 100644 --- a/src/serialization/types/PageMetadataUpdatedWebhook.ts +++ b/src/serialization/types/PageMetadataUpdatedWebhook.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PageMetadataUpdatedWebhookPayload } from "./PageMetadataUpdatedWebhookPayload"; export const PageMetadataUpdatedWebhook: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PageMetadataUpdatedWebhookPayload.ts b/src/serialization/types/PageMetadataUpdatedWebhookPayload.ts index 8400b888..01d872cf 100644 --- a/src/serialization/types/PageMetadataUpdatedWebhookPayload.ts +++ b/src/serialization/types/PageMetadataUpdatedWebhookPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PageMetadataUpdatedWebhookPayload: core.serialization.ObjectSchema< serializers.PageMetadataUpdatedWebhookPayload.Raw, diff --git a/src/serialization/types/PageOpenGraph.ts b/src/serialization/types/PageOpenGraph.ts index 0a104b5f..a3b3dfc2 100644 --- a/src/serialization/types/PageOpenGraph.ts +++ b/src/serialization/types/PageOpenGraph.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PageOpenGraph: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/PageSeo.ts b/src/serialization/types/PageSeo.ts index 9fe4aa20..cc66a6bd 100644 --- a/src/serialization/types/PageSeo.ts +++ b/src/serialization/types/PageSeo.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PageSeo: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Pagination.ts b/src/serialization/types/Pagination.ts index 7d78b97e..bd79fdda 100644 --- a/src/serialization/types/Pagination.ts +++ b/src/serialization/types/Pagination.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Pagination: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Payload.ts b/src/serialization/types/Payload.ts index ffaf5cb9..d4a1c0bc 100644 --- a/src/serialization/types/Payload.ts +++ b/src/serialization/types/Payload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PayloadFieldData } from "./PayloadFieldData"; export const Payload: core.serialization.ObjectSchema = diff --git a/src/serialization/types/PayloadFieldData.ts b/src/serialization/types/PayloadFieldData.ts index 1076c24c..a5499c97 100644 --- a/src/serialization/types/PayloadFieldData.ts +++ b/src/serialization/types/PayloadFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PayloadFieldData: core.serialization.ObjectSchema< serializers.PayloadFieldData.Raw, diff --git a/src/serialization/types/PaypalDetails.ts b/src/serialization/types/PaypalDetails.ts index b4b38c02..37bed9d7 100644 --- a/src/serialization/types/PaypalDetails.ts +++ b/src/serialization/types/PaypalDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaypalDetails: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Product.ts b/src/serialization/types/Product.ts index 6c7da3a8..41f09e47 100644 --- a/src/serialization/types/Product.ts +++ b/src/serialization/types/Product.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ProductFieldData } from "./ProductFieldData"; export const Product: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ProductAndSkUs.ts b/src/serialization/types/ProductAndSkUs.ts index eb8f9a8c..0e40c85d 100644 --- a/src/serialization/types/ProductAndSkUs.ts +++ b/src/serialization/types/ProductAndSkUs.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Product } from "./Product"; import { Sku } from "./Sku"; diff --git a/src/serialization/types/ProductAndSkUsList.ts b/src/serialization/types/ProductAndSkUsList.ts index bc08eb2c..bfc8af72 100644 --- a/src/serialization/types/ProductAndSkUsList.ts +++ b/src/serialization/types/ProductAndSkUsList.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { ProductAndSkUs } from "./ProductAndSkUs"; +import type * as serializers from "../index"; import { Pagination } from "./Pagination"; +import { ProductAndSkUs } from "./ProductAndSkUs"; export const ProductAndSkUsList: core.serialization.ObjectSchema< serializers.ProductAndSkUsList.Raw, diff --git a/src/serialization/types/ProductFieldData.ts b/src/serialization/types/ProductFieldData.ts index 8f109dd6..045e745f 100644 --- a/src/serialization/types/ProductFieldData.ts +++ b/src/serialization/types/ProductFieldData.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { SkuPropertyList } from "./SkuPropertyList"; -import { ProductFieldDataTaxCategory } from "./ProductFieldDataTaxCategory"; +import type * as serializers from "../index"; import { ProductFieldDataEcProductType } from "./ProductFieldDataEcProductType"; +import { ProductFieldDataTaxCategory } from "./ProductFieldDataTaxCategory"; +import { SkuPropertyList } from "./SkuPropertyList"; export const ProductFieldData: core.serialization.ObjectSchema< serializers.ProductFieldData.Raw, diff --git a/src/serialization/types/ProductFieldDataEcProductType.ts b/src/serialization/types/ProductFieldDataEcProductType.ts index 9a0a026f..123c71d5 100644 --- a/src/serialization/types/ProductFieldDataEcProductType.ts +++ b/src/serialization/types/ProductFieldDataEcProductType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ProductFieldDataEcProductType: core.serialization.Schema< serializers.ProductFieldDataEcProductType.Raw, diff --git a/src/serialization/types/ProductFieldDataTaxCategory.ts b/src/serialization/types/ProductFieldDataTaxCategory.ts index 4603b97d..f8633b32 100644 --- a/src/serialization/types/ProductFieldDataTaxCategory.ts +++ b/src/serialization/types/ProductFieldDataTaxCategory.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ProductFieldDataTaxCategory: core.serialization.Schema< serializers.ProductFieldDataTaxCategory.Raw, diff --git a/src/serialization/types/PublishStatus.ts b/src/serialization/types/PublishStatus.ts index b59744f2..ebc801a5 100644 --- a/src/serialization/types/PublishStatus.ts +++ b/src/serialization/types/PublishStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PublishStatus: core.serialization.Schema = core.serialization.enum_(["staging", "live"]); diff --git a/src/serialization/types/Redirect.ts b/src/serialization/types/Redirect.ts index 7de21d00..d310f519 100644 --- a/src/serialization/types/Redirect.ts +++ b/src/serialization/types/Redirect.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Redirect: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Redirects.ts b/src/serialization/types/Redirects.ts index a8e2df7e..5e5baa85 100644 --- a/src/serialization/types/Redirects.ts +++ b/src/serialization/types/Redirects.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { Redirect } from "./Redirect"; +import type * as serializers from "../index"; import { Pagination } from "./Pagination"; +import { Redirect } from "./Redirect"; export const Redirects: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/ReferenceField.ts b/src/serialization/types/ReferenceField.ts index d1750771..39067e3c 100644 --- a/src/serialization/types/ReferenceField.ts +++ b/src/serialization/types/ReferenceField.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { ReferenceFieldType } from "./ReferenceFieldType"; +import type * as serializers from "../index"; import { ReferenceFieldMetadata } from "./ReferenceFieldMetadata"; +import { ReferenceFieldType } from "./ReferenceFieldType"; export const ReferenceField: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/ReferenceFieldMetadata.ts b/src/serialization/types/ReferenceFieldMetadata.ts index 0f2848ef..39d8f9b5 100644 --- a/src/serialization/types/ReferenceFieldMetadata.ts +++ b/src/serialization/types/ReferenceFieldMetadata.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ReferenceFieldMetadata: core.serialization.ObjectSchema< serializers.ReferenceFieldMetadata.Raw, diff --git a/src/serialization/types/ReferenceFieldType.ts b/src/serialization/types/ReferenceFieldType.ts index 1e8cebe9..f2d1c200 100644 --- a/src/serialization/types/ReferenceFieldType.ts +++ b/src/serialization/types/ReferenceFieldType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ReferenceFieldType: core.serialization.Schema< serializers.ReferenceFieldType.Raw, diff --git a/src/serialization/types/RegisteredScriptList.ts b/src/serialization/types/RegisteredScriptList.ts index a690b80e..e7948791 100644 --- a/src/serialization/types/RegisteredScriptList.ts +++ b/src/serialization/types/RegisteredScriptList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomCodeHostedResponse } from "./CustomCodeHostedResponse"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/Robots.ts b/src/serialization/types/Robots.ts index c2757178..324517e2 100644 --- a/src/serialization/types/Robots.ts +++ b/src/serialization/types/Robots.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { RobotsRulesItem } from "./RobotsRulesItem"; export const Robots: core.serialization.ObjectSchema = diff --git a/src/serialization/types/RobotsRulesItem.ts b/src/serialization/types/RobotsRulesItem.ts index a261e7a1..ccd9d899 100644 --- a/src/serialization/types/RobotsRulesItem.ts +++ b/src/serialization/types/RobotsRulesItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const RobotsRulesItem: core.serialization.ObjectSchema< serializers.RobotsRulesItem.Raw, diff --git a/src/serialization/types/ScriptApply.ts b/src/serialization/types/ScriptApply.ts index 179a946e..c78860d7 100644 --- a/src/serialization/types/ScriptApply.ts +++ b/src/serialization/types/ScriptApply.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ScriptApplyLocation } from "./ScriptApplyLocation"; export const ScriptApply: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ScriptApplyList.ts b/src/serialization/types/ScriptApplyList.ts index 4bccf7ba..df42c718 100644 --- a/src/serialization/types/ScriptApplyList.ts +++ b/src/serialization/types/ScriptApplyList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ScriptApply } from "./ScriptApply"; export const ScriptApplyList: core.serialization.ObjectSchema< diff --git a/src/serialization/types/ScriptApplyLocation.ts b/src/serialization/types/ScriptApplyLocation.ts index 19941529..4e025937 100644 --- a/src/serialization/types/ScriptApplyLocation.ts +++ b/src/serialization/types/ScriptApplyLocation.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ScriptApplyLocation: core.serialization.Schema< serializers.ScriptApplyLocation.Raw, diff --git a/src/serialization/types/Scripts.ts b/src/serialization/types/Scripts.ts index a2287894..fe315433 100644 --- a/src/serialization/types/Scripts.ts +++ b/src/serialization/types/Scripts.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ScriptApply } from "./ScriptApply"; export const Scripts: core.serialization.Schema = diff --git a/src/serialization/types/SearchButtonNode.ts b/src/serialization/types/SearchButtonNode.ts index 9cb3904d..87e19e5c 100644 --- a/src/serialization/types/SearchButtonNode.ts +++ b/src/serialization/types/SearchButtonNode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchButtonNode: core.serialization.ObjectSchema< serializers.SearchButtonNode.Raw, diff --git a/src/serialization/types/SearchButtonNodeWrite.ts b/src/serialization/types/SearchButtonNodeWrite.ts index b0fbc7e8..722cbe7e 100644 --- a/src/serialization/types/SearchButtonNodeWrite.ts +++ b/src/serialization/types/SearchButtonNodeWrite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchButtonNodeWrite: core.serialization.ObjectSchema< serializers.SearchButtonNodeWrite.Raw, diff --git a/src/serialization/types/Select.ts b/src/serialization/types/Select.ts index 93034408..77df4488 100644 --- a/src/serialization/types/Select.ts +++ b/src/serialization/types/Select.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SelectNodeWriteChoicesItem } from "./SelectNodeWriteChoicesItem"; export const Select: core.serialization.ObjectSchema = diff --git a/src/serialization/types/SelectNode.ts b/src/serialization/types/SelectNode.ts index 78828b27..18ee4bb8 100644 --- a/src/serialization/types/SelectNode.ts +++ b/src/serialization/types/SelectNode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SelectNodeChoicesItem } from "./SelectNodeChoicesItem"; export const SelectNode: core.serialization.ObjectSchema = diff --git a/src/serialization/types/SelectNodeChoicesItem.ts b/src/serialization/types/SelectNodeChoicesItem.ts index cd6c5339..b48faf40 100644 --- a/src/serialization/types/SelectNodeChoicesItem.ts +++ b/src/serialization/types/SelectNodeChoicesItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SelectNodeChoicesItem: core.serialization.ObjectSchema< serializers.SelectNodeChoicesItem.Raw, diff --git a/src/serialization/types/SelectNodeWriteChoicesItem.ts b/src/serialization/types/SelectNodeWriteChoicesItem.ts index dca7664b..ce69a0c0 100644 --- a/src/serialization/types/SelectNodeWriteChoicesItem.ts +++ b/src/serialization/types/SelectNodeWriteChoicesItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SelectNodeWriteChoicesItem: core.serialization.ObjectSchema< serializers.SelectNodeWriteChoicesItem.Raw, diff --git a/src/serialization/types/SingleLocaleCreatedPayload.ts b/src/serialization/types/SingleLocaleCreatedPayload.ts index c71b8ca3..c49293f1 100644 --- a/src/serialization/types/SingleLocaleCreatedPayload.ts +++ b/src/serialization/types/SingleLocaleCreatedPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SingleLocaleCreatedPayloadFieldData } from "./SingleLocaleCreatedPayloadFieldData"; export const SingleLocaleCreatedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SingleLocaleCreatedPayloadFieldData.ts b/src/serialization/types/SingleLocaleCreatedPayloadFieldData.ts index fd1491fa..a8803259 100644 --- a/src/serialization/types/SingleLocaleCreatedPayloadFieldData.ts +++ b/src/serialization/types/SingleLocaleCreatedPayloadFieldData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SingleLocaleCreatedPayloadFieldData: core.serialization.ObjectSchema< serializers.SingleLocaleCreatedPayloadFieldData.Raw, diff --git a/src/serialization/types/Site.ts b/src/serialization/types/Site.ts index eddd4dde..ed7eacab 100644 --- a/src/serialization/types/Site.ts +++ b/src/serialization/types/Site.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Domain } from "./Domain"; import { Locales } from "./Locales"; import { SiteDataCollectionType } from "./SiteDataCollectionType"; diff --git a/src/serialization/types/SiteActivityLogItem.ts b/src/serialization/types/SiteActivityLogItem.ts index 363dde52..d923b15a 100644 --- a/src/serialization/types/SiteActivityLogItem.ts +++ b/src/serialization/types/SiteActivityLogItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SiteActivityLogItemEvent } from "./SiteActivityLogItemEvent"; import { SiteActivityLogItemResourceOperation } from "./SiteActivityLogItemResourceOperation"; import { SiteActivityLogItemUser } from "./SiteActivityLogItemUser"; diff --git a/src/serialization/types/SiteActivityLogItemEvent.ts b/src/serialization/types/SiteActivityLogItemEvent.ts index 73263953..90151d6b 100644 --- a/src/serialization/types/SiteActivityLogItemEvent.ts +++ b/src/serialization/types/SiteActivityLogItemEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SiteActivityLogItemEvent: core.serialization.Schema< serializers.SiteActivityLogItemEvent.Raw, diff --git a/src/serialization/types/SiteActivityLogItemResourceOperation.ts b/src/serialization/types/SiteActivityLogItemResourceOperation.ts index ea3b3473..8f43bff5 100644 --- a/src/serialization/types/SiteActivityLogItemResourceOperation.ts +++ b/src/serialization/types/SiteActivityLogItemResourceOperation.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SiteActivityLogItemResourceOperation: core.serialization.Schema< serializers.SiteActivityLogItemResourceOperation.Raw, diff --git a/src/serialization/types/SiteActivityLogItemUser.ts b/src/serialization/types/SiteActivityLogItemUser.ts index 7ac8792b..3e444dd6 100644 --- a/src/serialization/types/SiteActivityLogItemUser.ts +++ b/src/serialization/types/SiteActivityLogItemUser.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SiteActivityLogItemUser: core.serialization.ObjectSchema< serializers.SiteActivityLogItemUser.Raw, diff --git a/src/serialization/types/SiteActivityLogResponse.ts b/src/serialization/types/SiteActivityLogResponse.ts index 1d5209ee..dfcee20d 100644 --- a/src/serialization/types/SiteActivityLogResponse.ts +++ b/src/serialization/types/SiteActivityLogResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { SiteActivityLogItem } from "./SiteActivityLogItem"; +import type * as serializers from "../index"; import { Pagination } from "./Pagination"; +import { SiteActivityLogItem } from "./SiteActivityLogItem"; export const SiteActivityLogResponse: core.serialization.ObjectSchema< serializers.SiteActivityLogResponse.Raw, diff --git a/src/serialization/types/SiteDataCollectionType.ts b/src/serialization/types/SiteDataCollectionType.ts index 2cf597c2..e8764024 100644 --- a/src/serialization/types/SiteDataCollectionType.ts +++ b/src/serialization/types/SiteDataCollectionType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SiteDataCollectionType: core.serialization.Schema< serializers.SiteDataCollectionType.Raw, diff --git a/src/serialization/types/SiteMembership.ts b/src/serialization/types/SiteMembership.ts index 8208542c..becdb00d 100644 --- a/src/serialization/types/SiteMembership.ts +++ b/src/serialization/types/SiteMembership.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; +import { WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess } from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; +import { WorkspaceAuditLogItemPayloadSiteMembershipMethod } from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; import { WorkspaceAuditLogItemPayloadSiteMembershipSite } from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; import { WorkspaceAuditLogItemPayloadSiteMembershipTargetUser } from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; -import { WorkspaceAuditLogItemPayloadSiteMembershipMethod } from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; import { WorkspaceAuditLogItemPayloadSiteMembershipUserType } from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; -import { WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess } from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; export const SiteMembership: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SiteMembershipAuditLogItem.ts b/src/serialization/types/SiteMembershipAuditLogItem.ts index 19bf2594..4d7f9a13 100644 --- a/src/serialization/types/SiteMembershipAuditLogItem.ts +++ b/src/serialization/types/SiteMembershipAuditLogItem.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { SiteMembershipAuditLogItemEventSubType } from "./SiteMembershipAuditLogItemEventSubType"; +import type * as serializers from "../index"; import { SiteMembership } from "./SiteMembership"; +import { SiteMembershipAuditLogItemEventSubType } from "./SiteMembershipAuditLogItemEventSubType"; export const SiteMembershipAuditLogItem: core.serialization.ObjectSchema< serializers.SiteMembershipAuditLogItem.Raw, diff --git a/src/serialization/types/SiteMembershipAuditLogItemEventSubType.ts b/src/serialization/types/SiteMembershipAuditLogItemEventSubType.ts index 05688493..8ff121a3 100644 --- a/src/serialization/types/SiteMembershipAuditLogItemEventSubType.ts +++ b/src/serialization/types/SiteMembershipAuditLogItemEventSubType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SiteMembershipAuditLogItemEventSubType: core.serialization.Schema< serializers.SiteMembershipAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/SitePlan.ts b/src/serialization/types/SitePlan.ts index 7da15cf8..9ed6a08e 100644 --- a/src/serialization/types/SitePlan.ts +++ b/src/serialization/types/SitePlan.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SitePlanId } from "./SitePlanId"; import { SitePlanName } from "./SitePlanName"; diff --git a/src/serialization/types/SitePlanId.ts b/src/serialization/types/SitePlanId.ts index d19ecc2e..fe03d23c 100644 --- a/src/serialization/types/SitePlanId.ts +++ b/src/serialization/types/SitePlanId.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SitePlanId: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/SitePlanName.ts b/src/serialization/types/SitePlanName.ts index ef8881f1..81c2a953 100644 --- a/src/serialization/types/SitePlanName.ts +++ b/src/serialization/types/SitePlanName.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SitePlanName: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/SitePublish.ts b/src/serialization/types/SitePublish.ts index 1e476a6c..07b0ac99 100644 --- a/src/serialization/types/SitePublish.ts +++ b/src/serialization/types/SitePublish.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SitePublishPayload } from "./SitePublishPayload"; export const SitePublish: core.serialization.ObjectSchema = diff --git a/src/serialization/types/SitePublishPayload.ts b/src/serialization/types/SitePublishPayload.ts index e94eab59..8d8280ec 100644 --- a/src/serialization/types/SitePublishPayload.ts +++ b/src/serialization/types/SitePublishPayload.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SitePublishPayload: core.serialization.ObjectSchema< serializers.SitePublishPayload.Raw, diff --git a/src/serialization/types/Sites.ts b/src/serialization/types/Sites.ts index ab5b6d23..7e6465ab 100644 --- a/src/serialization/types/Sites.ts +++ b/src/serialization/types/Sites.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Site } from "./Site"; export const Sites: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Sku.ts b/src/serialization/types/Sku.ts index 4e9ad250..a623ef62 100644 --- a/src/serialization/types/Sku.ts +++ b/src/serialization/types/Sku.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SkuFieldData } from "./SkuFieldData"; export const Sku: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SkuFieldData.ts b/src/serialization/types/SkuFieldData.ts index 6e73061c..896bb3ef 100644 --- a/src/serialization/types/SkuFieldData.ts +++ b/src/serialization/types/SkuFieldData.ts @@ -1,16 +1,14 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { SkuValueList } from "./SkuValueList"; -import { SkuFieldDataPrice } from "./SkuFieldDataPrice"; +import type * as serializers from "../index"; import { SkuFieldDataCompareAtPrice } from "./SkuFieldDataCompareAtPrice"; import { SkuFieldDataEcSkuBillingMethod } from "./SkuFieldDataEcSkuBillingMethod"; import { SkuFieldDataEcSkuSubscriptionPlan } from "./SkuFieldDataEcSkuSubscriptionPlan"; +import { SkuFieldDataPrice } from "./SkuFieldDataPrice"; import { SkuPropertyList } from "./SkuPropertyList"; +import { SkuValueList } from "./SkuValueList"; export const SkuFieldData: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SkuFieldDataCompareAtPrice.ts b/src/serialization/types/SkuFieldDataCompareAtPrice.ts index f7e9ad41..b574baf9 100644 --- a/src/serialization/types/SkuFieldDataCompareAtPrice.ts +++ b/src/serialization/types/SkuFieldDataCompareAtPrice.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SkuFieldDataCompareAtPrice: core.serialization.ObjectSchema< serializers.SkuFieldDataCompareAtPrice.Raw, diff --git a/src/serialization/types/SkuFieldDataEcSkuBillingMethod.ts b/src/serialization/types/SkuFieldDataEcSkuBillingMethod.ts index 69ee4d8f..cc77d092 100644 --- a/src/serialization/types/SkuFieldDataEcSkuBillingMethod.ts +++ b/src/serialization/types/SkuFieldDataEcSkuBillingMethod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SkuFieldDataEcSkuBillingMethod: core.serialization.Schema< serializers.SkuFieldDataEcSkuBillingMethod.Raw, diff --git a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlan.ts b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlan.ts index 5f356b3c..f5fe7f49 100644 --- a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlan.ts +++ b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlan.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SkuFieldDataEcSkuSubscriptionPlanInterval } from "./SkuFieldDataEcSkuSubscriptionPlanInterval"; import { SkuFieldDataEcSkuSubscriptionPlanPlansItem } from "./SkuFieldDataEcSkuSubscriptionPlanPlansItem"; diff --git a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts index eff02383..753ed927 100644 --- a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts +++ b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SkuFieldDataEcSkuSubscriptionPlanInterval: core.serialization.Schema< serializers.SkuFieldDataEcSkuSubscriptionPlanInterval.Raw, diff --git a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts index 16e1ebe9..a5f08ea1 100644 --- a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts +++ b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus } from "./SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus"; export const SkuFieldDataEcSkuSubscriptionPlanPlansItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts index 4300607d..fbe0ed8b 100644 --- a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts +++ b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus: core.serialization.Schema< serializers.SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.Raw, diff --git a/src/serialization/types/SkuFieldDataPrice.ts b/src/serialization/types/SkuFieldDataPrice.ts index e6ed7eb7..012dc3c7 100644 --- a/src/serialization/types/SkuFieldDataPrice.ts +++ b/src/serialization/types/SkuFieldDataPrice.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SkuFieldDataPrice: core.serialization.ObjectSchema< serializers.SkuFieldDataPrice.Raw, diff --git a/src/serialization/types/SkuPropertyList.ts b/src/serialization/types/SkuPropertyList.ts index 8c85ab16..11b9fad6 100644 --- a/src/serialization/types/SkuPropertyList.ts +++ b/src/serialization/types/SkuPropertyList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SkuPropertyListEnumItem } from "./SkuPropertyListEnumItem"; export const SkuPropertyList: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SkuPropertyListEnumItem.ts b/src/serialization/types/SkuPropertyListEnumItem.ts index dce561f8..65f230b7 100644 --- a/src/serialization/types/SkuPropertyListEnumItem.ts +++ b/src/serialization/types/SkuPropertyListEnumItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SkuPropertyListEnumItem: core.serialization.ObjectSchema< serializers.SkuPropertyListEnumItem.Raw, diff --git a/src/serialization/types/SkuValueList.ts b/src/serialization/types/SkuValueList.ts index 52a04607..c49f588a 100644 --- a/src/serialization/types/SkuValueList.ts +++ b/src/serialization/types/SkuValueList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SkuValueList: core.serialization.Schema = core.serialization.record(core.serialization.string(), core.serialization.string()); diff --git a/src/serialization/types/StaticField.ts b/src/serialization/types/StaticField.ts index 397db2ec..e32f9085 100644 --- a/src/serialization/types/StaticField.ts +++ b/src/serialization/types/StaticField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { StaticFieldType } from "./StaticFieldType"; export const StaticField: core.serialization.ObjectSchema = diff --git a/src/serialization/types/StaticFieldType.ts b/src/serialization/types/StaticFieldType.ts index cb704184..1a221d1c 100644 --- a/src/serialization/types/StaticFieldType.ts +++ b/src/serialization/types/StaticFieldType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const StaticFieldType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/StripeCard.ts b/src/serialization/types/StripeCard.ts index 1372e95f..cabcc6ba 100644 --- a/src/serialization/types/StripeCard.ts +++ b/src/serialization/types/StripeCard.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { StripeCardBrand } from "./StripeCardBrand"; import { StripeCardExpires } from "./StripeCardExpires"; diff --git a/src/serialization/types/StripeCardBrand.ts b/src/serialization/types/StripeCardBrand.ts index a08d9ac5..d41b3066 100644 --- a/src/serialization/types/StripeCardBrand.ts +++ b/src/serialization/types/StripeCardBrand.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const StripeCardBrand: core.serialization.Schema = core.serialization.enum_(["Visa", "American Express", "MasterCard", "Discover", "JCB", "Diners Club", "Unknown"]); diff --git a/src/serialization/types/StripeCardExpires.ts b/src/serialization/types/StripeCardExpires.ts index 8ec82664..ade57d89 100644 --- a/src/serialization/types/StripeCardExpires.ts +++ b/src/serialization/types/StripeCardExpires.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const StripeCardExpires: core.serialization.ObjectSchema< serializers.StripeCardExpires.Raw, diff --git a/src/serialization/types/StripeDetails.ts b/src/serialization/types/StripeDetails.ts index f1b8470a..5ab2c3de 100644 --- a/src/serialization/types/StripeDetails.ts +++ b/src/serialization/types/StripeDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const StripeDetails: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SubmitButtonNode.ts b/src/serialization/types/SubmitButtonNode.ts index 794a1d5a..4a5bc190 100644 --- a/src/serialization/types/SubmitButtonNode.ts +++ b/src/serialization/types/SubmitButtonNode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubmitButtonNode: core.serialization.ObjectSchema< serializers.SubmitButtonNode.Raw, diff --git a/src/serialization/types/SubmitButtonNodeWrite.ts b/src/serialization/types/SubmitButtonNodeWrite.ts index 8cf1a7f8..1c41a3b8 100644 --- a/src/serialization/types/SubmitButtonNodeWrite.ts +++ b/src/serialization/types/SubmitButtonNodeWrite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubmitButtonNodeWrite: core.serialization.ObjectSchema< serializers.SubmitButtonNodeWrite.Raw, diff --git a/src/serialization/types/Text.ts b/src/serialization/types/Text.ts index e5f55d60..d6e76aab 100644 --- a/src/serialization/types/Text.ts +++ b/src/serialization/types/Text.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Text: core.serialization.ObjectSchema = core.serialization.object({ html: core.serialization.string().optional(), diff --git a/src/serialization/types/TextInputNode.ts b/src/serialization/types/TextInputNode.ts index 71726816..a38fb6da 100644 --- a/src/serialization/types/TextInputNode.ts +++ b/src/serialization/types/TextInputNode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TextInputNode: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/TextInputNodeWrite.ts b/src/serialization/types/TextInputNodeWrite.ts index 737b37a0..e52a7f3e 100644 --- a/src/serialization/types/TextInputNodeWrite.ts +++ b/src/serialization/types/TextInputNodeWrite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TextInputNodeWrite: core.serialization.ObjectSchema< serializers.TextInputNodeWrite.Raw, diff --git a/src/serialization/types/TextNode.ts b/src/serialization/types/TextNode.ts index b0cca75c..e74d0ee9 100644 --- a/src/serialization/types/TextNode.ts +++ b/src/serialization/types/TextNode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TextNodeText } from "./TextNodeText"; export const TextNode: core.serialization.ObjectSchema = diff --git a/src/serialization/types/TextNodeText.ts b/src/serialization/types/TextNodeText.ts index 77a3fe19..7a500a02 100644 --- a/src/serialization/types/TextNodeText.ts +++ b/src/serialization/types/TextNodeText.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TextNodeText: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/TextNodeWrite.ts b/src/serialization/types/TextNodeWrite.ts index ab1d060e..9efc3f26 100644 --- a/src/serialization/types/TextNodeWrite.ts +++ b/src/serialization/types/TextNodeWrite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TextNodeWrite: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/TriggerType.ts b/src/serialization/types/TriggerType.ts index b3c9eb26..7443fca0 100644 --- a/src/serialization/types/TriggerType.ts +++ b/src/serialization/types/TriggerType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TriggerType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/UpdatedOrder.ts b/src/serialization/types/UpdatedOrder.ts index 4c27a99b..c26b9554 100644 --- a/src/serialization/types/UpdatedOrder.ts +++ b/src/serialization/types/UpdatedOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Order } from "./Order"; export const UpdatedOrder: core.serialization.ObjectSchema = diff --git a/src/serialization/types/User.ts b/src/serialization/types/User.ts index 67dba20e..4e724453 100644 --- a/src/serialization/types/User.ts +++ b/src/serialization/types/User.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { UserStatus } from "./UserStatus"; +import type * as serializers from "../index"; import { UserAccessGroupsItem } from "./UserAccessGroupsItem"; import { UserData } from "./UserData"; +import { UserStatus } from "./UserStatus"; export const User: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), diff --git a/src/serialization/types/UserAccess.ts b/src/serialization/types/UserAccess.ts index 32f8344f..b2c7f0e8 100644 --- a/src/serialization/types/UserAccess.ts +++ b/src/serialization/types/UserAccess.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { WorkspaceAuditLogItemPayloadUserAccessMethod } from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; export const UserAccess: core.serialization.ObjectSchema = diff --git a/src/serialization/types/UserAccessAuditLogItem.ts b/src/serialization/types/UserAccessAuditLogItem.ts index 7b344f7d..e2e7b947 100644 --- a/src/serialization/types/UserAccessAuditLogItem.ts +++ b/src/serialization/types/UserAccessAuditLogItem.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { UserAccessAuditLogItemEventSubType } from "./UserAccessAuditLogItemEventSubType"; +import type * as serializers from "../index"; import { UserAccess } from "./UserAccess"; +import { UserAccessAuditLogItemEventSubType } from "./UserAccessAuditLogItemEventSubType"; export const UserAccessAuditLogItem: core.serialization.ObjectSchema< serializers.UserAccessAuditLogItem.Raw, diff --git a/src/serialization/types/UserAccessAuditLogItemEventSubType.ts b/src/serialization/types/UserAccessAuditLogItemEventSubType.ts index 1664e09e..bc7154e3 100644 --- a/src/serialization/types/UserAccessAuditLogItemEventSubType.ts +++ b/src/serialization/types/UserAccessAuditLogItemEventSubType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const UserAccessAuditLogItemEventSubType: core.serialization.Schema< serializers.UserAccessAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/UserAccessGroupsItem.ts b/src/serialization/types/UserAccessGroupsItem.ts index 92c0b5c2..9637a167 100644 --- a/src/serialization/types/UserAccessGroupsItem.ts +++ b/src/serialization/types/UserAccessGroupsItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { UserAccessGroupsItemType } from "./UserAccessGroupsItemType"; export const UserAccessGroupsItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/UserAccessGroupsItemType.ts b/src/serialization/types/UserAccessGroupsItemType.ts index 72c0d996..6fb260b1 100644 --- a/src/serialization/types/UserAccessGroupsItemType.ts +++ b/src/serialization/types/UserAccessGroupsItemType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const UserAccessGroupsItemType: core.serialization.Schema< serializers.UserAccessGroupsItemType.Raw, diff --git a/src/serialization/types/UserData.ts b/src/serialization/types/UserData.ts index 9fe16c9b..7abc1416 100644 --- a/src/serialization/types/UserData.ts +++ b/src/serialization/types/UserData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { UserDataData } from "./UserDataData"; export const UserData: core.serialization.ObjectSchema = diff --git a/src/serialization/types/UserDataData.ts b/src/serialization/types/UserDataData.ts index 9c8fe706..4d3646f6 100644 --- a/src/serialization/types/UserDataData.ts +++ b/src/serialization/types/UserDataData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const UserDataData: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/UserLimitReached.ts b/src/serialization/types/UserLimitReached.ts index dd99b693..912e9f0d 100644 --- a/src/serialization/types/UserLimitReached.ts +++ b/src/serialization/types/UserLimitReached.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const UserLimitReached: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/UserList.ts b/src/serialization/types/UserList.ts index 5b51c82b..42a18c4b 100644 --- a/src/serialization/types/UserList.ts +++ b/src/serialization/types/UserList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { User } from "./User"; export const UserList: core.serialization.ObjectSchema = diff --git a/src/serialization/types/UserStatus.ts b/src/serialization/types/UserStatus.ts index 24109027..84d5d4cc 100644 --- a/src/serialization/types/UserStatus.ts +++ b/src/serialization/types/UserStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const UserStatus: core.serialization.Schema = core.serialization.enum_(["invited", "verified", "unverified"]); diff --git a/src/serialization/types/UsersNotEnabled.ts b/src/serialization/types/UsersNotEnabled.ts index fc9a6e7b..2eb16fdf 100644 --- a/src/serialization/types/UsersNotEnabled.ts +++ b/src/serialization/types/UsersNotEnabled.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const UsersNotEnabled: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/Webhook.ts b/src/serialization/types/Webhook.ts index 07f0eaa6..cdb03bbe 100644 --- a/src/serialization/types/Webhook.ts +++ b/src/serialization/types/Webhook.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TriggerType } from "./TriggerType"; import { WebhookFilter } from "./WebhookFilter"; diff --git a/src/serialization/types/WebhookFilter.ts b/src/serialization/types/WebhookFilter.ts index 8c3bf81b..0821bcf0 100644 --- a/src/serialization/types/WebhookFilter.ts +++ b/src/serialization/types/WebhookFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WebhookFilter: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/WebhookList.ts b/src/serialization/types/WebhookList.ts index b3900024..8f48ab27 100644 --- a/src/serialization/types/WebhookList.ts +++ b/src/serialization/types/WebhookList.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { Webhook } from "./Webhook"; +import type * as serializers from "../index"; import { Pagination } from "./Pagination"; +import { Webhook } from "./Webhook"; export const WebhookList: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/WorkspaceAuditLogItem.ts b/src/serialization/types/WorkspaceAuditLogItem.ts index 3baef5de..c321a594 100644 --- a/src/serialization/types/WorkspaceAuditLogItem.ts +++ b/src/serialization/types/WorkspaceAuditLogItem.ts @@ -1,17 +1,15 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { WorkspaceAuditLogItemActor } from "./WorkspaceAuditLogItemActor"; -import { WorkspaceAuditLogItemWorkspace } from "./WorkspaceAuditLogItemWorkspace"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; -import { UserAccessAuditLogItem } from "./UserAccessAuditLogItem"; +import type * as serializers from "../index"; import { CustomRoleAuditLogItem } from "./CustomRoleAuditLogItem"; -import { WorkspaceMembershipAuditLogItem } from "./WorkspaceMembershipAuditLogItem"; import { SiteMembershipAuditLogItem } from "./SiteMembershipAuditLogItem"; +import { UserAccessAuditLogItem } from "./UserAccessAuditLogItem"; +import { WorkspaceAuditLogItemActor } from "./WorkspaceAuditLogItemActor"; +import { WorkspaceAuditLogItemWorkspace } from "./WorkspaceAuditLogItemWorkspace"; import { WorkspaceInvitationAuditLogItem } from "./WorkspaceInvitationAuditLogItem"; +import { WorkspaceMembershipAuditLogItem } from "./WorkspaceMembershipAuditLogItem"; const _Base = core.serialization.object({ timestamp: core.serialization.date().optional(), diff --git a/src/serialization/types/WorkspaceAuditLogItemActor.ts b/src/serialization/types/WorkspaceAuditLogItemActor.ts index 5e501453..ffb97d60 100644 --- a/src/serialization/types/WorkspaceAuditLogItemActor.ts +++ b/src/serialization/types/WorkspaceAuditLogItemActor.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemActor: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemActor.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts index 841da5cb..a919f78d 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts index aec1001e..3e332e33 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipMethod: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipMethod.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts index ed122f31..73139916 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipSite: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipSite.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts index 5bda00ce..a9699cd7 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipTargetUser: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts index 56ee7806..153aa32b 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipUserType: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipUserType.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts index 5a8ceacb..81e4ca79 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadUserAccessMethod: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadUserAccessMethod.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts index 488ab8fa..387d613f 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts index 87b2dd6a..b9dd991e 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts index eae9726b..6a6e114d 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts index 35c2081a..3358ea54 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts index 6b07d19c..532face8 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts index 446a7b41..faf9db85 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts index 6358f927..c3c4182b 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemWorkspace.ts b/src/serialization/types/WorkspaceAuditLogItemWorkspace.ts index 92b43c94..f77e2f0a 100644 --- a/src/serialization/types/WorkspaceAuditLogItemWorkspace.ts +++ b/src/serialization/types/WorkspaceAuditLogItemWorkspace.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceAuditLogItemWorkspace: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemWorkspace.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogResponse.ts b/src/serialization/types/WorkspaceAuditLogResponse.ts index a6d047b4..291cba49 100644 --- a/src/serialization/types/WorkspaceAuditLogResponse.ts +++ b/src/serialization/types/WorkspaceAuditLogResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { WorkspaceAuditLogItem } from "./WorkspaceAuditLogItem"; +import type * as serializers from "../index"; import { Pagination } from "./Pagination"; +import { WorkspaceAuditLogItem } from "./WorkspaceAuditLogItem"; export const WorkspaceAuditLogResponse: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogResponse.Raw, diff --git a/src/serialization/types/WorkspaceInvitation.ts b/src/serialization/types/WorkspaceInvitation.ts index 14fc0ed4..9f9f1165 100644 --- a/src/serialization/types/WorkspaceInvitation.ts +++ b/src/serialization/types/WorkspaceInvitation.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; +import type * as serializers from "../index"; import { WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; -import { WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; +import { WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; import { WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; +import { WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; export const WorkspaceInvitation: core.serialization.ObjectSchema< serializers.WorkspaceInvitation.Raw, diff --git a/src/serialization/types/WorkspaceInvitationAuditLogItem.ts b/src/serialization/types/WorkspaceInvitationAuditLogItem.ts index 24ff3df9..63cc56b5 100644 --- a/src/serialization/types/WorkspaceInvitationAuditLogItem.ts +++ b/src/serialization/types/WorkspaceInvitationAuditLogItem.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { WorkspaceInvitationAuditLogItemEventSubType } from "./WorkspaceInvitationAuditLogItemEventSubType"; +import type * as serializers from "../index"; import { WorkspaceInvitation } from "./WorkspaceInvitation"; +import { WorkspaceInvitationAuditLogItemEventSubType } from "./WorkspaceInvitationAuditLogItemEventSubType"; export const WorkspaceInvitationAuditLogItem: core.serialization.ObjectSchema< serializers.WorkspaceInvitationAuditLogItem.Raw, diff --git a/src/serialization/types/WorkspaceInvitationAuditLogItemEventSubType.ts b/src/serialization/types/WorkspaceInvitationAuditLogItemEventSubType.ts index 3e1feda3..3e7ac3b0 100644 --- a/src/serialization/types/WorkspaceInvitationAuditLogItemEventSubType.ts +++ b/src/serialization/types/WorkspaceInvitationAuditLogItemEventSubType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceInvitationAuditLogItemEventSubType: core.serialization.Schema< serializers.WorkspaceInvitationAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/WorkspaceMembership.ts b/src/serialization/types/WorkspaceMembership.ts index 352f0412..e492e179 100644 --- a/src/serialization/types/WorkspaceMembership.ts +++ b/src/serialization/types/WorkspaceMembership.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser } from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; +import type * as serializers from "../index"; import { WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod } from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; +import { WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser } from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; import { WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType } from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; export const WorkspaceMembership: core.serialization.ObjectSchema< diff --git a/src/serialization/types/WorkspaceMembershipAuditLogItem.ts b/src/serialization/types/WorkspaceMembershipAuditLogItem.ts index 57640bf3..44386f4d 100644 --- a/src/serialization/types/WorkspaceMembershipAuditLogItem.ts +++ b/src/serialization/types/WorkspaceMembershipAuditLogItem.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; -import { WorkspaceMembershipAuditLogItemEventSubType } from "./WorkspaceMembershipAuditLogItemEventSubType"; +import type * as serializers from "../index"; import { WorkspaceMembership } from "./WorkspaceMembership"; +import { WorkspaceMembershipAuditLogItemEventSubType } from "./WorkspaceMembershipAuditLogItemEventSubType"; export const WorkspaceMembershipAuditLogItem: core.serialization.ObjectSchema< serializers.WorkspaceMembershipAuditLogItem.Raw, diff --git a/src/serialization/types/WorkspaceMembershipAuditLogItemEventSubType.ts b/src/serialization/types/WorkspaceMembershipAuditLogItemEventSubType.ts index 72478926..5886cd87 100644 --- a/src/serialization/types/WorkspaceMembershipAuditLogItemEventSubType.ts +++ b/src/serialization/types/WorkspaceMembershipAuditLogItemEventSubType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; +import type * as Webflow from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const WorkspaceMembershipAuditLogItemEventSubType: core.serialization.Schema< serializers.WorkspaceMembershipAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 226d0e81..05e2bc8a 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,264 +1,264 @@ -export * from "./ForbiddenErrorBody"; -export * from "./BadRequestErrorBody"; -export * from "./ItemsListItemsRequestLastPublished"; -export * from "./ItemsListItemsLiveRequestLastPublished"; -export * from "./ConflictErrorBody"; -export * from "./AuthorizedUser"; -export * from "./ErrorCode"; -export * from "./Error_"; +export * from "./AccessGroup"; +export * from "./AccessGroupList"; export * from "./Application"; -export * from "./AuthorizationAuthorizationAuthorizedTo"; -export * from "./AuthorizationAuthorization"; +export * from "./Asset"; +export * from "./AssetFolder"; +export * from "./AssetFolderList"; +export * from "./Assets"; +export * from "./AssetUpload"; +export * from "./AssetUploadUploadDetails"; +export * from "./AssetVariant"; export * from "./Authorization"; -export * from "./Domain"; -export * from "./Locale"; -export * from "./Locales"; -export * from "./SiteDataCollectionType"; -export * from "./Site"; -export * from "./InvalidScopes"; -export * from "./NotEnterprisePlanWorkspace"; -export * from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; -export * from "./UserAccess"; -export * from "./UserAccessAuditLogItemEventSubType"; -export * from "./UserAccessAuditLogItem"; -export * from "./CustomRole"; -export * from "./CustomRoleAuditLogItemEventSubType"; -export * from "./CustomRoleAuditLogItem"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; -export * from "./WorkspaceMembership"; -export * from "./WorkspaceMembershipAuditLogItemEventSubType"; -export * from "./WorkspaceMembershipAuditLogItem"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; -export * from "./SiteMembership"; -export * from "./SiteMembershipAuditLogItemEventSubType"; -export * from "./SiteMembershipAuditLogItem"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; -export * from "./WorkspaceInvitation"; -export * from "./WorkspaceInvitationAuditLogItemEventSubType"; -export * from "./WorkspaceInvitationAuditLogItem"; -export * from "./WorkspaceAuditLogItemActor"; -export * from "./WorkspaceAuditLogItemWorkspace"; -export * from "./WorkspaceAuditLogItem"; -export * from "./Pagination"; -export * from "./WorkspaceAuditLogResponse"; -export * from "./Sites"; -export * from "./NotEnterprisePlanSite"; -export * from "./Domains"; -export * from "./InvalidDomain"; -export * from "./NoDomains"; -export * from "./Redirect"; -export * from "./Redirects"; -export * from "./SitePlanId"; -export * from "./SitePlanName"; -export * from "./SitePlan"; -export * from "./RobotsRulesItem"; -export * from "./Robots"; -export * from "./SiteActivityLogItemEvent"; -export * from "./SiteActivityLogItemResourceOperation"; -export * from "./SiteActivityLogItemUser"; -export * from "./SiteActivityLogItem"; -export * from "./SiteActivityLogResponse"; -export * from "./CollectionListArrayItem"; -export * from "./CollectionList"; -export * from "./StaticFieldType"; -export * from "./StaticField"; -export * from "./MetadataOptionsItem"; -export * from "./Metadata"; -export * from "./OptionField"; -export * from "./ReferenceFieldType"; -export * from "./ReferenceFieldMetadata"; -export * from "./ReferenceField"; -export * from "./FieldCreate"; -export * from "./FieldType"; -export * from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; -export * from "./FieldValidationsAdditionalProperties"; -export * from "./FieldValidations"; -export * from "./Field"; +export * from "./AuthorizationAuthorization"; +export * from "./AuthorizationAuthorizationAuthorizedTo"; +export * from "./AuthorizedUser"; +export * from "./BadRequestErrorBody"; +export * from "./BulkCollectionItem"; +export * from "./BulkCollectionItemFieldData"; export * from "./Collection"; -export * from "./CollectionItemFieldData"; export * from "./CollectionItem"; -export * from "./CollectionItemListPagination"; +export * from "./CollectionItemChanged"; +export * from "./CollectionItemCreated"; +export * from "./CollectionItemFieldData"; export * from "./CollectionItemList"; -export * from "./CollectionItemPostSingleFieldData"; -export * from "./CollectionItemPostSingle"; -export * from "./CollectionItemWithIdInputFieldData"; -export * from "./CollectionItemWithIdInput"; export * from "./CollectionItemListNoPagination"; -export * from "./Conflict"; -export * from "./BulkCollectionItemFieldData"; -export * from "./BulkCollectionItem"; -export * from "./CollectionItemPatchSingleFieldData"; +export * from "./CollectionItemListPagination"; export * from "./CollectionItemPatchSingle"; -export * from "./CommentThreadAuthor"; -export * from "./CommentThreadMentionedUsersItem"; -export * from "./CommentThread"; -export * from "./CommentThreadListPagination"; -export * from "./CommentThreadList"; -export * from "./CommentReplyAuthor"; -export * from "./CommentReplyMentionedUsersItem"; +export * from "./CollectionItemPatchSingleFieldData"; +export * from "./CollectionItemPostSingle"; +export * from "./CollectionItemPostSingleFieldData"; +export * from "./CollectionItemPublished"; +export * from "./CollectionItemRemoved"; +export * from "./CollectionItemRemovedPayload"; +export * from "./CollectionItemRemovedPayloadFieldData"; +export * from "./CollectionItemUnpublished"; +export * from "./CollectionItemUnpublishedPayload"; +export * from "./CollectionItemUnpublishedPayloadFieldData"; +export * from "./CollectionItemWithIdInput"; +export * from "./CollectionItemWithIdInputFieldData"; +export * from "./CollectionList"; +export * from "./CollectionListArrayItem"; +export * from "./Comment"; +export * from "./CommentPayload"; +export * from "./CommentPayloadAuthor"; +export * from "./CommentPayloadMentionedUsersItem"; export * from "./CommentReply"; -export * from "./CommentReplyListPagination"; +export * from "./CommentReplyAuthor"; export * from "./CommentReplyList"; -export * from "./PageSeo"; -export * from "./PageOpenGraph"; -export * from "./Page"; -export * from "./PageList"; -export * from "./TextNodeText"; -export * from "./TextNode"; -export * from "./ImageNodeImage"; -export * from "./ImageNode"; -export * from "./Text"; -export * from "./ComponentPropertyType"; -export * from "./ComponentProperty"; -export * from "./ComponentNode"; -export * from "./TextInputNode"; -export * from "./SelectNodeChoicesItem"; -export * from "./SelectNode"; -export * from "./SubmitButtonNode"; -export * from "./SearchButtonNode"; -export * from "./Node"; -export * from "./Dom"; -export * from "./TextNodeWrite"; -export * from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; -export * from "./ComponentInstanceNodePropertyOverridesWrite"; -export * from "./SelectNodeWriteChoicesItem"; -export * from "./Select"; -export * from "./TextInputNodeWrite"; -export * from "./SubmitButtonNodeWrite"; -export * from "./SearchButtonNodeWrite"; +export * from "./CommentReplyListPagination"; +export * from "./CommentReplyMentionedUsersItem"; +export * from "./CommentThread"; +export * from "./CommentThreadAuthor"; +export * from "./CommentThreadList"; +export * from "./CommentThreadListPagination"; +export * from "./CommentThreadMentionedUsersItem"; export * from "./Component"; -export * from "./ComponentList"; export * from "./ComponentDom"; +export * from "./ComponentInstanceNodePropertyOverridesWrite"; +export * from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; +export * from "./ComponentList"; +export * from "./ComponentNode"; export * from "./ComponentProperties"; -export * from "./ScriptApplyLocation"; -export * from "./ScriptApply"; -export * from "./ScriptApplyList"; +export * from "./ComponentProperty"; +export * from "./ComponentPropertyType"; +export * from "./Conflict"; +export * from "./ConflictErrorBody"; +export * from "./CustomCodeBlock"; +export * from "./CustomCodeBlockType"; export * from "./CustomCodeHostedResponse"; -export * from "./RegisteredScriptList"; export * from "./CustomCodeInlineResponse"; -export * from "./Scripts"; -export * from "./CustomCodeBlockType"; -export * from "./CustomCodeBlock"; -export * from "./ListCustomCodeBlocks"; -export * from "./AssetVariant"; -export * from "./Asset"; -export * from "./Assets"; -export * from "./AssetUploadUploadDetails"; -export * from "./AssetUpload"; -export * from "./AssetFolder"; -export * from "./AssetFolderList"; -export * from "./TriggerType"; -export * from "./WebhookFilter"; -export * from "./Webhook"; -export * from "./WebhookList"; -export * from "./FormFieldValueType"; -export * from "./FormFieldValue"; -export * from "./FormField"; -export * from "./FormResponseSettings"; +export * from "./CustomRole"; +export * from "./CustomRoleAuditLogItem"; +export * from "./CustomRoleAuditLogItemEventSubType"; +export * from "./Dom"; +export * from "./Domain"; +export * from "./Domains"; +export * from "./DuplicateUserEmail"; +export * from "./EcommerceSettings"; +export * from "./Error_"; +export * from "./ErrorCode"; +export * from "./Field"; +export * from "./FieldCreate"; +export * from "./FieldType"; +export * from "./FieldValidations"; +export * from "./FieldValidationsAdditionalProperties"; +export * from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; +export * from "./ForbiddenErrorBody"; export * from "./Form"; +export * from "./FormField"; +export * from "./FormFieldValue"; +export * from "./FormFieldValueType"; export * from "./FormList"; +export * from "./FormResponseSettings"; export * from "./FormSubmission"; export * from "./FormSubmissionList"; -export * from "./UserStatus"; -export * from "./UserAccessGroupsItemType"; -export * from "./UserAccessGroupsItem"; -export * from "./UserDataData"; -export * from "./UserData"; -export * from "./User"; -export * from "./UserList"; -export * from "./UsersNotEnabled"; -export * from "./DuplicateUserEmail"; -export * from "./UserLimitReached"; -export * from "./AccessGroup"; -export * from "./AccessGroupList"; -export * from "./SkuPropertyListEnumItem"; -export * from "./SkuPropertyList"; -export * from "./ProductFieldDataTaxCategory"; -export * from "./ProductFieldDataEcProductType"; -export * from "./ProductFieldData"; +export * from "./FormSubmissionTrigger"; +export * from "./FormSubmissionTriggerPayload"; +export * from "./FormSubmissionTriggerPayloadSchemaItem"; +export * from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; +export * from "./ImageNode"; +export * from "./ImageNodeImage"; +export * from "./InvalidDomain"; +export * from "./InvalidScopes"; +export * from "./InventoryItem"; +export * from "./InventoryItemInventoryType"; +export * from "./ItemsListItemsLiveRequestLastPublished"; +export * from "./ItemsListItemsRequestLastPublished"; +export * from "./ListCustomCodeBlocks"; +export * from "./Locale"; +export * from "./Locales"; +export * from "./Metadata"; +export * from "./MetadataOptionsItem"; +export * from "./NewOrder"; +export * from "./NoDomains"; +export * from "./Node"; +export * from "./NotEnterprisePlanSite"; +export * from "./NotEnterprisePlanWorkspace"; +export * from "./OptionField"; +export * from "./Order"; +export * from "./OrderAddress"; +export * from "./OrderAddressJapanType"; +export * from "./OrderAddressType"; +export * from "./OrderBillingAddress"; +export * from "./OrderBillingAddressJapanType"; +export * from "./OrderBillingAddressType"; +export * from "./OrderCustomerInfo"; +export * from "./OrderDisputeLastStatus"; +export * from "./OrderDownloadFilesItem"; +export * from "./OrderList"; +export * from "./OrderMetadata"; +export * from "./OrderPrice"; +export * from "./OrderPurchasedItem"; +export * from "./OrderPurchasedItemVariantImage"; +export * from "./OrderPurchasedItemVariantImageFile"; +export * from "./OrderPurchasedItemVariantImageFileVariantsItem"; +export * from "./OrderShippingAddress"; +export * from "./OrderShippingAddressJapanType"; +export * from "./OrderShippingAddressType"; +export * from "./OrderStatus"; +export * from "./OrderTotals"; +export * from "./OrderTotalsExtrasItem"; +export * from "./OrderTotalsExtrasItemType"; +export * from "./Page"; +export * from "./PageCreatedWebhook"; +export * from "./PageCreatedWebhookPayload"; +export * from "./PageDeletedWebhook"; +export * from "./PageDeletedWebhookPayload"; +export * from "./PageList"; +export * from "./PageMetadataUpdatedWebhook"; +export * from "./PageMetadataUpdatedWebhookPayload"; +export * from "./PageOpenGraph"; +export * from "./PageSeo"; +export * from "./Pagination"; +export * from "./Payload"; +export * from "./PayloadFieldData"; +export * from "./PaypalDetails"; export * from "./Product"; -export * from "./SkuValueList"; -export * from "./SkuFieldDataPrice"; +export * from "./ProductAndSkUs"; +export * from "./ProductAndSkUsList"; +export * from "./ProductFieldData"; +export * from "./ProductFieldDataEcProductType"; +export * from "./ProductFieldDataTaxCategory"; +export * from "./PublishStatus"; +export * from "./Redirect"; +export * from "./Redirects"; +export * from "./ReferenceField"; +export * from "./ReferenceFieldMetadata"; +export * from "./ReferenceFieldType"; +export * from "./RegisteredScriptList"; +export * from "./Robots"; +export * from "./RobotsRulesItem"; +export * from "./ScriptApply"; +export * from "./ScriptApplyList"; +export * from "./ScriptApplyLocation"; +export * from "./Scripts"; +export * from "./SearchButtonNode"; +export * from "./SearchButtonNodeWrite"; +export * from "./Select"; +export * from "./SelectNode"; +export * from "./SelectNodeChoicesItem"; +export * from "./SelectNodeWriteChoicesItem"; +export * from "./SingleLocaleCreatedPayload"; +export * from "./SingleLocaleCreatedPayloadFieldData"; +export * from "./Site"; +export * from "./SiteActivityLogItem"; +export * from "./SiteActivityLogItemEvent"; +export * from "./SiteActivityLogItemResourceOperation"; +export * from "./SiteActivityLogItemUser"; +export * from "./SiteActivityLogResponse"; +export * from "./SiteDataCollectionType"; +export * from "./SiteMembership"; +export * from "./SiteMembershipAuditLogItem"; +export * from "./SiteMembershipAuditLogItemEventSubType"; +export * from "./SitePlan"; +export * from "./SitePlanId"; +export * from "./SitePlanName"; +export * from "./SitePublish"; +export * from "./SitePublishPayload"; +export * from "./Sites"; +export * from "./Sku"; +export * from "./SkuFieldData"; export * from "./SkuFieldDataCompareAtPrice"; export * from "./SkuFieldDataEcSkuBillingMethod"; +export * from "./SkuFieldDataEcSkuSubscriptionPlan"; export * from "./SkuFieldDataEcSkuSubscriptionPlanInterval"; -export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus"; export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItem"; -export * from "./SkuFieldDataEcSkuSubscriptionPlan"; -export * from "./SkuFieldData"; -export * from "./Sku"; -export * from "./ProductAndSkUs"; -export * from "./ProductAndSkUsList"; -export * from "./PublishStatus"; -export * from "./OrderPrice"; -export * from "./OrderAddressType"; -export * from "./OrderAddressJapanType"; -export * from "./OrderAddress"; -export * from "./OrderPurchasedItemVariantImageFileVariantsItem"; -export * from "./OrderPurchasedItemVariantImageFile"; -export * from "./OrderPurchasedItemVariantImage"; -export * from "./OrderPurchasedItem"; -export * from "./StripeDetails"; +export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus"; +export * from "./SkuFieldDataPrice"; +export * from "./SkuPropertyList"; +export * from "./SkuPropertyListEnumItem"; +export * from "./SkuValueList"; +export * from "./StaticField"; +export * from "./StaticFieldType"; +export * from "./StripeCard"; export * from "./StripeCardBrand"; export * from "./StripeCardExpires"; -export * from "./StripeCard"; -export * from "./PaypalDetails"; -export * from "./OrderStatus"; -export * from "./OrderDisputeLastStatus"; -export * from "./OrderShippingAddressType"; -export * from "./OrderShippingAddressJapanType"; -export * from "./OrderShippingAddress"; -export * from "./OrderBillingAddressType"; -export * from "./OrderBillingAddressJapanType"; -export * from "./OrderBillingAddress"; -export * from "./OrderCustomerInfo"; -export * from "./OrderMetadata"; -export * from "./OrderTotalsExtrasItemType"; -export * from "./OrderTotalsExtrasItem"; -export * from "./OrderTotals"; -export * from "./OrderDownloadFilesItem"; -export * from "./Order"; -export * from "./OrderList"; -export * from "./InventoryItemInventoryType"; -export * from "./InventoryItem"; -export * from "./EcommerceSettings"; -export * from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; -export * from "./FormSubmissionTriggerPayloadSchemaItem"; -export * from "./FormSubmissionTriggerPayload"; -export * from "./FormSubmissionTrigger"; -export * from "./SitePublishPayload"; -export * from "./SitePublish"; -export * from "./NewOrder"; +export * from "./StripeDetails"; +export * from "./SubmitButtonNode"; +export * from "./SubmitButtonNodeWrite"; +export * from "./Text"; +export * from "./TextInputNode"; +export * from "./TextInputNodeWrite"; +export * from "./TextNode"; +export * from "./TextNodeText"; +export * from "./TextNodeWrite"; +export * from "./TriggerType"; export * from "./UpdatedOrder"; -export * from "./SingleLocaleCreatedPayloadFieldData"; -export * from "./SingleLocaleCreatedPayload"; -export * from "./CollectionItemCreated"; -export * from "./CollectionItemChanged"; -export * from "./CollectionItemRemovedPayloadFieldData"; -export * from "./CollectionItemRemovedPayload"; -export * from "./CollectionItemRemoved"; -export * from "./PayloadFieldData"; -export * from "./Payload"; -export * from "./CollectionItemPublished"; -export * from "./CollectionItemUnpublishedPayloadFieldData"; -export * from "./CollectionItemUnpublishedPayload"; -export * from "./CollectionItemUnpublished"; -export * from "./PageCreatedWebhookPayload"; -export * from "./PageCreatedWebhook"; -export * from "./PageMetadataUpdatedWebhookPayload"; -export * from "./PageMetadataUpdatedWebhook"; -export * from "./PageDeletedWebhookPayload"; -export * from "./PageDeletedWebhook"; -export * from "./CommentPayloadAuthor"; -export * from "./CommentPayloadMentionedUsersItem"; -export * from "./CommentPayload"; -export * from "./Comment"; +export * from "./User"; +export * from "./UserAccess"; +export * from "./UserAccessAuditLogItem"; +export * from "./UserAccessAuditLogItemEventSubType"; +export * from "./UserAccessGroupsItem"; +export * from "./UserAccessGroupsItemType"; +export * from "./UserData"; +export * from "./UserDataData"; +export * from "./UserLimitReached"; +export * from "./UserList"; +export * from "./UserStatus"; +export * from "./UsersNotEnabled"; +export * from "./Webhook"; +export * from "./WebhookFilter"; +export * from "./WebhookList"; +export * from "./WorkspaceAuditLogItem"; +export * from "./WorkspaceAuditLogItemActor"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; +export * from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; +export * from "./WorkspaceAuditLogItemWorkspace"; +export * from "./WorkspaceAuditLogResponse"; +export * from "./WorkspaceInvitation"; +export * from "./WorkspaceInvitationAuditLogItem"; +export * from "./WorkspaceInvitationAuditLogItemEventSubType"; +export * from "./WorkspaceMembership"; +export * from "./WorkspaceMembershipAuditLogItem"; +export * from "./WorkspaceMembershipAuditLogItemEventSubType"; diff --git a/src/version.ts b/src/version.ts index 7d5c832f..1b340fa2 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.2.2"; +export const SDK_VERSION = "3.3.0"; diff --git a/tests/mock-server/MockServer.ts b/tests/mock-server/MockServer.ts index 6e258f17..5b30fe7c 100644 --- a/tests/mock-server/MockServer.ts +++ b/tests/mock-server/MockServer.ts @@ -1,4 +1,4 @@ -import { RequestHandlerOptions } from "msw"; +import type { RequestHandlerOptions } from "msw"; import type { SetupServer } from "msw/node"; import { mockEndpointBuilder } from "./mockEndpointBuilder"; diff --git a/tests/mock-server/MockServerPool.ts b/tests/mock-server/MockServerPool.ts index 81608069..e1a90f7f 100644 --- a/tests/mock-server/MockServerPool.ts +++ b/tests/mock-server/MockServerPool.ts @@ -22,7 +22,7 @@ async function formatHttpRequest(request: Request, id?: string): Promise } else if (clone.body) { body = await clone.text(); } - } catch (e) { + } catch (_e) { body = "(unable to parse body)"; } @@ -48,7 +48,7 @@ async function formatHttpResponse(response: Response, id?: string): Promise { const formattedRequest = await formatHttpRequest(request, requestId); - console.debug("request:start\n" + formattedRequest); + console.debug(`request:start\n${formattedRequest}`); }); mswServer.events.on("request:unhandled", async ({ request, requestId }) => { const formattedRequest = await formatHttpRequest(request, requestId); - console.debug("request:unhandled\n" + formattedRequest); + console.debug(`request:unhandled\n${formattedRequest}`); }); mswServer.events.on("response:mocked", async ({ request, response, requestId }) => { const formattedResponse = await formatHttpResponse(response, requestId); - console.debug("response:mocked\n" + formattedResponse); + console.debug(`response:mocked\n${formattedResponse}`); }); } } diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 390b2256..18557ec1 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -1,5 +1,6 @@ -import { DefaultBodyType, HttpHandler, HttpResponse, HttpResponseResolver, http } from "msw"; +import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponseResolver, http } from "msw"; +import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; import { withHeaders } from "./withHeaders"; import { withJson } from "./withJson"; @@ -127,28 +128,25 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta } jsonBody(body: unknown): ResponseStage { + if (body === undefined) { + throw new Error("Undefined is not valid JSON. Do not call jsonBody if you want an empty body."); + } this.predicates.push((resolver) => withJson(body, resolver)); return this; } respondWith(): ResponseStatusStage { - return new ResponseBuilder(this.method, this.buildPath(), this.predicates, this.handlerOptions); + return new ResponseBuilder(this.method, this.buildUrl(), this.predicates, this.handlerOptions); } - private buildPath(): string { - if (this._baseUrl.endsWith("/") && this.path.startsWith("/")) { - return this._baseUrl + this.path.slice(1); - } - if (!this._baseUrl.endsWith("/") && !this.path.startsWith("/")) { - return this._baseUrl + "/" + this.path; - } - return this._baseUrl + this.path; + private buildUrl(): string { + return url.join(this._baseUrl, this.path); } } class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, ResponseBodyStage, BuildStage { private readonly method: HttpMethod; - private readonly path: string; + private readonly url: string; private readonly requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[]; private readonly handlerOptions?: HttpHandlerBuilderOptions; @@ -158,12 +156,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo constructor( method: HttpMethod, - path: string, + url: string, requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[], options?: HttpHandlerBuilderOptions, ) { this.method = method; - this.path = path; + this.url = url; this.requestPredicates = requestPredicates; this.handlerOptions = options; } @@ -184,21 +182,29 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo } public jsonBody(body: unknown): BuildStage { + if (body === undefined) { + throw new Error("Undefined is not valid JSON. Do not call jsonBody if you expect an empty body."); + } this.responseBody = toJson(body); return this; } public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { - return new HttpResponse(this.responseBody, { + const response = new HttpResponse(this.responseBody, { status: this.responseStatusCode, headers: this.responseHeaders, }); + // if no Content-Type header is set, delete the default text content type that is set + if (Object.keys(this.responseHeaders).some((key) => key.toLowerCase() === "content-type") === false) { + response.headers.delete("Content-Type"); + } + return response; }; const finalResolver = this.requestPredicates.reduceRight((acc, predicate) => predicate(acc), responseResolver); - const handler = http[this.method](this.path, finalResolver, this.handlerOptions); + const handler = http[this.method](this.url, finalResolver, this.handlerOptions); this.handlerOptions?.onBuild?.(handler); return handler; } diff --git a/tests/mock-server/withHeaders.ts b/tests/mock-server/withHeaders.ts index e77c837d..6599d2b4 100644 --- a/tests/mock-server/withHeaders.ts +++ b/tests/mock-server/withHeaders.ts @@ -1,4 +1,4 @@ -import { HttpResponseResolver, passthrough } from "msw"; +import { type HttpResponseResolver, passthrough } from "msw"; /** * Creates a request matcher that validates if request headers match specified criteria diff --git a/tests/mock-server/withJson.ts b/tests/mock-server/withJson.ts index 4b4820c9..b627638b 100644 --- a/tests/mock-server/withJson.ts +++ b/tests/mock-server/withJson.ts @@ -1,4 +1,4 @@ -import { HttpResponseResolver, passthrough } from "msw"; +import { type HttpResponseResolver, passthrough } from "msw"; import { fromJson, toJson } from "../../src/core/json"; @@ -12,17 +12,23 @@ export function withJson(expectedBody: unknown, resolver: HttpResponseResolver): const { request } = args; let clonedRequest: Request; + let bodyText: string | undefined; let actualBody: unknown; try { clonedRequest = request.clone(); - actualBody = fromJson(await clonedRequest.text()); + bodyText = await clonedRequest.text(); + if (bodyText === "") { + console.error("Request body is empty, expected a JSON object."); + return passthrough(); + } + actualBody = fromJson(bodyText); } catch (error) { - console.error("Error processing request body:", error); + console.error(`Error processing request body:\n\tError: ${error}\n\tBody: ${bodyText}`); return passthrough(); } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).length > 0) { + if (Object.keys(mismatches).filter((key) => !key.startsWith("pagination.")).length > 0) { console.error("JSON body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } @@ -61,7 +67,7 @@ function findMismatches(actual: any, expected: any): Record 0) { for (const [mismatchKey, mismatchValue] of Object.entries(itemMismatches)) { - arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : "." + mismatchKey}`] = mismatchValue; + arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : `.${mismatchKey}`}`] = mismatchValue; } } } @@ -75,8 +81,14 @@ function findMismatches(actual: any, expected: any): Record 0) { for (const [nestedKey, nestedValue] of Object.entries(nestedMismatches)) { - mismatches[`${key}${nestedKey === "value" ? "" : "." + nestedKey}`] = nestedValue; + mismatches[`${key}${nestedKey === "value" ? "" : `.${nestedKey}`}`] = nestedValue; } } } else if (actual[key] !== expected[key]) { diff --git a/tests/tsconfig.json b/tests/tsconfig.json index 10185ed2..fe83070d 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.base.json", + "extends": "../tsconfig.json", "compilerOptions": { "outDir": null, "rootDir": "..", diff --git a/tests/unit/auth/BasicAuth.test.ts b/tests/unit/auth/BasicAuth.test.ts index 79ef9799..90bbc7ee 100644 --- a/tests/unit/auth/BasicAuth.test.ts +++ b/tests/unit/auth/BasicAuth.test.ts @@ -18,5 +18,41 @@ describe("BasicAuth", () => { password: "password", }); }); + + it("handles password with colons", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic dXNlcjpwYXNzOndvcmQ=")).toEqual({ + username: "user", + password: "pass:word", + }); + }); + + it("handles empty username and password (just colon)", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic Og==")).toEqual({ + username: "", + password: "", + }); + }); + + it("handles empty username", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic OnBhc3N3b3Jk")).toEqual({ + username: "", + password: "password", + }); + }); + + it("handles empty password", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic dXNlcm5hbWU6")).toEqual({ + username: "username", + password: "", + }); + }); + + it("throws error for completely empty credentials", () => { + expect(() => BasicAuth.fromAuthorizationHeader("Basic ")).toThrow("Invalid basic auth"); + }); + + it("throws error for credentials without colon", () => { + expect(() => BasicAuth.fromAuthorizationHeader("Basic dXNlcm5hbWU=")).toThrow("Invalid basic auth"); + }); }); }); diff --git a/tests/unit/base64.test.ts b/tests/unit/base64.test.ts new file mode 100644 index 00000000..939594ca --- /dev/null +++ b/tests/unit/base64.test.ts @@ -0,0 +1,53 @@ +import { base64Decode, base64Encode } from "../../src/core/base64"; + +describe("base64", () => { + describe("base64Encode", () => { + it("should encode ASCII strings", () => { + expect(base64Encode("hello")).toBe("aGVsbG8="); + expect(base64Encode("")).toBe(""); + }); + + it("should encode UTF-8 strings", () => { + expect(base64Encode("café")).toBe("Y2Fmw6k="); + expect(base64Encode("🎉")).toBe("8J+OiQ=="); + }); + + it("should handle basic auth credentials", () => { + expect(base64Encode("username:password")).toBe("dXNlcm5hbWU6cGFzc3dvcmQ="); + }); + }); + + describe("base64Decode", () => { + it("should decode ASCII strings", () => { + expect(base64Decode("aGVsbG8=")).toBe("hello"); + expect(base64Decode("")).toBe(""); + }); + + it("should decode UTF-8 strings", () => { + expect(base64Decode("Y2Fmw6k=")).toBe("café"); + expect(base64Decode("8J+OiQ==")).toBe("🎉"); + }); + + it("should handle basic auth credentials", () => { + expect(base64Decode("dXNlcm5hbWU6cGFzc3dvcmQ=")).toBe("username:password"); + }); + }); + + describe("round-trip encoding", () => { + const testStrings = [ + "hello world", + "test@example.com", + "café", + "username:password", + "user@domain.com:super$ecret123!", + ]; + + testStrings.forEach((testString) => { + it(`should round-trip encode/decode: "${testString}"`, () => { + const encoded = base64Encode(testString); + const decoded = base64Decode(encoded); + expect(decoded).toBe(testString); + }); + }); + }); +}); diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts index a32945e9..ae608ac1 100644 --- a/tests/unit/fetcher/Fetcher.test.ts +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -1,7 +1,6 @@ import fs from "fs"; import { join } from "path"; - -import { Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; +import { type Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; describe("Test fetcherImpl", () => { it("should handle successful request", async () => { @@ -12,14 +11,15 @@ describe("Test fetcherImpl", () => { body: { data: "test" }, contentType: "application/json", requestType: "json", + responseType: "json", }; - global.fetch = jest.fn().mockResolvedValue({ - ok: true, - status: 200, - text: () => Promise.resolve(JSON.stringify({ data: "test" })), - json: () => ({ data: "test" }), - }); + global.fetch = jest.fn().mockResolvedValue( + new Response(JSON.stringify({ data: "test" }), { + status: 200, + statusText: "OK", + }), + ); const result = await fetcherImpl(mockArgs); expect(result.ok).toBe(true); @@ -45,16 +45,16 @@ describe("Test fetcherImpl", () => { headers: { "X-Test": "x-test-header" }, contentType: "application/octet-stream", requestType: "bytes", - duplex: "half", + responseType: "json", body: fs.createReadStream(join(__dirname, "test-file.txt")), }; - global.fetch = jest.fn().mockResolvedValue({ - ok: true, - status: 200, - text: () => Promise.resolve(JSON.stringify({ data: "test" })), - json: () => Promise.resolve({ data: "test" }), - }); + global.fetch = jest.fn().mockResolvedValue( + new Response(JSON.stringify({ data: "test" }), { + status: 200, + statusText: "OK", + }), + ); const result = await fetcherImpl(mockArgs); diff --git a/tests/unit/fetcher/HttpResponsePromise.test.ts b/tests/unit/fetcher/HttpResponsePromise.test.ts index 2216a33e..c063b079 100644 --- a/tests/unit/fetcher/HttpResponsePromise.test.ts +++ b/tests/unit/fetcher/HttpResponsePromise.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import { HttpResponsePromise } from "../../../src/core/fetcher/HttpResponsePromise"; -import { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; +import type { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; describe("HttpResponsePromise", () => { const mockRawResponse: RawResponse = { diff --git a/tests/unit/fetcher/createRequestUrl.test.ts b/tests/unit/fetcher/createRequestUrl.test.ts index 486e1e61..06e03b2c 100644 --- a/tests/unit/fetcher/createRequestUrl.test.ts +++ b/tests/unit/fetcher/createRequestUrl.test.ts @@ -48,4 +48,113 @@ describe("Test createRequestUrl", () => { const queryParams = { special: "a&b=c d" }; expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?special=a%26b%3Dc%20d"); }); + + // Additional tests for edge cases and different value types + it("should handle numeric values", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { count: 42, price: 19.99, active: 1, inactive: 0 }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?count=42&price=19.99&active=1&inactive=0", + ); + }); + + it("should handle boolean values", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { enabled: true, disabled: false }; + expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?enabled=true&disabled=false"); + }); + + it("should handle null and undefined values", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + valid: "value", + nullValue: null, + undefinedValue: undefined, + emptyString: "", + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?valid=value&nullValue=&emptyString=", + ); + }); + + it("should handle deeply nested objects", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + user: { + profile: { + name: "John", + settings: { theme: "dark" }, + }, + }, + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", + ); + }); + + it("should handle arrays of objects", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + users: [ + { name: "John", age: 30 }, + { name: "Jane", age: 25 }, + ], + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?users%5Bname%5D=John&users%5Bage%5D=30&users%5Bname%5D=Jane&users%5Bage%5D=25", + ); + }); + + it("should handle mixed arrays", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + mixed: ["string", 42, true, { key: "value" }], + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?mixed=string&mixed=42&mixed=true&mixed%5Bkey%5D=value", + ); + }); + + it("should handle empty arrays", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { emptyArray: [] }; + expect(createRequestUrl(baseUrl, queryParams)).toBe(baseUrl); + }); + + it("should handle empty objects", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { emptyObject: {} }; + expect(createRequestUrl(baseUrl, queryParams)).toBe(baseUrl); + }); + + it("should handle special characters in keys", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { "key with spaces": "value", "key[with]brackets": "value" }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?key%20with%20spaces=value&key%5Bwith%5Dbrackets=value", + ); + }); + + it("should handle URL with existing query parameters", () => { + const baseUrl = "https://api.example.com?existing=param"; + const queryParams = { new: "value" }; + expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?existing=param?new=value"); + }); + + it("should handle complex nested structures", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], + }, + }, + sort: { field: "name", direction: "asc" }, + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + ); + }); }); diff --git a/tests/unit/fetcher/getFetchFn.test.ts b/tests/unit/fetcher/getFetchFn.test.ts index b55dbbc3..ac05ab2f 100644 --- a/tests/unit/fetcher/getFetchFn.test.ts +++ b/tests/unit/fetcher/getFetchFn.test.ts @@ -3,7 +3,7 @@ import { RUNTIME } from "../../../src/core/runtime"; describe("Test for getFetchFn", () => { it("should get node-fetch function", async () => { - if (RUNTIME.type == "node") { + if (RUNTIME.type === "node") { if (RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { expect(await getFetchFn()).toBe(fetch); } else { @@ -13,7 +13,7 @@ describe("Test for getFetchFn", () => { }); it("should get fetch function", async () => { - if (RUNTIME.type == "browser") { + if (RUNTIME.type === "browser") { const fetchFn = await getFetchFn(); expect(typeof fetchFn).toBe("function"); expect(fetchFn.name).toBe("fetch"); diff --git a/tests/unit/fetcher/getRequestBody.test.ts b/tests/unit/fetcher/getRequestBody.test.ts index 1e4a3d69..e864c8b5 100644 --- a/tests/unit/fetcher/getRequestBody.test.ts +++ b/tests/unit/fetcher/getRequestBody.test.ts @@ -2,18 +2,6 @@ import { getRequestBody } from "../../../src/core/fetcher/getRequestBody"; import { RUNTIME } from "../../../src/core/runtime"; describe("Test getRequestBody", () => { - it("should return FormData as is in Node environment", async () => { - if (RUNTIME.type === "node") { - const formData = new (await import("formdata-node")).FormData(); - formData.append("key", "value"); - const result = await getRequestBody({ - body: formData, - type: "file", - }); - expect(result).toBe(formData); - } - }); - it("should stringify body if not FormData in Node environment", async () => { if (RUNTIME.type === "node") { const body = { key: "value" }; @@ -27,7 +15,7 @@ describe("Test getRequestBody", () => { it("should return FormData in browser environment", async () => { if (RUNTIME.type === "browser") { - const formData = new (await import("form-data")).default(); + const formData = new FormData(); formData.append("key", "value"); const result = await getRequestBody({ body: formData, diff --git a/tests/unit/fetcher/getResponseBody.test.ts b/tests/unit/fetcher/getResponseBody.test.ts index 17ef223c..ad6bc5be 100644 --- a/tests/unit/fetcher/getResponseBody.test.ts +++ b/tests/unit/fetcher/getResponseBody.test.ts @@ -1,7 +1,6 @@ -import { RUNTIME } from "../../../src/core/runtime"; import { getResponseBody } from "../../../src/core/fetcher/getResponseBody"; - import { chooseStreamWrapper } from "../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; +import { RUNTIME } from "../../../src/core/runtime"; describe("Test getResponseBody", () => { it("should handle blob response type", async () => { diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index 3cdaa40a..6f9426fc 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -129,4 +129,107 @@ describe("requestWithRetries", () => { expect(response1.status).toBe(200); expect(response2.status).toBe(200); }); + + it("should respect retry-after header with seconds value", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "retry-after": "5" }), + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 5000); // 5 seconds = 5000ms + expect(response.status).toBe(200); + }); + + it("should respect retry-after header with HTTP date value", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + const futureDate = new Date(Date.now() + 3000); // 3 seconds from now + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "retry-after": futureDate.toUTCString() }), + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + // Should use the date-based delay (approximately 3000ms, but with jitter) + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); + const actualDelay = setTimeoutSpy.mock.calls[0][1]; + expect(actualDelay).toBeGreaterThan(2000); + expect(actualDelay).toBeLessThan(4000); + expect(response.status).toBe(200); + }); + + it("should respect x-ratelimit-reset header", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + const resetTime = Math.floor((Date.now() + 4000) / 1000); // 4 seconds from now in Unix timestamp + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "x-ratelimit-reset": resetTime.toString() }), + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + // Should use the x-ratelimit-reset delay (approximately 4000ms, but with positive jitter) + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); + const actualDelay = setTimeoutSpy.mock.calls[0][1]; + expect(actualDelay).toBeGreaterThan(3000); + expect(actualDelay).toBeLessThan(6000); + expect(response.status).toBe(200); + }); + + it("should cap delay at MAX_RETRY_DELAY for large header values", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "retry-after": "120" }), // 120 seconds = 120000ms > MAX_RETRY_DELAY (60000ms) + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + // Should be capped at MAX_RETRY_DELAY (60000ms) with jitter applied + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 60000); // Exactly MAX_RETRY_DELAY since jitter with 0.5 random keeps it at 60000 + expect(response.status).toBe(200); + }); }); diff --git a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts index 172c1c26..57892e4d 100644 --- a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts @@ -61,7 +61,7 @@ describe("Node18UniversalStreamWrapper", () => { }); const stream = new Node18UniversalStreamWrapper(rawStream); const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { + write(chunk, _encoding, callback) { expect(chunk.toString()).toEqual("test"); callback(); }, diff --git a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts index 19c26668..f47b166c 100644 --- a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts @@ -37,7 +37,7 @@ describe("NodePre18StreamWrapper", () => { const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { + write(chunk, _encoding, callback) { expect(chunk.toString()).toEqual("test"); callback(); }, @@ -51,7 +51,7 @@ describe("NodePre18StreamWrapper", () => { const stream = new NodePre18StreamWrapper(rawStream); const buffer: Uint8Array[] = []; const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { + write(chunk, _encoding, callback) { buffer.push(chunk); callback(); }, diff --git a/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts index 5752c8af..56cba346 100644 --- a/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts @@ -1,7 +1,7 @@ +import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; import { Node18UniversalStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper"; import { NodePre18StreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/NodePre18StreamWrapper"; import { UndiciStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/UndiciStreamWrapper"; -import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; import { RUNTIME } from "../../../../src/core/runtime"; describe("chooseStreamWrapper", () => { diff --git a/tests/unit/schemas/lazy/lazy.test.ts b/tests/unit/schemas/lazy/lazy.test.ts index 3a5a338d..57a76df2 100644 --- a/tests/unit/schemas/lazy/lazy.test.ts +++ b/tests/unit/schemas/lazy/lazy.test.ts @@ -1,5 +1,5 @@ -import { Schema } from "../../../../src/core/schemas/Schema"; import { lazy, list, object, string } from "../../../../src/core/schemas/builders"; +import type { Schema } from "../../../../src/core/schemas/Schema"; import { itSchemaIdentity } from "../utils/itSchema"; describe("lazy", () => { diff --git a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts index 09d594d0..822c3ca4 100644 --- a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts +++ b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts @@ -18,7 +18,7 @@ describe("getSchemaUtils", () => { itSchema( "transform and untransform run correctly", string().transform({ - transform: (x) => x + "X", + transform: (x) => `${x}X`, untransform: (x) => (x as string).slice(0, -1), }), { @@ -36,7 +36,7 @@ describe("getSchemaUtils", () => { it("throws on invalid value", async () => { const value = () => object({ a: string(), b: string() }).parseOrThrow({ a: 24 }); - expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); + expect(value).toThrowError('a: Expected string. Received 24.; Missing required key "b"'); }); }); @@ -48,7 +48,7 @@ describe("getSchemaUtils", () => { it("throws on invalid value", async () => { const value = () => object({ a: string(), b: string() }).jsonOrThrow({ a: 24 }); - expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); + expect(value).toThrowError('a: Expected string. Received 24.; Missing required key "b"'); }); }); diff --git a/tests/unit/schemas/utils/itSchema.ts b/tests/unit/schemas/utils/itSchema.ts index 82a53887..a1e1cae9 100644 --- a/tests/unit/schemas/utils/itSchema.ts +++ b/tests/unit/schemas/utils/itSchema.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/no-export */ -import { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; +import type { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; export function itSchemaIdentity( schema: Schema, @@ -48,7 +48,7 @@ export function itParse( it(title, () => { const maybeValid = schema.parse(raw, opts); if (!maybeValid.ok) { - throw new Error("Failed to parse() " + JSON.stringify(maybeValid.errors, undefined, 4)); + throw new Error(`Failed to parse() ${JSON.stringify(maybeValid.errors, undefined, 4)}`); } expect(maybeValid.value).toStrictEqual(parsed); }); @@ -71,7 +71,7 @@ export function itJson( it(title, () => { const maybeValid = schema.json(parsed, opts); if (!maybeValid.ok) { - throw new Error("Failed to json() " + JSON.stringify(maybeValid.errors, undefined, 4)); + throw new Error(`Failed to json() ${JSON.stringify(maybeValid.errors, undefined, 4)}`); } expect(maybeValid.value).toStrictEqual(raw); }); diff --git a/tests/unit/schemas/utils/itValidate.ts b/tests/unit/schemas/utils/itValidate.ts index ead1ca70..ffe40cef 100644 --- a/tests/unit/schemas/utils/itValidate.ts +++ b/tests/unit/schemas/utils/itValidate.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/no-export */ -import { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; +import type { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; export function itValidate( title: string, diff --git a/tests/unit/url/join.test.ts b/tests/unit/url/join.test.ts new file mode 100644 index 00000000..1956a8c0 --- /dev/null +++ b/tests/unit/url/join.test.ts @@ -0,0 +1,120 @@ +import { join } from "../../../src/core/url/index"; + +describe("join", () => { + describe("basic functionality", () => { + it("should return empty string for empty base", () => { + expect(join("")).toBe(""); + expect(join("", "path")).toBe(""); + }); + + it("should handle single segment", () => { + expect(join("base", "segment")).toBe("base/segment"); + expect(join("base/", "segment")).toBe("base/segment"); + expect(join("base", "/segment")).toBe("base/segment"); + expect(join("base/", "/segment")).toBe("base/segment"); + }); + + it("should handle multiple segments", () => { + expect(join("base", "path1", "path2", "path3")).toBe("base/path1/path2/path3"); + expect(join("base/", "/path1/", "/path2/", "/path3/")).toBe("base/path1/path2/path3/"); + }); + }); + + describe("URL handling", () => { + it("should handle absolute URLs", () => { + expect(join("https://example.com", "api", "v1")).toBe("https://example.com/api/v1"); + expect(join("https://example.com/", "/api/", "/v1/")).toBe("https://example.com/api/v1/"); + expect(join("https://example.com/base", "api", "v1")).toBe("https://example.com/base/api/v1"); + }); + + it("should preserve URL query parameters and fragments", () => { + expect(join("https://example.com?query=1", "api")).toBe("https://example.com/api?query=1"); + expect(join("https://example.com#fragment", "api")).toBe("https://example.com/api#fragment"); + expect(join("https://example.com?query=1#fragment", "api")).toBe( + "https://example.com/api?query=1#fragment", + ); + }); + + it("should handle different protocols", () => { + expect(join("http://example.com", "api")).toBe("http://example.com/api"); + expect(join("ftp://example.com", "files")).toBe("ftp://example.com/files"); + expect(join("ws://example.com", "socket")).toBe("ws://example.com/socket"); + }); + + it("should fallback to path joining for malformed URLs", () => { + expect(join("not-a-url://", "path")).toBe("not-a-url:///path"); + }); + }); + + describe("edge cases", () => { + it("should handle empty segments", () => { + expect(join("base", "", "path")).toBe("base/path"); + expect(join("base", null as any, "path")).toBe("base/path"); + expect(join("base", undefined as any, "path")).toBe("base/path"); + }); + + it("should handle segments with only slashes", () => { + expect(join("base", "/", "path")).toBe("base/path"); + expect(join("base", "//", "path")).toBe("base/path"); + }); + + it("should handle base paths with trailing slashes", () => { + expect(join("base/", "path")).toBe("base/path"); + }); + + it("should handle complex nested paths", () => { + expect(join("api/v1/", "/users/", "/123/", "/profile")).toBe("api/v1/users/123/profile"); + }); + }); + + describe("real-world scenarios", () => { + it("should handle API endpoint construction", () => { + const baseUrl = "https://api.example.com/v1"; + expect(join(baseUrl, "users", "123", "posts")).toBe("https://api.example.com/v1/users/123/posts"); + }); + + it("should handle file path construction", () => { + expect(join("/var/www", "html", "assets", "images")).toBe("/var/www/html/assets/images"); + }); + + it("should handle relative path construction", () => { + expect(join("../parent", "child", "grandchild")).toBe("../parent/child/grandchild"); + }); + + it("should handle Windows-style paths", () => { + expect(join("C:\\Users", "Documents", "file.txt")).toBe("C:\\Users/Documents/file.txt"); + }); + }); + + describe("performance scenarios", () => { + it("should handle many segments efficiently", () => { + const segments = Array(100).fill("segment"); + const result = join("base", ...segments); + expect(result).toBe(`base/${segments.join("/")}`); + }); + + it("should handle long URLs", () => { + const longPath = "a".repeat(1000); + expect(join("https://example.com", longPath)).toBe(`https://example.com/${longPath}`); + }); + }); + + describe("trailing slash preservation", () => { + it("should preserve trailing slash on final result when base has trailing slash and no segments", () => { + expect(join("https://api.example.com/")).toBe("https://api.example.com/"); + expect(join("https://api.example.com/v1/")).toBe("https://api.example.com/v1/"); + }); + + it("should preserve trailing slash when last segment has trailing slash", () => { + expect(join("https://api.example.com", "users/")).toBe("https://api.example.com/users/"); + expect(join("api/v1", "users/")).toBe("api/v1/users/"); + }); + + it("should preserve trailing slash with multiple segments where last has trailing slash", () => { + expect(join("https://api.example.com", "v1", "collections/")).toBe( + "https://api.example.com/v1/collections/", + ); + expect(join("base", "path1", "path2/")).toBe("base/path1/path2/"); + }); + }); +}); diff --git a/tests/unit/url/qs.test.ts b/tests/unit/url/qs.test.ts new file mode 100644 index 00000000..80e7e044 --- /dev/null +++ b/tests/unit/url/qs.test.ts @@ -0,0 +1,187 @@ +import { toQueryString } from "../../../src/core/url/index"; + +describe("Test qs toQueryString", () => { + describe("Basic functionality", () => { + it("should return empty string for null/undefined", () => { + expect(toQueryString(null)).toBe(""); + expect(toQueryString(undefined)).toBe(""); + }); + + it("should return empty string for primitive values", () => { + expect(toQueryString("hello")).toBe(""); + expect(toQueryString(42)).toBe(""); + expect(toQueryString(true)).toBe(""); + expect(toQueryString(false)).toBe(""); + }); + + it("should handle empty objects", () => { + expect(toQueryString({})).toBe(""); + }); + + it("should handle simple key-value pairs", () => { + const obj = { name: "John", age: 30 }; + expect(toQueryString(obj)).toBe("name=John&age=30"); + }); + }); + + describe("Array handling", () => { + it("should handle arrays with indices format (default)", () => { + const obj = { items: ["a", "b", "c"] }; + expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=b&items%5B2%5D=c"); + }); + + it("should handle arrays with repeat format", () => { + const obj = { items: ["a", "b", "c"] }; + expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe("items=a&items=b&items=c"); + }); + + it("should handle empty arrays", () => { + const obj = { items: [] }; + expect(toQueryString(obj)).toBe(""); + }); + + it("should handle arrays with mixed types", () => { + const obj = { mixed: ["string", 42, true, false] }; + expect(toQueryString(obj)).toBe("mixed%5B0%5D=string&mixed%5B1%5D=42&mixed%5B2%5D=true&mixed%5B3%5D=false"); + }); + + it("should handle arrays with objects", () => { + const obj = { users: [{ name: "John" }, { name: "Jane" }] }; + expect(toQueryString(obj)).toBe("users%5B0%5D%5Bname%5D=John&users%5B1%5D%5Bname%5D=Jane"); + }); + + it("should handle arrays with objects in repeat format", () => { + const obj = { users: [{ name: "John" }, { name: "Jane" }] }; + expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe("users%5Bname%5D=John&users%5Bname%5D=Jane"); + }); + }); + + describe("Nested objects", () => { + it("should handle nested objects", () => { + const obj = { user: { name: "John", age: 30 } }; + expect(toQueryString(obj)).toBe("user%5Bname%5D=John&user%5Bage%5D=30"); + }); + + it("should handle deeply nested objects", () => { + const obj = { user: { profile: { name: "John", settings: { theme: "dark" } } } }; + expect(toQueryString(obj)).toBe( + "user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", + ); + }); + + it("should handle empty nested objects", () => { + const obj = { user: {} }; + expect(toQueryString(obj)).toBe(""); + }); + }); + + describe("Encoding", () => { + it("should encode by default", () => { + const obj = { name: "John Doe", email: "john@example.com" }; + expect(toQueryString(obj)).toBe("name=John%20Doe&email=john%40example.com"); + }); + + it("should not encode when encode is false", () => { + const obj = { name: "John Doe", email: "john@example.com" }; + expect(toQueryString(obj, { encode: false })).toBe("name=John Doe&email=john@example.com"); + }); + + it("should encode special characters in keys", () => { + const obj = { "user name": "John", "email[primary]": "john@example.com" }; + expect(toQueryString(obj)).toBe("user%20name=John&email%5Bprimary%5D=john%40example.com"); + }); + + it("should not encode special characters in keys when encode is false", () => { + const obj = { "user name": "John", "email[primary]": "john@example.com" }; + expect(toQueryString(obj, { encode: false })).toBe("user name=John&email[primary]=john@example.com"); + }); + }); + + describe("Mixed scenarios", () => { + it("should handle complex nested structures", () => { + const obj = { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], + }, + }, + sort: { field: "name", direction: "asc" }, + }; + expect(toQueryString(obj)).toBe( + "filters%5Bstatus%5D%5B0%5D=active&filters%5Bstatus%5D%5B1%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D%5B0%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D%5B1%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + ); + }); + + it("should handle complex nested structures with repeat format", () => { + const obj = { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], + }, + }, + sort: { field: "name", direction: "asc" }, + }; + expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe( + "filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + ); + }); + + it("should handle arrays with null/undefined values", () => { + const obj = { items: ["a", null, "c", undefined, "e"] }; + expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c&items%5B4%5D=e"); + }); + + it("should handle objects with null/undefined values", () => { + const obj = { name: "John", age: null, email: undefined, active: true }; + expect(toQueryString(obj)).toBe("name=John&age=&active=true"); + }); + }); + + describe("Edge cases", () => { + it("should handle numeric keys", () => { + const obj = { "0": "zero", "1": "one" }; + expect(toQueryString(obj)).toBe("0=zero&1=one"); + }); + + it("should handle boolean values in objects", () => { + const obj = { enabled: true, disabled: false }; + expect(toQueryString(obj)).toBe("enabled=true&disabled=false"); + }); + + it("should handle empty strings", () => { + const obj = { name: "", description: "test" }; + expect(toQueryString(obj)).toBe("name=&description=test"); + }); + + it("should handle zero values", () => { + const obj = { count: 0, price: 0.0 }; + expect(toQueryString(obj)).toBe("count=0&price=0"); + }); + + it("should handle arrays with empty strings", () => { + const obj = { items: ["a", "", "c"] }; + expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c"); + }); + }); + + describe("Options combinations", () => { + it("should respect both arrayFormat and encode options", () => { + const obj = { items: ["a & b", "c & d"] }; + expect(toQueryString(obj, { arrayFormat: "repeat", encode: false })).toBe("items=a & b&items=c & d"); + }); + + it("should use default options when none provided", () => { + const obj = { items: ["a", "b"] }; + expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=b"); + }); + + it("should merge provided options with defaults", () => { + const obj = { items: ["a", "b"], name: "John Doe" }; + expect(toQueryString(obj, { encode: false })).toBe("items[0]=a&items[1]=b&name=John Doe"); + }); + }); +}); diff --git a/tests/wire/.gitkeep b/tests/wire/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tests/wire/accessGroups.test.ts b/tests/wire/accessGroups.test.ts index 808ca1e2..a5848636 100644 --- a/tests/wire/accessGroups.test.ts +++ b/tests/wire/accessGroups.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("AccessGroups", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -71,4 +70,130 @@ describe("AccessGroups", () => { ], }); }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/accessgroups") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.accessGroups.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/accessgroups") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.accessGroups.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/accessgroups") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.accessGroups.list("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/accessgroups") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.accessGroups.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/accessgroups") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.accessGroups.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/accessgroups") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.accessGroups.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/assets.test.ts b/tests/wire/assets.test.ts index 09550c88..e49a5113 100644 --- a/tests/wire/assets.test.ts +++ b/tests/wire/assets.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Assets", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -145,7 +144,112 @@ describe("Assets", () => { }); }); - test("create", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/assets") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/assets") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/assets") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/assets") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/assets") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -221,7 +325,132 @@ describe("Assets", () => { }); }); - test("get", async () => { + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/assets") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.create("site_id", { + fileName: "fileName", + fileHash: "fileHash", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/assets") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.create("site_id", { + fileName: "fileName", + fileHash: "fileHash", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/assets") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.create("site_id", { + fileName: "fileName", + fileHash: "fileHash", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/assets") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.create("site_id", { + fileName: "fileName", + fileHash: "fileHash", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/assets") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.create("site_id", { + fileName: "fileName", + fileHash: "fileHash", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -291,7 +520,82 @@ describe("Assets", () => { }); }); - test("delete", async () => { + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.assets.get("asset_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.assets.get("asset_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.assets.get("asset_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.assets.get("asset_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.assets.get("asset_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -304,7 +608,112 @@ describe("Assets", () => { expect(response).toEqual(undefined); }); - test("update", async () => { + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/assets/asset_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.delete("asset_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/assets/asset_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.delete("asset_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/assets/asset_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.delete("asset_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/assets/asset_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.delete("asset_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/assets/asset_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.delete("asset_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -375,13 +784,123 @@ describe("Assets", () => { }); }); - test("list-folders", async () => { + test("update (2)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/assets/asset_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.update("asset_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/assets/asset_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.update("asset_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/assets/asset_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.update("asset_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/assets/asset_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.update("asset_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/assets/asset_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.update("asset_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("list-folders (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawResponseBody = { assetFolders: [ { @@ -425,7 +944,112 @@ describe("Assets", () => { }); }); - test("create-folder", async () => { + test("list-folders (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/asset_folders") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.listFolders("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-folders (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/asset_folders") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.listFolders("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-folders (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/asset_folders") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.listFolders("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-folders (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/asset_folders") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.listFolders("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-folders (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/asset_folders") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.listFolders("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create-folder (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -464,7 +1088,127 @@ describe("Assets", () => { }); }); - test("get-folder", async () => { + test("create-folder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/asset_folders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.createFolder("site_id", { + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create-folder (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/asset_folders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.createFolder("site_id", { + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create-folder (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/asset_folders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.createFolder("site_id", { + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create-folder (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/asset_folders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.createFolder("site_id", { + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create-folder (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/asset_folders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.createFolder("site_id", { + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-folder (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -499,4 +1243,109 @@ describe("Assets", () => { lastUpdated: new Date("2022-12-07T16:51:37.000Z"), }); }); + + test("get-folder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/asset_folders/asset_folder_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.getFolder("asset_folder_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-folder (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/asset_folders/asset_folder_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.getFolder("asset_folder_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-folder (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/asset_folders/asset_folder_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.getFolder("asset_folder_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-folder (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/asset_folders/asset_folder_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.getFolder("asset_folder_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-folder (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/asset_folders/asset_folder_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.assets.getFolder("asset_folder_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/collections.test.ts b/tests/wire/collections.test.ts index 20c4f5ab..b60b6411 100644 --- a/tests/wire/collections.test.ts +++ b/tests/wire/collections.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Collections", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -80,7 +79,112 @@ describe("Collections", () => { }); }); - test("create", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/collections") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/collections") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/collections") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/collections") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/collections") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -220,7 +324,157 @@ describe("Collections", () => { }); }); - test("get", async () => { + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/collections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.create("site_id", { + displayName: "displayName", + singularName: "singularName", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/collections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.create("site_id", { + displayName: "displayName", + singularName: "singularName", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/collections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.create("site_id", { + displayName: "displayName", + singularName: "singularName", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/collections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.create("site_id", { + displayName: "displayName", + singularName: "singularName", + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/collections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.create("site_id", { + displayName: "displayName", + singularName: "singularName", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/collections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.create("site_id", { + displayName: "displayName", + singularName: "singularName", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -564,7 +818,112 @@ describe("Collections", () => { }); }); - test("delete", async () => { + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/collections/collection_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.get("collection_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.get("collection_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.get("collection_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.get("collection_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.get("collection_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -576,4 +935,109 @@ describe("Collections", () => { const response = await client.collections.delete("580e63fc8c9a982ac9b8b745"); expect(response).toEqual(undefined); }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/collections/collection_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.delete("collection_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.delete("collection_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.delete("collection_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.delete("collection_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.delete("collection_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/collections/fields.test.ts b/tests/wire/collections/fields.test.ts index 6e27aaf6..c5480717 100644 --- a/tests/wire/collections/fields.test.ts +++ b/tests/wire/collections/fields.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Fields", () => { - test("create", async () => { + test("create (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -55,7 +54,291 @@ describe("Fields", () => { }); }); - test("delete", async () => { + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + id: "562ac0395358780a1f5e6fbc", + isEditable: true, + isRequired: false, + type: "Option", + displayName: "Post Type", + helpText: "Add the body of your post here", + metadata: { options: [{ name: "Feature" }, { name: "News" }, { name: "Product Highlight" }] }, + }; + const rawResponseBody = { + id: "562ac0395358780a1f5e6fbc", + isEditable: true, + isRequired: false, + type: "Option", + displayName: "Post Type", + helpText: "Add the body of your post here", + metadata: { options: [{ name: "Feature" }, { name: "News" }, { name: "Product Highlight" }] }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/fields") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + id: "562ac0395358780a1f5e6fbc", + isEditable: true, + isRequired: false, + type: "Option", + displayName: "Post Type", + helpText: "Add the body of your post here", + metadata: { + options: [ + { + name: "Feature", + }, + { + name: "News", + }, + { + name: "Product Highlight", + }, + ], + }, + }); + expect(response).toEqual({ + id: "562ac0395358780a1f5e6fbc", + isEditable: true, + isRequired: false, + type: "Option", + displayName: "Post Type", + helpText: "Add the body of your post here", + metadata: { + options: [ + { + name: "Feature", + }, + { + name: "News", + }, + { + name: "Product Highlight", + }, + ], + }, + }); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + id: "562ac0395358780a1f5e6fbd", + isEditable: true, + isRequired: false, + type: "Reference", + displayName: "Author", + helpText: "Add the post author here", + metadata: { collectionId: "63692ab61fb2852f582ba8f5" }, + }; + const rawResponseBody = { + id: "562ac0395358780a1f5e6fbd", + isEditable: true, + isRequired: false, + type: "Reference", + displayName: "Author", + helpText: "Add the post author here", + metadata: { collectionId: "63692ab61fb2852f582ba8f5" }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/fields") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + id: "562ac0395358780a1f5e6fbd", + isEditable: true, + isRequired: false, + type: "Reference", + displayName: "Author", + helpText: "Add the post author here", + metadata: { + collectionId: "63692ab61fb2852f582ba8f5", + }, + }); + expect(response).toEqual({ + id: "562ac0395358780a1f5e6fbd", + isEditable: true, + isRequired: false, + type: "Reference", + displayName: "Author", + helpText: "Add the post author here", + metadata: { + collectionId: "63692ab61fb2852f582ba8f5", + }, + }); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { type: "Color", displayName: "displayName" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/collections/collection_id/fields") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.create("collection_id", { + type: "Color", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { type: "Color", displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/fields") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.create("collection_id", { + type: "Color", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { type: "Color", displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/fields") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.create("collection_id", { + type: "Color", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { type: "Color", displayName: "displayName" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/collections/collection_id/fields") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.create("collection_id", { + type: "Color", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("create (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { type: "Color", displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/fields") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.create("collection_id", { + type: "Color", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create (9)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { type: "Color", displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/fields") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.create("collection_id", { + type: "Color", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -73,7 +356,112 @@ describe("Fields", () => { expect(response).toEqual(undefined); }); - test("update", async () => { + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/collections/collection_id/fields/field_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.delete("collection_id", "field_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/fields/field_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.delete("collection_id", "field_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/fields/field_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.delete("collection_id", "field_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/fields/field_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.delete("collection_id", "field_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/fields/field_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.delete("collection_id", "field_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -125,4 +513,114 @@ describe("Fields", () => { }, }); }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/collection_id/fields/field_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.update("collection_id", "field_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/fields/field_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.update("collection_id", "field_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/fields/field_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.update("collection_id", "field_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/fields/field_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.update("collection_id", "field_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/fields/field_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.fields.update("collection_id", "field_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/collections/items.test.ts b/tests/wire/collections/items.test.ts index e3500c2d..063dc6b8 100644 --- a/tests/wire/collections/items.test.ts +++ b/tests/wire/collections/items.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Items", () => { - test("list-items", async () => { + test("list-items (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -23,7 +22,12 @@ describe("Items", () => { createdOn: "2022-06-25T14:51:27.809Z", isArchived: false, isDraft: false, - fieldData: { name: "Senior Data Analyst", slug: "senior-data-analyst" }, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + name: "Senior Data Analyst", + slug: "senior-data-analyst", + }, }, { id: "62c880ef281c7b7b4cf9dabc", @@ -33,7 +37,12 @@ describe("Items", () => { createdOn: "2023-04-10T11:45:30.567Z", isArchived: false, isDraft: false, - fieldData: { name: "Product Manager", slug: "product-manager" }, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + name: "Product Manager", + slug: "product-manager", + }, }, ], pagination: { limit: 25, offset: 0, total: 2 }, @@ -68,6 +77,8 @@ describe("Items", () => { fieldData: { name: "Senior Data Analyst", slug: "senior-data-analyst", + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", }, }, { @@ -81,6 +92,8 @@ describe("Items", () => { fieldData: { name: "Product Manager", slug: "product-manager", + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", }, }, ], @@ -92,7 +105,112 @@ describe("Items", () => { }); }); - test("create-item", async () => { + test("list-items (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/collections/collection_id/items") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItems("collection_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-items (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItems("collection_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-items (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItems("collection_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-items (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItems("collection_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-items (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItems("collection_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create-item (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -101,7 +219,33 @@ describe("Items", () => { const rawRequestBody = { isArchived: false, isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, }; const rawResponseBody = { id: "42b720ef280c7a7a3be8cabe", @@ -111,7 +255,33 @@ describe("Items", () => { createdOn: "2022-11-17T17:11:57.148Z", isArchived: false, isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, }; server .mockEndpoint() @@ -130,6 +300,38 @@ describe("Items", () => { fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, }, }, }); @@ -144,37 +346,43 @@ describe("Items", () => { fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - }, - }); - }); - - test("delete-items", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "580e64008c9a982ac9b8b754" }] }; - - server - .mockEndpoint() - .delete("/collections/580e63fc8c9a982ac9b8b745/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .build(); - - const response = await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", { - items: [ - { - id: "580e64008c9a982ac9b8b754", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", }, - ], + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, }); - expect(response).toEqual(undefined); }); - test("update-items", async () => { + test("create-item (2)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -183,324 +391,243 @@ describe("Items", () => { const rawRequestBody = { items: [ { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias" }, - }, - ], - }; - const rawResponseBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, - fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci" }, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + name: "Senior Data Analyst", + slug: "senior-data-analyst", + }, }, { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, - fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias" }, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + name: "Product Manager", + slug: "product-manager", + }, }, ], - pagination: { limit: 25, offset: 0, total: 4 }, + }; + const rawResponseBody = { + id: "id", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + name: "My new item", + slug: "my-new-item", + }, }; server .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items") + .post("/collections/580e63fc8c9a982ac9b8b745/items") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { + const response = await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", { skipInvalidFiles: true, - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { - name: "Ne Paniquez Pas", - slug: "ne-paniquez-pas", + body: { + items: [ + { + isArchived: false, + isDraft: false, + fieldData: { + name: "Senior Data Analyst", + slug: "senior-data-analyst", + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + }, }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", + { + isArchived: false, + isDraft: false, + fieldData: { + name: "Product Manager", + slug: "product-manager", + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + }, + }, + ], + }, + }); + expect(response).toEqual({ + id: "id", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + name: "My new item", + slug: "my-new-item", + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + }, + }); + }); + + test("create-item (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItem("collection_id", { + body: { fieldData: { - name: "No Entrar en P\u00E1nico", - slug: "no-entrar-en-panico", + name: "name", + slug: "slug", }, }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create-item (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItem("collection_id", { + body: { fieldData: { - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", + name: "name", + slug: "slug", }, }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - }, - }, - ], + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create-item (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - expect(response).toEqual({ - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Ne Paniquez Pas", - slug: "ne-paniquez-pas", - }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "No Entrar en P\u00E1nico", - slug: "no-entrar-en-panico", - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItem("collection_id", { + body: { fieldData: { - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", + name: "name", + slug: "slug", }, }, - ], - pagination: { - limit: 25, - offset: 0, - total: 4, - }, - }); + }); + }).rejects.toThrow(Webflow.NotFoundError); }); - test("list-items-live", async () => { + test("create-item (6)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - - const rawResponseBody = { - items: [ - { - id: "62b720ef280c7a7a3be8cabe", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2022-06-30T13:35:20.878Z", - lastUpdated: "2022-06-25T14:51:27.809Z", - createdOn: "2022-06-25T14:51:27.809Z", - isArchived: false, - isDraft: false, - fieldData: { name: "Senior Data Analyst", slug: "senior-data-analyst" }, - }, - { - id: "62c880ef281c7b7b4cf9dabc", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2023-04-15T10:25:18.123Z", - lastUpdated: "2023-04-10T11:45:30.567Z", - createdOn: "2023-04-10T11:45:30.567Z", - isArchived: false, - isDraft: false, - fieldData: { name: "Product Manager", slug: "product-manager" }, - }, - ], - pagination: { limit: 25, offset: 0, total: 2 }, - }; + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; server .mockEndpoint() - .get("/collections/580e63fc8c9a982ac9b8b745/items/live") + .post("/collections/collection_id/items") + .jsonBody(rawRequestBody) .respondWith() - .statusCode(200) + .statusCode(429) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { - cmsLocaleId: "cmsLocaleId", - offset: 1.1, - limit: 1.1, - name: "name", - slug: "slug", - sortBy: "lastPublished", - sortOrder: "asc", - }); - expect(response).toEqual({ - items: [ - { - id: "62b720ef280c7a7a3be8cabe", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2022-06-30T13:35:20.878Z", - lastUpdated: "2022-06-25T14:51:27.809Z", - createdOn: "2022-06-25T14:51:27.809Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Senior Data Analyst", - slug: "senior-data-analyst", - }, - }, - { - id: "62c880ef281c7b7b4cf9dabc", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2023-04-15T10:25:18.123Z", - lastUpdated: "2023-04-10T11:45:30.567Z", - createdOn: "2023-04-10T11:45:30.567Z", - isArchived: false, - isDraft: false, + await expect(async () => { + return await client.collections.items.createItem("collection_id", { + body: { fieldData: { - name: "Product Manager", - slug: "product-manager", + name: "name", + slug: "slug", }, }, - ], - pagination: { - limit: 25, - offset: 0, - total: 2, - }, - }); + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); }); - test("create-item-live", async () => { + test("create-item (7)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = { - isArchived: false, - isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, - }; - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, - }; + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; server .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/live") + .post("/collections/collection_id/items") .jsonBody(rawRequestBody) .respondWith() - .statusCode(200) + .statusCode(500) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - body: { - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", + await expect(async () => { + return await client.collections.items.createItem("collection_id", { + body: { + fieldData: { + name: "name", + slug: "slug", + }, }, - }, - }); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }); + }); + }).rejects.toThrow(Webflow.InternalServerError); }); - test("delete-items-live", async () => { + test("delete-items (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -510,13 +637,13 @@ describe("Items", () => { server .mockEndpoint() - .delete("/collections/580e63fc8c9a982ac9b8b745/items/live") + .delete("/collections/580e63fc8c9a982ac9b8b745/items") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .build(); - const response = await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", { + const response = await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", { items: [ { id: "580e64008c9a982ac9b8b754", @@ -526,90 +653,293 @@ describe("Items", () => { expect(response).toEqual(undefined); }); - test("update-items-live", async () => { + test("delete-items (2)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias" }, - }, - ], - }; - const rawResponseBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias" }, - }, - ], - }; + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = { key: "value" }; server .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") + .delete("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItems("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete-items (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItems("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete-items (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItems("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete-items (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItems("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("delete-items (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItems("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete-items (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItems("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-items (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + featured: false, + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + featured: false, + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], + }; + const rawResponseBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + featured: false, + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + featured: false, + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], + pagination: { limit: 25, offset: 0, total: 4 }, + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + const response = await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { skipInvalidFiles: true, items: [ { @@ -618,6 +948,7 @@ describe("Items", () => { fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas", + featured: false, }, }, { @@ -626,6 +957,7 @@ describe("Items", () => { fieldData: { name: "No Entrar en P\u00E1nico", slug: "no-entrar-en-panico", + featured: false, }, }, { @@ -634,6 +966,7 @@ describe("Items", () => { fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci", + featured: false, }, }, { @@ -642,6 +975,7 @@ describe("Items", () => { fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias", + featured: false, }, }, ], @@ -659,6 +993,7 @@ describe("Items", () => { fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas", + featured: false, }, }, { @@ -672,6 +1007,7 @@ describe("Items", () => { fieldData: { name: "No Entrar en P\u00E1nico", slug: "no-entrar-en-panico", + featured: false, }, }, { @@ -685,6 +1021,7 @@ describe("Items", () => { fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci", + featured: false, }, }, { @@ -698,358 +1035,3947 @@ describe("Items", () => { fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias", + featured: false, + }, + }, + ], + pagination: { + limit: 25, + offset: 0, + total: 4, + }, + }); + }); + + test("update-items (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + items: [ + { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + name: "Senior Data Analyst", + slug: "senior-data-analyst", + }, + }, + { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + name: "Product Manager", + slug: "product-manager", + }, + }, + ], + }; + const rawResponseBody = { + items: [ + { + id: "62b720ef280c7a7a3be8cabe", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2022-06-30T13:35:20.878Z", + lastUpdated: "2022-06-25T14:51:27.809Z", + createdOn: "2022-06-25T14:51:27.809Z", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + name: "Senior Data Analyst", + slug: "senior-data-analyst", + }, + }, + { + id: "62c880ef281c7b7b4cf9dabc", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2023-04-15T10:25:18.123Z", + lastUpdated: "2023-04-10T11:45:30.567Z", + createdOn: "2023-04-10T11:45:30.567Z", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + name: "Product Manager", + slug: "product-manager", }, }, ], + pagination: { limit: 25, offset: 0, total: 2 }, + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + items: [ + { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + name: "Senior Data Analyst", + slug: "senior-data-analyst", + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + }, + }, + { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + name: "Product Manager", + slug: "product-manager", + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + }, + }, + ], + }); + expect(response).toEqual({ + items: [ + { + id: "62b720ef280c7a7a3be8cabe", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2022-06-30T13:35:20.878Z", + lastUpdated: "2022-06-25T14:51:27.809Z", + createdOn: "2022-06-25T14:51:27.809Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Senior Data Analyst", + slug: "senior-data-analyst", + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + }, + }, + { + id: "62c880ef281c7b7b4cf9dabc", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2023-04-15T10:25:18.123Z", + lastUpdated: "2023-04-10T11:45:30.567Z", + createdOn: "2023-04-10T11:45:30.567Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Product Manager", + slug: "product-manager", + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + }, + }, + ], + pagination: { + limit: 25, + offset: 0, + total: 2, + }, + }); + }); + + test("update-items (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItems("collection_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-items (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItems("collection_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-items (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItems("collection_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-items (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItems("collection_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-items (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItems("collection_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("list-items-live (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { + items: [ + { + id: "62b720ef280c7a7a3be8cabe", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2022-06-30T13:35:20.878Z", + lastUpdated: "2022-06-25T14:51:27.809Z", + createdOn: "2022-06-25T14:51:27.809Z", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + name: "Senior Data Analyst", + slug: "senior-data-analyst", + }, + }, + { + id: "62c880ef281c7b7b4cf9dabc", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2023-04-15T10:25:18.123Z", + lastUpdated: "2023-04-10T11:45:30.567Z", + createdOn: "2023-04-10T11:45:30.567Z", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + name: "Product Manager", + slug: "product-manager", + }, + }, + ], + pagination: { limit: 25, offset: 0, total: 2 }, + }; + server + .mockEndpoint() + .get("/collections/580e63fc8c9a982ac9b8b745/items/live") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { + cmsLocaleId: "cmsLocaleId", + offset: 1.1, + limit: 1.1, + name: "name", + slug: "slug", + sortBy: "lastPublished", + sortOrder: "asc", + }); + expect(response).toEqual({ + items: [ + { + id: "62b720ef280c7a7a3be8cabe", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2022-06-30T13:35:20.878Z", + lastUpdated: "2022-06-25T14:51:27.809Z", + createdOn: "2022-06-25T14:51:27.809Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Senior Data Analyst", + slug: "senior-data-analyst", + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + }, + }, + { + id: "62c880ef281c7b7b4cf9dabc", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2023-04-15T10:25:18.123Z", + lastUpdated: "2023-04-10T11:45:30.567Z", + createdOn: "2023-04-10T11:45:30.567Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Product Manager", + slug: "product-manager", + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + }, + }, + ], + pagination: { + limit: 25, + offset: 0, + total: 2, + }, + }); + }); + + test("list-items-live (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/collections/collection_id/items/live") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItemsLive("collection_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-items-live (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/live") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItemsLive("collection_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-items-live (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/live") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItemsLive("collection_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-items-live (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/live") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItemsLive("collection_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-items-live (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/live") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.listItemsLive("collection_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create-item-live (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + body: { + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }, + }); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }); + }); + + test("create-item-live (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + items: [ + { + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + name: "Senior Data Analyst", + slug: "senior-data-analyst", + }, + }, + { + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + name: "Product Manager", + slug: "product-manager", + }, + }, + ], + }; + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + body: { + items: [ + { + isArchived: false, + isDraft: false, + fieldData: { + name: "Senior Data Analyst", + slug: "senior-data-analyst", + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + }, + }, + { + isArchived: false, + isDraft: false, + fieldData: { + name: "Product Manager", + slug: "product-manager", + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + }, + }, + ], + }, + }); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }); + }); + + test("create-item-live (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItemLive("collection_id", { + body: { + fieldData: { + name: "name", + slug: "slug", + }, + }, + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create-item-live (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItemLive("collection_id", { + body: { + fieldData: { + name: "name", + slug: "slug", + }, + }, + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create-item-live (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItemLive("collection_id", { + body: { + fieldData: { + name: "name", + slug: "slug", + }, + }, + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create-item-live (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItemLive("collection_id", { + body: { + fieldData: { + name: "name", + slug: "slug", + }, + }, + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create-item-live (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItemLive("collection_id", { + body: { + fieldData: { + name: "name", + slug: "slug", + }, + }, + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete-items-live (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "580e64008c9a982ac9b8b754" }] }; + + server + .mockEndpoint() + .delete("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "580e64008c9a982ac9b8b754", + }, + ], + }); + expect(response).toEqual(undefined); + }); + + test("delete-items-live (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemsLive("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete-items-live (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemsLive("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete-items-live (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemsLive("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete-items-live (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemsLive("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete-items-live (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemsLive("collection_id", { + items: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-items-live (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + featured: false, + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + featured: false, + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], + }; + const rawResponseBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + featured: false, + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + featured: false, + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + featured: false, + }, + }, + ], + }); + expect(response).toEqual({ + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + featured: false, + }, + }, + ], + }); + }); + + test("update-items-live (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + items: [ + { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + name: "Senior Data Analyst", + slug: "senior-data-analyst", + }, + }, + { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + name: "Product Manager", + slug: "product-manager", + }, + }, + ], + }; + const rawResponseBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + featured: false, + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + featured: false, + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + items: [ + { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + name: "Senior Data Analyst", + slug: "senior-data-analyst", + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + }, + }, + { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + name: "Product Manager", + slug: "product-manager", + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + }, + }, + ], + }); + expect(response).toEqual({ + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + featured: false, + }, + }, + ], + }); + }); + + test("update-items-live (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + featured: false, + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + featured: false, + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], + }; + const rawResponseBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + featured: false, + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + featured: false, + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + featured: false, + }, + }, + ], + }); + expect(response).toEqual({ + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + featured: false, + }, + }, + ], + }); + }); + + test("update-items-live (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + featured: false, + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + featured: false, + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], + }; + const rawResponseBody = { + items: [ + { + id: "62b720ef280c7a7a3be8cabe", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2022-06-30T13:35:20.878Z", + lastUpdated: "2022-06-25T14:51:27.809Z", + createdOn: "2022-06-25T14:51:27.809Z", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + name: "Senior Data Analyst", + slug: "senior-data-analyst", + }, + }, + { + id: "62c880ef281c7b7b4cf9dabc", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2023-04-15T10:25:18.123Z", + lastUpdated: "2023-04-10T11:45:30.567Z", + createdOn: "2023-04-10T11:45:30.567Z", + isArchived: false, + isDraft: false, + fieldData: { + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + name: "Product Manager", + slug: "product-manager", + }, + }, + ], + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + featured: false, + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + featured: false, + }, + }, + ], + }); + expect(response).toEqual({ + items: [ + { + id: "62b720ef280c7a7a3be8cabe", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2022-06-30T13:35:20.878Z", + lastUpdated: "2022-06-25T14:51:27.809Z", + createdOn: "2022-06-25T14:51:27.809Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Senior Data Analyst", + slug: "senior-data-analyst", + url: "https://boards.greenhouse.io/webflow/jobs/26567701", + department: "Data", + }, + }, + { + id: "62c880ef281c7b7b4cf9dabc", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2023-04-15T10:25:18.123Z", + lastUpdated: "2023-04-10T11:45:30.567Z", + createdOn: "2023-04-10T11:45:30.567Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "Product Manager", + slug: "product-manager", + url: "https://boards.greenhouse.io/webflow/jobs/31234567", + department: "Product", + }, + }, + ], + }); + }); + + test("update-items-live (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemsLive("collection_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-items-live (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemsLive("collection_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-items-live (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemsLive("collection_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-items-live (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemsLive("collection_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update-items-live (9)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemsLive("collection_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-items-live (10)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemsLive("collection_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create-items (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { name: "Don’t Panic", slug: "dont-panic" }, + }; + const rawResponseBody = { + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + name: "My new item", + slug: "my-new-item", + }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { + name: "Don\u2019t Panic", + slug: "dont-panic", + }, + }); + expect(response).toEqual({ + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + name: "My new item", + slug: "my-new-item", + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + }, + }); + }); + + test("create-items (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"], + isArchived: false, + isDraft: false, + fieldData: [ + { name: "Don’t Panic", slug: "dont-panic" }, + { name: "So Long and Thanks for All the Fish", slug: "so-long-and-thanks" }, + ], + }; + const rawResponseBody = { + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + name: "My new item", + slug: "my-new-item", + }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"], + isArchived: false, + isDraft: false, + fieldData: [ + { + name: "Don\u2019t Panic", + slug: "dont-panic", + }, + { + name: "So Long and Thanks for All the Fish", + slug: "so-long-and-thanks", + }, + ], + }); + expect(response).toEqual({ + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + name: "My new item", + slug: "my-new-item", + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + }, + }); + }); + + test("create-items (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { name: "Don’t Panic", slug: "dont-panic" }, + }; + const rawResponseBody = { + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + name: "My new item", + slug: "my-new-item", + }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { + name: "Don\u2019t Panic", + slug: "dont-panic", + }, + }); + expect(response).toEqual({ + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + name: "My new item", + slug: "my-new-item", + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + }, + }); + }); + + test("create-items (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { name: "Don’t Panic", slug: "dont-panic" }, + }; + const rawResponseBody = { + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + name: "My new item", + slug: "my-new-item", + }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { + name: "Don\u2019t Panic", + slug: "dont-panic", + }, + }); + expect(response).toEqual({ + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + name: "My new item", + slug: "my-new-item", + date: "2022-11-18T00:00:00.000Z", + featured: false, + color: "#db4b68", + }, + }); + }); + + test("create-items (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/collections/collection_id/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItems("collection_id", { + fieldData: { + name: "name", + slug: "slug", + }, + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create-items (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItems("collection_id", { + fieldData: { + name: "name", + slug: "slug", + }, + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create-items (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItems("collection_id", { + fieldData: { + name: "name", + slug: "slug", + }, + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create-items (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItems("collection_id", { + fieldData: { + name: "name", + slug: "slug", + }, + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create-items (9)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/collections/collection_id/items/bulk") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.createItems("collection_id", { + fieldData: { + name: "name", + slug: "slug", + }, + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-item (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + server + .mockEndpoint() + .get("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.getItem( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + cmsLocaleId: "cmsLocaleId", + }, + ); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }); + }); + + test("get-item (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-item (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-item (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-item (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-item (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete-item (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.collections.items.deleteItem( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + cmsLocaleId: "cmsLocaleId", + }, + ); + expect(response).toEqual(undefined); + }); + + test("delete-item (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete-item (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete-item (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete-item (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete-item (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItem("collection_id", "item_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-item (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.updateItem( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + skipInvalidFiles: true, + body: { + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }, + }, + ); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }); + }); + + test("update-item (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItem("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-item (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItem("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-item (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItem("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-item (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItem("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-item (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItem("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-item-live (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + server + .mockEndpoint() + .get("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.getItemLive( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + cmsLocaleId: "cmsLocaleId", + }, + ); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }); + }); + + test("get-item-live (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-item-live (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-item-live (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-item-live (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-item-live (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.getItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete-item-live (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.collections.items.deleteItemLive( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + cmsLocaleId: "cmsLocaleId", + }, + ); + expect(response).toEqual(undefined); + }); + + test("delete-item-live (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete-item-live (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete-item-live (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete-item-live (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete-item-live (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/collections/collection_id/items/item_id/live") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.deleteItemLive("collection_id", "item_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-item-live (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + "image-gallery": [ + { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, + { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.updateItemLive( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + skipInvalidFiles: true, + body: { + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }, + }, + ); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + "plain-text": "Don't Panic.", + "rich-text": + "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", + "main-image": { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + "image-gallery": [ + { + fileId: "62b720ef280c7a7a3be8cabd", + url: "/files/62b720ef280c7a7a3be8cabd_image.png", + }, + { + fileId: "62b720ef280c7a7a3be8cabe", + url: "/files/62b720ef280c7a7a3be8cabe_image.png", + }, + ], + "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", + "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", + "contact-email": "zaphod.beeblebrox@heartofgold.gov", + "support-phone": "424-242-4242", + "answer-to-everything": 42, + "release-date": "1979-10-12T00:00:00.000Z", + "is-featured": true, + "brand-color": "#000000", + category: "62b720ef280c7a7a3be8cabf", + author: "62b720ef280c7a7a3be8cab0", + tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], + "downloadable-asset": { + fileId: "62b720ef280c7a7a3be8cab3", + url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", + }, + }, + }); + }); + + test("update-item-live (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemLive("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-item-live (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemLive("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-item-live (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemLive("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-item-live (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemLive("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update-item-live (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemLive("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-item-live (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/collection_id/items/item_id/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.collections.items.updateItemLive("collection_id", "item_id", { + body: {}, + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("publish-item (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], + }; + const rawResponseBody = { + publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], + errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/items/publish") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { + itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], + }); + expect(response).toEqual({ + publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], + errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], }); }); - test("create-items", async () => { + test("publish-item (2)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); const rawRequestBody = { - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], - isArchived: false, - isDraft: false, - fieldData: { name: "Don’t Panic", slug: "dont-panic" }, + items: [ + { id: "643fd856d66b6528195ee2ca", cmsLocaleIds: ["653ad57de882f528b32e810e"] }, + { id: "643fd856d66b6528195ee2cb", cmsLocaleIds: ["653ad57de882f528b32e810e"] }, + { id: "643fd856d66b6528195ee2cc", cmsLocaleIds: ["653ad57de882f528b32e810e"] }, + ], }; const rawResponseBody = { - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { name: "My new item", slug: "my-new-item" }, + publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], + errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], }; server .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") + .post("/collections/580e63fc8c9a982ac9b8b745/items/publish") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], - isArchived: false, - isDraft: false, - fieldData: { - name: "Don\u2019t Panic", - slug: "dont-panic", - }, + const response = await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "643fd856d66b6528195ee2ca", + cmsLocaleIds: ["653ad57de882f528b32e810e"], + }, + { + id: "643fd856d66b6528195ee2cb", + cmsLocaleIds: ["653ad57de882f528b32e810e"], + }, + { + id: "643fd856d66b6528195ee2cc", + cmsLocaleIds: ["653ad57de882f528b32e810e"], + }, + ], }); expect(response).toEqual({ - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - name: "My new item", - slug: "my-new-item", - }, + publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], + errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], }); }); - test("get-item", async () => { + test("publish-item (3)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - + const rawRequestBody = { + items: [ + { + id: "643fd856d66b6528195ee2ca", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + }, + ], + }; const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], + errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], }; server .mockEndpoint() - .get("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") + .post("/collections/580e63fc8c9a982ac9b8b745/items/publish") + .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.getItem( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - cmsLocaleId: "cmsLocaleId", - }, - ); + const response = await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "643fd856d66b6528195ee2ca", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + }, + ], + }); expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, + publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], + errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], }); }); - test("delete-item", async () => { + test("publish-item (4)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; server .mockEndpoint() - .delete("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") + .post("/collections/collection_id/items/publish") + .jsonBody(rawRequestBody) .respondWith() - .statusCode(200) + .statusCode(400) + .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.deleteItem( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - cmsLocaleId: "cmsLocaleId", - }, - ); - expect(response).toEqual(undefined); + await expect(async () => { + return await client.collections.items.publishItem("collection_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); }); - test("update-item", async () => { + test("publish-item (5)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = { - isArchived: false, - isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, - }; - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, - }; + const rawRequestBody = {}; + const rawResponseBody = {}; server .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") + .post("/collections/collection_id/items/publish") .jsonBody(rawRequestBody) .respondWith() - .statusCode(200) + .statusCode(401) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.updateItem( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - skipInvalidFiles: true, - body: { - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }, - }, - ); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }); + await expect(async () => { + return await client.collections.items.publishItem("collection_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); }); - test("get-item-live", async () => { + test("publish-item (6)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, - }; + const rawRequestBody = {}; + const rawResponseBody = {}; server .mockEndpoint() - .get("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") + .post("/collections/collection_id/items/publish") + .jsonBody(rawRequestBody) .respondWith() - .statusCode(200) + .statusCode(404) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.getItemLive( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - cmsLocaleId: "cmsLocaleId", - }, - ); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }); + await expect(async () => { + return await client.collections.items.publishItem("collection_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); }); - test("delete-item-live", async () => { + test("publish-item (7)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; server .mockEndpoint() - .delete("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") + .post("/collections/collection_id/items/publish") + .jsonBody(rawRequestBody) .respondWith() - .statusCode(200) + .statusCode(409) + .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.deleteItemLive( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - cmsLocaleId: "cmsLocaleId", - }, - ); - expect(response).toEqual(undefined); + await expect(async () => { + return await client.collections.items.publishItem("collection_id", {}); + }).rejects.toThrow(Webflow.ConflictError); }); - test("update-item-live", async () => { + test("publish-item (8)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = { - isArchived: false, - isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, - }; - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, - }; + const rawRequestBody = {}; + const rawResponseBody = {}; server .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") + .post("/collections/collection_id/items/publish") .jsonBody(rawRequestBody) .respondWith() - .statusCode(200) + .statusCode(429) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.updateItemLive( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - skipInvalidFiles: true, - body: { - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }, - }, - ); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }); + await expect(async () => { + return await client.collections.items.publishItem("collection_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); }); - test("publish-item", async () => { + test("publish-item (9)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = { - itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], - }; - const rawResponseBody = { - publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], - errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], - }; + const rawRequestBody = {}; + const rawResponseBody = {}; server .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/publish") + .post("/collections/collection_id/items/publish") .jsonBody(rawRequestBody) .respondWith() - .statusCode(200) + .statusCode(500) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { - itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], - }); - expect(response).toEqual({ - publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], - errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], - }); + await expect(async () => { + return await client.collections.items.publishItem("collection_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); }); }); diff --git a/tests/wire/components.test.ts b/tests/wire/components.test.ts index 8a669b4e..6e17e838 100644 --- a/tests/wire/components.test.ts +++ b/tests/wire/components.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Components", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -98,7 +97,112 @@ describe("Components", () => { }); }); - test("get-content", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/components") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-content (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -108,23 +212,23 @@ describe("Components", () => { const rawResponseBody = { componentId: "69118560-d0bc-15fc-bbf8-b8fe5f6535b5", nodes: [ - { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, - { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, - { id: "id", image: {}, attributes: { key: "value" }, type: "image" }, - { id: "id", placeholder: "placeholder", attributes: { key: "value" }, type: "text-input" }, - { id: "id", choices: [{ value: "value", text: "text" }], attributes: { key: "value" }, type: "select" }, + { type: "text", id: "id", text: {}, attributes: { key: "value" } }, + { type: "text", id: "id", text: {}, attributes: { key: "value" } }, + { type: "image", id: "id", image: {}, attributes: { key: "value" } }, + { type: "text-input", id: "id", placeholder: "placeholder", attributes: { key: "value" } }, + { type: "select", id: "id", choices: [{ value: "value", text: "text" }], attributes: { key: "value" } }, { + type: "submit-button", id: "id", value: "value", waitingText: "waitingText", attributes: { key: "value" }, - type: "submit-button", }, { + type: "component-instance", id: "id", componentId: "componentId", propertyOverrides: [{ propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0" }], - type: "component-instance", }, ], pagination: { limit: 7, offset: 0, total: 7 }, @@ -223,7 +327,112 @@ describe("Components", () => { }); }); - test("update-content", async () => { + test("get-content (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/dom") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getContent("site_id", "component_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-content (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/dom") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getContent("site_id", "component_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-content (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/dom") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getContent("site_id", "component_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-content (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/dom") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getContent("site_id", "component_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-content (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/dom") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getContent("site_id", "component_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-content (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -331,7 +540,235 @@ describe("Components", () => { }); }); - test("get-properties", async () => { + test("update-content (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateContent("site_id", "component_id", { + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-content (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateContent("site_id", "component_id", { + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-content (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateContent("site_id", "component_id", { + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update-content (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateContent("site_id", "component_id", { + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-content (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateContent("site_id", "component_id", { + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-content (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateContent("site_id", "component_id", { + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-properties (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -402,7 +839,112 @@ describe("Components", () => { }); }); - test("update-properties", async () => { + test("get-properties (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/properties") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getProperties("site_id", "component_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-properties (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/properties") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getProperties("site_id", "component_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-properties (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/properties") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getProperties("site_id", "component_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-properties (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/properties") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getProperties("site_id", "component_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-properties (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/components/component_id/properties") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.getProperties("site_id", "component_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-properties (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -449,4 +991,194 @@ describe("Components", () => { errors: ["errors"], }); }); + + test("update-properties (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + properties: [ + { propertyId: "propertyId", text: "text" }, + { propertyId: "propertyId", text: "text" }, + ], + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/properties") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateProperties("site_id", "component_id", { + properties: [ + { + propertyId: "propertyId", + text: "text", + }, + { + propertyId: "propertyId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-properties (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + properties: [ + { propertyId: "propertyId", text: "text" }, + { propertyId: "propertyId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/properties") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateProperties("site_id", "component_id", { + properties: [ + { + propertyId: "propertyId", + text: "text", + }, + { + propertyId: "propertyId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-properties (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + properties: [ + { propertyId: "propertyId", text: "text" }, + { propertyId: "propertyId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/properties") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateProperties("site_id", "component_id", { + properties: [ + { + propertyId: "propertyId", + text: "text", + }, + { + propertyId: "propertyId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-properties (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + properties: [ + { propertyId: "propertyId", text: "text" }, + { propertyId: "propertyId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/properties") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateProperties("site_id", "component_id", { + properties: [ + { + propertyId: "propertyId", + text: "text", + }, + { + propertyId: "propertyId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-properties (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + properties: [ + { propertyId: "propertyId", text: "text" }, + { propertyId: "propertyId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/components/component_id/properties") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.updateProperties("site_id", "component_id", { + properties: [ + { + propertyId: "propertyId", + text: "text", + }, + { + propertyId: "propertyId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/ecommerce.test.ts b/tests/wire/ecommerce.test.ts index 0b004ea8..1f7b69ee 100644 --- a/tests/wire/ecommerce.test.ts +++ b/tests/wire/ecommerce.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Ecommerce", () => { - test("get-settings", async () => { + test("get-settings (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -33,4 +32,151 @@ describe("Ecommerce", () => { defaultCurrency: "USD", }); }); + + test("get-settings (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/ecommerce/settings") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getSettings("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-settings (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/ecommerce/settings") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getSettings("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-settings (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/ecommerce/settings") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getSettings("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get-settings (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/ecommerce/settings") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getSettings("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-settings (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/ecommerce/settings") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getSettings("site_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("get-settings (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/ecommerce/settings") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getSettings("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-settings (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/ecommerce/settings") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getSettings("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/forms.test.ts b/tests/wire/forms.test.ts index 2b832eed..486413ec 100644 --- a/tests/wire/forms.test.ts +++ b/tests/wire/forms.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Forms", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -137,7 +136,154 @@ describe("Forms", () => { }); }); - test("get", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/forms") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/forms") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/forms") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.list("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/forms") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/forms") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.list("site_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("list (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/forms") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/forms") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -219,7 +365,97 @@ describe("Forms", () => { }); }); - test("list-submissions", async () => { + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.forms.get("form_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.forms.get("form_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.forms.get("form_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.forms.get("form_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.forms.get("form_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.forms.get("form_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("list-submissions (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -292,7 +528,133 @@ describe("Forms", () => { }); }); - test("get-submission", async () => { + test("list-submissions (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/forms/form_id/submissions") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.listSubmissions("form_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-submissions (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/forms/form_id/submissions") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.listSubmissions("form_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-submissions (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/forms/form_id/submissions") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.listSubmissions("form_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list-submissions (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/forms/form_id/submissions") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.listSubmissions("form_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-submissions (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/forms/form_id/submissions") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.listSubmissions("form_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-submissions (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/forms/form_id/submissions") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.listSubmissions("form_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-submission (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -329,50 +691,323 @@ describe("Forms", () => { }); }); - test("delete-submission", async () => { + test("get-submission (2)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); + const rawResponseBody = { key: "value" }; server .mockEndpoint() - .delete("/form_submissions/580e63e98c9a982ac9b8b741") + .get("/form_submissions/form_submission_id") .respondWith() - .statusCode(200) + .statusCode(400) + .jsonBody(rawResponseBody) .build(); - const response = await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741"); - expect(response).toEqual(undefined); + await expect(async () => { + return await client.forms.getSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.BadRequestError); }); - test("update-submission", async () => { + test("get-submission (3)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = {}; - const rawResponseBody = { - id: "6321ca84df3949bfc6752327", - displayName: "Sample Form", - siteId: "62749158efef318abc8d5a0f", - workspaceId: "62749158efef318abc8d5a0f", - dateSubmitted: "2022-09-14T12:35:16Z", - formResponse: { "First Name": "Arthur", "Last Name": "Dent" }, - }; + + const rawResponseBody = {}; server .mockEndpoint() - .patch("/form_submissions/580e63e98c9a982ac9b8b741") - .jsonBody(rawRequestBody) + .get("/form_submissions/form_submission_id") .respondWith() - .statusCode(200) + .statusCode(401) .jsonBody(rawResponseBody) .build(); - const response = await client.forms.updateSubmission("580e63e98c9a982ac9b8b741"); - expect(response).toEqual({ + await expect(async () => { + return await client.forms.getSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-submission (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/form_submissions/form_submission_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.getSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get-submission (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/form_submissions/form_submission_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.getSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-submission (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/form_submissions/form_submission_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.getSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-submission (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/form_submissions/form_submission_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.getSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete-submission (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/form_submissions/580e63e98c9a982ac9b8b741") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741"); + expect(response).toEqual(undefined); + }); + + test("delete-submission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/form_submissions/form_submission_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.deleteSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete-submission (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/form_submissions/form_submission_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.deleteSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete-submission (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/form_submissions/form_submission_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.deleteSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("delete-submission (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/form_submissions/form_submission_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.deleteSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete-submission (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/form_submissions/form_submission_id") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.deleteSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("delete-submission (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/form_submissions/form_submission_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.deleteSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete-submission (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/form_submissions/form_submission_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.deleteSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-submission (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { + id: "6321ca84df3949bfc6752327", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: "2022-09-14T12:35:16Z", + formResponse: { "First Name": "Arthur", "Last Name": "Dent" }, + }; + server + .mockEndpoint() + .patch("/form_submissions/580e63e98c9a982ac9b8b741") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.forms.updateSubmission("580e63e98c9a982ac9b8b741"); + expect(response).toEqual({ id: "6321ca84df3949bfc6752327", displayName: "Sample Form", siteId: "62749158efef318abc8d5a0f", @@ -384,4 +1019,158 @@ describe("Forms", () => { }, }); }); + + test("update-submission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.updateSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-submission (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.updateSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-submission (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.updateSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update-submission (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.updateSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-submission (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.updateSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update-submission (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.updateSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-submission (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.forms.updateSubmission("form_submission_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/inventory.test.ts b/tests/wire/inventory.test.ts index c64b448f..e7ad002f 100644 --- a/tests/wire/inventory.test.ts +++ b/tests/wire/inventory.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Inventory", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -30,7 +29,154 @@ describe("Inventory", () => { }); }); - test("update", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/collections/sku_collection_id/items/sku_id/inventory") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.list("sku_collection_id", "sku_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/sku_collection_id/items/sku_id/inventory") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.list("sku_collection_id", "sku_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/collections/sku_collection_id/items/sku_id/inventory") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.list("sku_collection_id", "sku_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/sku_collection_id/items/sku_id/inventory") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.list("sku_collection_id", "sku_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/collections/sku_collection_id/items/sku_id/inventory") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.list("sku_collection_id", "sku_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("list (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/sku_collection_id/items/sku_id/inventory") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.list("sku_collection_id", "sku_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/collections/sku_collection_id/items/sku_id/inventory") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.list("sku_collection_id", "sku_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -56,4 +202,172 @@ describe("Inventory", () => { inventoryType: "finite", }); }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { inventoryType: "infinite" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/sku_collection_id/items/sku_id/inventory") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.update("sku_collection_id", "sku_id", { + inventoryType: "infinite", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { inventoryType: "infinite" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/sku_collection_id/items/sku_id/inventory") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.update("sku_collection_id", "sku_id", { + inventoryType: "infinite", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { inventoryType: "infinite" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/sku_collection_id/items/sku_id/inventory") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.update("sku_collection_id", "sku_id", { + inventoryType: "infinite", + }); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { inventoryType: "infinite" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/sku_collection_id/items/sku_id/inventory") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.update("sku_collection_id", "sku_id", { + inventoryType: "infinite", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { inventoryType: "infinite" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/collections/sku_collection_id/items/sku_id/inventory") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.update("sku_collection_id", "sku_id", { + inventoryType: "infinite", + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { inventoryType: "infinite" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/sku_collection_id/items/sku_id/inventory") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.update("sku_collection_id", "sku_id", { + inventoryType: "infinite", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { inventoryType: "infinite" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/collections/sku_collection_id/items/sku_id/inventory") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inventory.update("sku_collection_id", "sku_id", { + inventoryType: "infinite", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/orders.test.ts b/tests/wire/orders.test.ts index 419d2e51..7046b185 100644 --- a/tests/wire/orders.test.ts +++ b/tests/wire/orders.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Orders", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -768,7 +767,154 @@ describe("Orders", () => { }); }); - test("get", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/orders") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/orders") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/orders") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.list("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/orders") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/orders") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.list("site_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("list (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/orders") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/orders") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1177,7 +1323,154 @@ describe("Orders", () => { }); }); - test("update", async () => { + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/orders/order_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.get("site_id", "order_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/orders/order_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.get("site_id", "order_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/orders/order_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.get("site_id", "order_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/orders/order_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.get("site_id", "order_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/orders/order_id") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.get("site_id", "order_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("get (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/orders/order_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.get("site_id", "order_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/orders/order_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.get("site_id", "order_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1587,7 +1880,161 @@ describe("Orders", () => { }); }); - test("update-fulfill", async () => { + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/orders/order_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.update("site_id", "order_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/orders/order_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.update("site_id", "order_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/orders/order_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.update("site_id", "order_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/orders/order_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.update("site_id", "order_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/orders/order_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.update("site_id", "order_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/orders/order_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.update("site_id", "order_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/orders/order_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.update("site_id", "order_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-fulfill (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1997,7 +2444,161 @@ describe("Orders", () => { }); }); - test("update-unfulfill", async () => { + test("update-fulfill (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/fulfill") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateFulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-fulfill (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/fulfill") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateFulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-fulfill (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/fulfill") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateFulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update-fulfill (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/fulfill") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateFulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-fulfill (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/fulfill") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateFulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update-fulfill (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/fulfill") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateFulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-fulfill (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/fulfill") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateFulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-unfulfill (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -2406,7 +3007,154 @@ describe("Orders", () => { }); }); - test("refund", async () => { + test("update-unfulfill (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/unfulfill") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateUnfulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-unfulfill (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/unfulfill") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateUnfulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-unfulfill (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/unfulfill") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateUnfulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update-unfulfill (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/unfulfill") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateUnfulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-unfulfill (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/unfulfill") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateUnfulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update-unfulfill (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/unfulfill") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateUnfulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-unfulfill (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/unfulfill") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.updateUnfulfill("site_id", "order_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("refund (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -2815,4 +3563,158 @@ describe("Orders", () => { ], }); }); + + test("refund (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/refund") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.refund("site_id", "order_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("refund (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/refund") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.refund("site_id", "order_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("refund (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/refund") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.refund("site_id", "order_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("refund (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/refund") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.refund("site_id", "order_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("refund (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/refund") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.refund("site_id", "order_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("refund (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/refund") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.refund("site_id", "order_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("refund (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/orders/order_id/refund") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orders.refund("site_id", "order_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/pages.test.ts b/tests/wire/pages.test.ts index 17499f50..2476ae8a 100644 --- a/tests/wire/pages.test.ts +++ b/tests/wire/pages.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Pages", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -158,7 +157,112 @@ describe("Pages", () => { }); }); - test("get-metadata", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/pages") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/pages") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/pages") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/pages") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/pages") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-metadata (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -234,7 +338,82 @@ describe("Pages", () => { }); }); - test("update-page-settings", async () => { + test("get-metadata (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getMetadata("page_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-metadata (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getMetadata("page_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-metadata (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getMetadata("page_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-metadata (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getMetadata("page_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-metadata (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getMetadata("page_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-page-settings (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -338,7 +517,117 @@ describe("Pages", () => { }); }); - test("get-content", async () => { + test("update-page-settings (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/pages/page_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updatePageSettings("page_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-page-settings (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/pages/page_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updatePageSettings("page_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-page-settings (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/pages/page_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updatePageSettings("page_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-page-settings (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/pages/page_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updatePageSettings("page_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-page-settings (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/pages/page_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updatePageSettings("page_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-content (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -349,17 +638,17 @@ describe("Pages", () => { pageId: "658205daa3e8206a523b5ad4", branchId: "68026fa68ef6dc744c75b833", nodes: [ - { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, - { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, - { id: "id", image: {}, attributes: { key: "value" }, type: "image" }, - { id: "id", choices: [{ value: "value", text: "text" }], attributes: { key: "value" }, type: "select" }, - { id: "id", placeholder: "placeholder", attributes: { key: "value" }, type: "text-input" }, - { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, + { type: "text", id: "id", text: {}, attributes: { key: "value" } }, + { type: "text", id: "id", text: {}, attributes: { key: "value" } }, + { type: "image", id: "id", image: {}, attributes: { key: "value" } }, + { type: "select", id: "id", choices: [{ value: "value", text: "text" }], attributes: { key: "value" } }, + { type: "text-input", id: "id", placeholder: "placeholder", attributes: { key: "value" } }, + { type: "text", id: "id", text: {}, attributes: { key: "value" } }, { + type: "component-instance", id: "id", componentId: "componentId", propertyOverrides: [{ propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0" }], - type: "component-instance", }, ], pagination: { limit: 4, offset: 0, total: 4 }, @@ -455,7 +744,97 @@ describe("Pages", () => { }); }); - test("update-static-content", async () => { + test("get-content (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getContent("page_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-content (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getContent("page_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-content (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getContent("page_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get-content (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getContent("page_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-content (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getContent("page_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-content (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.pages.getContent("page_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-static-content (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -557,4 +936,238 @@ describe("Pages", () => { errors: ["errors"], }); }); + + test("update-static-content (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/pages/page_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updateStaticContent("page_id", { + localeId: "localeId", + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-static-content (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/pages/page_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updateStaticContent("page_id", { + localeId: "localeId", + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-static-content (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/pages/page_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updateStaticContent("page_id", { + localeId: "localeId", + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update-static-content (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/pages/page_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updateStaticContent("page_id", { + localeId: "localeId", + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-static-content (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/pages/page_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updateStaticContent("page_id", { + localeId: "localeId", + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-static-content (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + nodes: [ + { nodeId: "nodeId", text: "text" }, + { nodeId: "nodeId", text: "text" }, + ], + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/pages/page_id/dom") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.updateStaticContent("page_id", { + localeId: "localeId", + nodes: [ + { + nodeId: "nodeId", + text: "text", + }, + { + nodeId: "nodeId", + text: "text", + }, + ], + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/pages/scripts.test.ts b/tests/wire/pages/scripts.test.ts index 0ec29068..d0c00351 100644 --- a/tests/wire/pages/scripts.test.ts +++ b/tests/wire/pages/scripts.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Scripts", () => { - test("get-custom-code", async () => { + test("get-custom-code (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -43,7 +42,112 @@ describe("Scripts", () => { }); }); - test("upsert-custom-code", async () => { + test("get-custom-code (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/pages/page_id/custom_code") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.getCustomCode("page_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-custom-code (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/pages/page_id/custom_code") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.getCustomCode("page_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-custom-code (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/pages/page_id/custom_code") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.getCustomCode("page_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-custom-code (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/pages/page_id/custom_code") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.getCustomCode("page_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-custom-code (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/pages/page_id/custom_code") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.getCustomCode("page_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("upsert-custom-code (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -123,7 +227,139 @@ describe("Scripts", () => { }); }); - test("delete-custom-code", async () => { + test("upsert-custom-code (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/pages/page_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.upsertCustomCode("page_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("upsert-custom-code (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/pages/page_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.upsertCustomCode("page_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("upsert-custom-code (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/pages/page_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.upsertCustomCode("page_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("upsert-custom-code (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/pages/page_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.upsertCustomCode("page_id", {}); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("upsert-custom-code (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/pages/page_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.upsertCustomCode("page_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("upsert-custom-code (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/pages/page_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.upsertCustomCode("page_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete-custom-code (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -140,4 +376,109 @@ describe("Scripts", () => { const response = await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552"); expect(response).toEqual(undefined); }); + + test("delete-custom-code (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/pages/page_id/custom_code") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.deleteCustomCode("page_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete-custom-code (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/pages/page_id/custom_code") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.deleteCustomCode("page_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete-custom-code (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/pages/page_id/custom_code") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.deleteCustomCode("page_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete-custom-code (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/pages/page_id/custom_code") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.deleteCustomCode("page_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete-custom-code (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/pages/page_id/custom_code") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.pages.scripts.deleteCustomCode("page_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/products.test.ts b/tests/wire/products.test.ts index a2296531..67d2079f 100644 --- a/tests/wire/products.test.ts +++ b/tests/wire/products.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Products", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -156,7 +155,154 @@ describe("Products", () => { }); }); - test("create", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/products") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/products") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/products") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.list("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/products") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/products") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.list("site_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("list (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/products") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/products") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -402,7 +548,182 @@ describe("Products", () => { }); }); - test("get", async () => { + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { product: {}, sku: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.create("site_id", { + product: {}, + sku: {}, + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { product: {}, sku: {} }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.create("site_id", { + product: {}, + sku: {}, + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { product: {}, sku: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.create("site_id", { + product: {}, + sku: {}, + }); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { product: {}, sku: {} }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.create("site_id", { + product: {}, + sku: {}, + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { product: {}, sku: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.create("site_id", { + product: {}, + sku: {}, + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("create (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { product: {}, sku: {} }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.create("site_id", { + product: {}, + sku: {}, + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { product: {}, sku: {} }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.create("site_id", { + product: {}, + sku: {}, + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -543,84 +864,385 @@ describe("Products", () => { }); }); - test("update", async () => { + test("get (2)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = {}; - const rawResponseBody = { - id: "660eb7a486d1d6e0412292d7", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2024-04-04T14:24:19Z", - lastUpdated: "2024-04-04T14:30:19Z", - createdOn: "2024-04-04T14:22:28Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "T-Shirt", - slug: "t-shirt", - description: "A plain cotton t-shirt.", - shippable: true, - "sku-properties": [ - { - id: "Color", - name: "Color", - enum: [{ id: "royal-blue", name: "Royal Blue", slug: "royal-blue" }], - }, - ], - category: ["category"], - "tax-category": "standard-taxable", - "default-sku": "default-sku", - "ec-product-type": "ff42fee0113744f693a764e3431a9cc2", - }, - }; + + const rawResponseBody = { key: "value" }; server .mockEndpoint() - .patch("/sites/580e63e98c9a982ac9b8b741/products/580e63fc8c9a982ac9b8b745") - .jsonBody(rawRequestBody) + .get("/sites/site_id/products/product_id") .respondWith() - .statusCode(200) + .statusCode(400) .jsonBody(rawResponseBody) .build(); - const response = await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"); - expect(response).toEqual({ - id: "660eb7a486d1d6e0412292d7", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: new Date("2024-04-04T14:24:19.000Z"), - lastUpdated: new Date("2024-04-04T14:30:19.000Z"), - createdOn: new Date("2024-04-04T14:22:28.000Z"), - isArchived: false, - isDraft: false, - fieldData: { - name: "T-Shirt", - slug: "t-shirt", - description: "A plain cotton t-shirt.", - shippable: true, - skuProperties: [ - { - id: "Color", - name: "Color", - enum: [ - { - id: "royal-blue", - name: "Royal Blue", - slug: "royal-blue", - }, - ], - }, - ], - category: ["category"], - taxCategory: "standard-taxable", + await expect(async () => { + return await client.products.get("site_id", "product_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/products/product_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.get("site_id", "product_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/products/product_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.get("site_id", "product_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/products/product_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.get("site_id", "product_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/products/product_id") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.get("site_id", "product_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("get (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/products/product_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.get("site_id", "product_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/products/product_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.get("site_id", "product_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update (1)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { + id: "660eb7a486d1d6e0412292d7", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2024-04-04T14:24:19Z", + lastUpdated: "2024-04-04T14:30:19Z", + createdOn: "2024-04-04T14:22:28Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "T-Shirt", + slug: "t-shirt", + description: "A plain cotton t-shirt.", + shippable: true, + "sku-properties": [ + { + id: "Color", + name: "Color", + enum: [{ id: "royal-blue", name: "Royal Blue", slug: "royal-blue" }], + }, + ], + category: ["category"], + "tax-category": "standard-taxable", + "default-sku": "default-sku", + "ec-product-type": "ff42fee0113744f693a764e3431a9cc2", + }, + }; + server + .mockEndpoint() + .patch("/sites/580e63e98c9a982ac9b8b741/products/580e63fc8c9a982ac9b8b745") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"); + expect(response).toEqual({ + id: "660eb7a486d1d6e0412292d7", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: new Date("2024-04-04T14:24:19.000Z"), + lastUpdated: new Date("2024-04-04T14:30:19.000Z"), + createdOn: new Date("2024-04-04T14:22:28.000Z"), + isArchived: false, + isDraft: false, + fieldData: { + name: "T-Shirt", + slug: "t-shirt", + description: "A plain cotton t-shirt.", + shippable: true, + skuProperties: [ + { + id: "Color", + name: "Color", + enum: [ + { + id: "royal-blue", + name: "Royal Blue", + slug: "royal-blue", + }, + ], + }, + ], + category: ["category"], + taxCategory: "standard-taxable", defaultSku: "default-sku", ecProductType: "ff42fee0113744f693a764e3431a9cc2", }, }); }); - test("create-sku", async () => { + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.update("site_id", "product_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.update("site_id", "product_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.update("site_id", "product_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.update("site_id", "product_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.update("site_id", "product_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.update("site_id", "product_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.update("site_id", "product_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create-sku (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -738,7 +1360,175 @@ describe("Products", () => { }); }); - test("update-sku", async () => { + test("create-sku (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { skus: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/products/product_id/skus") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.createSku("site_id", "product_id", { + skus: [{}, {}], + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create-sku (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { skus: [{}, {}] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/products/product_id/skus") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.createSku("site_id", "product_id", { + skus: [{}, {}], + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create-sku (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { skus: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/products/product_id/skus") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.createSku("site_id", "product_id", { + skus: [{}, {}], + }); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("create-sku (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { skus: [{}, {}] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/products/product_id/skus") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.createSku("site_id", "product_id", { + skus: [{}, {}], + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create-sku (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { skus: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/products/product_id/skus") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.createSku("site_id", "product_id", { + skus: [{}, {}], + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("create-sku (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { skus: [{}, {}] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/products/product_id/skus") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.createSku("site_id", "product_id", { + skus: [{}, {}], + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create-sku (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { skus: [{}, {}] }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/products/product_id/skus") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.createSku("site_id", "product_id", { + skus: [{}, {}], + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-sku (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -862,4 +1652,172 @@ describe("Products", () => { }, }); }); + + test("update-sku (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sku: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id/skus/sku_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.updateSku("site_id", "product_id", "sku_id", { + sku: {}, + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-sku (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sku: {} }; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id/skus/sku_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.updateSku("site_id", "product_id", "sku_id", { + sku: {}, + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-sku (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sku: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id/skus/sku_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.updateSku("site_id", "product_id", "sku_id", { + sku: {}, + }); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update-sku (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sku: {} }; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id/skus/sku_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.updateSku("site_id", "product_id", "sku_id", { + sku: {}, + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-sku (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sku: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id/skus/sku_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.updateSku("site_id", "product_id", "sku_id", { + sku: {}, + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update-sku (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sku: {} }; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id/skus/sku_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.updateSku("site_id", "product_id", "sku_id", { + sku: {}, + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-sku (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sku: {} }; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/products/product_id/skus/sku_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.products.updateSku("site_id", "product_id", "sku_id", { + sku: {}, + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/scripts.test.ts b/tests/wire/scripts.test.ts index 3404b169..aafb7191 100644 --- a/tests/wire/scripts.test.ts +++ b/tests/wire/scripts.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Scripts", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -98,7 +97,112 @@ describe("Scripts", () => { }); }); - test("register-hosted", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/registered_scripts") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/registered_scripts") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/registered_scripts") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/registered_scripts") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/registered_scripts") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("register-hosted (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -147,7 +251,167 @@ describe("Scripts", () => { }); }); - test("register-inline", async () => { + test("register-hosted (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/hosted") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerHosted("site_id", { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("register-hosted (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/hosted") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerHosted("site_id", { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("register-hosted (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/hosted") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerHosted("site_id", { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("register-hosted (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/hosted") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerHosted("site_id", { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("register-hosted (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/hosted") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerHosted("site_id", { + hostedLocation: "hostedLocation", + integrityHash: "integrityHash", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("register-inline (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -191,4 +455,134 @@ describe("Scripts", () => { version: "0.0.1", }); }); + + test("register-inline (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/inline") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerInline("site_id", { + sourceCode: "sourceCode", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("register-inline (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/inline") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerInline("site_id", { + sourceCode: "sourceCode", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("register-inline (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/inline") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerInline("site_id", { + sourceCode: "sourceCode", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("register-inline (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/inline") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerInline("site_id", { + sourceCode: "sourceCode", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("register-inline (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/registered_scripts/inline") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.scripts.registerInline("site_id", { + sourceCode: "sourceCode", + version: "version", + displayName: "displayName", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/sites.test.ts b/tests/wire/sites.test.ts index b1d3e6aa..a7939d6e 100644 --- a/tests/wire/sites.test.ts +++ b/tests/wire/sites.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Sites", () => { - test("create", async () => { + test("create (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -111,7 +110,151 @@ describe("Sites", () => { }); }); - test("list", async () => { + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/workspaces/workspace_id/sites") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.create("workspace_id", { + name: "name", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/workspaces/workspace_id/sites") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.create("workspace_id", { + name: "name", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/workspaces/workspace_id/sites") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.create("workspace_id", { + name: "name", + }); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/workspaces/workspace_id/sites") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.create("workspace_id", { + name: "name", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/workspaces/workspace_id/sites") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.create("workspace_id", { + name: "name", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/workspaces/workspace_id/sites") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.create("workspace_id", { + name: "name", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -403,7 +546,52 @@ describe("Sites", () => { }); }); - test("get", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/sites").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.list(); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/sites").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.list(); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/sites").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.list(); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -517,7 +705,82 @@ describe("Sites", () => { }); }); - test("delete", async () => { + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.get("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.get("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.get("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.get("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.get("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -530,7 +793,97 @@ describe("Sites", () => { expect(response).toEqual(undefined); }); - test("update", async () => { + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.delete("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.delete("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.delete("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.delete("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.delete("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.sites.delete("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -645,7 +998,139 @@ describe("Sites", () => { }); }); - test("get-custom-domain", async () => { + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.update("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.update("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.update("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.update("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.update("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.update("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-custom-domain (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -687,7 +1172,112 @@ describe("Sites", () => { }); }); - test("publish", async () => { + test("get-custom-domain (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_domains") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.getCustomDomain("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-custom-domain (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/custom_domains") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.getCustomDomain("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get-custom-domain (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_domains") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.getCustomDomain("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-custom-domain (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_domains") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.getCustomDomain("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-custom-domain (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_domains") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.getCustomDomain("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("publish (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -727,4 +1317,114 @@ describe("Sites", () => { publishToWebflowSubdomain: true, }); }); + + test("publish (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/publish") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.publish("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("publish (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/publish") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.publish("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("publish (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/publish") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.publish("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("publish (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/publish") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.publish("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("publish (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/publish") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.publish("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); }); diff --git a/tests/wire/sites/activityLogs.test.ts b/tests/wire/sites/activityLogs.test.ts index 7a521fc1..cb256afc 100644 --- a/tests/wire/sites/activityLogs.test.ts +++ b/tests/wire/sites/activityLogs.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("ActivityLogs", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -71,4 +70,88 @@ describe("ActivityLogs", () => { }, }); }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/activity_logs") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.activityLogs.list("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/activity_logs") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.activityLogs.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/activity_logs") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.activityLogs.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/activity_logs") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.activityLogs.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/sites/comments.test.ts b/tests/wire/sites/comments.test.ts index bdff914d..fbd965dc 100644 --- a/tests/wire/sites/comments.test.ts +++ b/tests/wire/sites/comments.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Comments", () => { - test("list-comment-threads", async () => { + test("list-comment-threads (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -144,7 +143,112 @@ describe("Comments", () => { }); }); - test("get-comment-thread", async () => { + test("list-comment-threads (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/comments") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentThreads("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-comment-threads (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentThreads("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-comment-threads (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentThreads("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-comment-threads (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentThreads("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-comment-threads (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentThreads("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-comment-thread (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -214,7 +318,112 @@ describe("Comments", () => { }); }); - test("list-comment-replies", async () => { + test("get-comment-thread (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-comment-thread (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-comment-thread (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-comment-thread (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-comment-thread (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("list-comment-replies (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -293,4 +502,109 @@ describe("Comments", () => { }, }); }); + + test("list-comment-replies (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id/replies") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-comment-replies (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id/replies") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-comment-replies (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id/replies") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-comment-replies (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id/replies") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-comment-replies (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/comments/comment_thread_id/replies") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/sites/forms.test.ts b/tests/wire/sites/forms.test.ts index c019abc4..f2b6692b 100644 --- a/tests/wire/sites/forms.test.ts +++ b/tests/wire/sites/forms.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Forms", () => { - test("list-submissions-by-site", async () => { + test("list-submissions-by-site (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -80,7 +79,133 @@ describe("Forms", () => { }); }); - test("list-submissions", async () => { + test("list-submissions-by-site (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissionsBySite("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-submissions-by-site (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissionsBySite("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-submissions-by-site (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissionsBySite("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list-submissions-by-site (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissionsBySite("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-submissions-by-site (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissionsBySite("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-submissions-by-site (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissionsBySite("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("list-submissions (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -157,7 +282,133 @@ describe("Forms", () => { }); }); - test("get-submission", async () => { + test("list-submissions (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/forms/form_id/submissions") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissions("site_id", "form_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-submissions (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/forms/form_id/submissions") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissions("site_id", "form_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-submissions (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/forms/form_id/submissions") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissions("site_id", "form_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list-submissions (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/forms/form_id/submissions") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissions("site_id", "form_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-submissions (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/forms/form_id/submissions") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissions("site_id", "form_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-submissions (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/forms/form_id/submissions") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.listSubmissions("site_id", "form_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get-submission (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -194,7 +445,133 @@ describe("Forms", () => { }); }); - test("delete-submission", async () => { + test("get-submission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.getSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-submission (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.getSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-submission (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.getSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get-submission (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.getSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-submission (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.getSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-submission (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.getSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete-submission (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -215,7 +592,154 @@ describe("Forms", () => { expect(response).toEqual(undefined); }); - test("update-submission", async () => { + test("delete-submission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete-submission (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete-submission (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("delete-submission (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete-submission (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("delete-submission (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete-submission (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/form_submissions/form_submission_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update-submission (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -255,4 +779,158 @@ describe("Forms", () => { }, }); }); + + test("update-submission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update-submission (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update-submission (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update-submission (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update-submission (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("update-submission (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update-submission (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/form_submissions/form_submission_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/sites/plans.test.ts b/tests/wire/sites/plans.test.ts index 79b1be3a..33070c61 100644 --- a/tests/wire/sites/plans.test.ts +++ b/tests/wire/sites/plans.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Plans", () => { - test("get-site-plan", async () => { + test("get-site-plan (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -33,4 +32,109 @@ describe("Plans", () => { pricingInfo: "https://webflow.com/pricing", }); }); + + test("get-site-plan (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/plan") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.plans.getSitePlan("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-site-plan (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/plan") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.plans.getSitePlan("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-site-plan (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/plan") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.plans.getSitePlan("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-site-plan (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/plan") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.plans.getSitePlan("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-site-plan (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/plan") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.plans.getSitePlan("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/sites/redirects.test.ts b/tests/wire/sites/redirects.test.ts index c4e19916..20c28be6 100644 --- a/tests/wire/sites/redirects.test.ts +++ b/tests/wire/sites/redirects.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Redirects", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -50,7 +49,112 @@ describe("Redirects", () => { }); }); - test("create", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/redirects") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/redirects") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/redirects") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/redirects") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/redirects") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -79,7 +183,117 @@ describe("Redirects", () => { }); }); - test("delete", async () => { + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/redirects") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.create("site_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/redirects") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.create("site_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/redirects") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.create("site_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/redirects") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.create("site_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/redirects") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.create("site_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -123,7 +337,112 @@ describe("Redirects", () => { }); }); - test("update", async () => { + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/redirects/redirect_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.delete("site_id", "redirect_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/redirects/redirect_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.delete("site_id", "redirect_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/redirects/redirect_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.delete("site_id", "redirect_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/redirects/redirect_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.delete("site_id", "redirect_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/redirects/redirect_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.delete("site_id", "redirect_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -151,4 +470,114 @@ describe("Redirects", () => { toUrl: "/earth", }); }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/redirects/redirect_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.update("site_id", "redirect_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/redirects/redirect_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.update("site_id", "redirect_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/redirects/redirect_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.update("site_id", "redirect_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/redirects/redirect_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.update("site_id", "redirect_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/redirects/redirect_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.redirects.update("site_id", "redirect_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/sites/robotsTxt.test.ts b/tests/wire/sites/robotsTxt.test.ts index 2ad09ab6..ac33bb3c 100644 --- a/tests/wire/sites/robotsTxt.test.ts +++ b/tests/wire/sites/robotsTxt.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("RobotsTxt", () => { - test("get", async () => { + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -44,7 +43,112 @@ describe("RobotsTxt", () => { }); }); - test("put", async () => { + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/robots_txt") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.get("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/robots_txt") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.get("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/robots_txt") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.get("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/robots_txt") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.get("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/robots_txt") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.get("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("put (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -101,7 +205,117 @@ describe("RobotsTxt", () => { }); }); - test("delete", async () => { + test("put (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.put("site_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("put (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.put("site_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("put (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.put("site_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("put (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.put("site_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("put (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.put("site_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -148,7 +362,117 @@ describe("RobotsTxt", () => { }); }); - test("patch", async () => { + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.delete("site_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.delete("site_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.delete("site_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.delete("site_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.delete("site_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("patch (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -204,4 +528,114 @@ describe("RobotsTxt", () => { sitemap: "https://heartofgold.ship/sitemap.xml", }); }); + + test("patch (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.patch("site_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("patch (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.patch("site_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("patch (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.patch("site_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("patch (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.patch("site_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("patch (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/robots_txt") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.robotsTxt.patch("site_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/sites/scripts.test.ts b/tests/wire/sites/scripts.test.ts index 9612b3d5..ea38b8a0 100644 --- a/tests/wire/sites/scripts.test.ts +++ b/tests/wire/sites/scripts.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Scripts", () => { - test("get-custom-code", async () => { + test("get-custom-code (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -59,7 +58,112 @@ describe("Scripts", () => { }); }); - test("upsert-custom-code", async () => { + test("get-custom-code (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/custom_code") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.getCustomCode("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get-custom-code (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_code") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.getCustomCode("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-custom-code (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_code") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.getCustomCode("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-custom-code (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_code") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.getCustomCode("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-custom-code (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_code") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.getCustomCode("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("upsert-custom-code (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -139,7 +243,117 @@ describe("Scripts", () => { }); }); - test("delete-custom-code", async () => { + test("upsert-custom-code (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/sites/site_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.upsertCustomCode("site_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("upsert-custom-code (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.upsertCustomCode("site_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("upsert-custom-code (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.upsertCustomCode("site_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("upsert-custom-code (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.upsertCustomCode("site_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("upsert-custom-code (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/custom_code") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.upsertCustomCode("site_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete-custom-code (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -157,7 +371,112 @@ describe("Scripts", () => { expect(response).toEqual(undefined); }); - test("list-custom-code-blocks", async () => { + test("delete-custom-code (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/custom_code") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.deleteCustomCode("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete-custom-code (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/custom_code") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.deleteCustomCode("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete-custom-code (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/custom_code") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.deleteCustomCode("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete-custom-code (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/custom_code") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.deleteCustomCode("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete-custom-code (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/custom_code") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.deleteCustomCode("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("list-custom-code-blocks (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -238,4 +557,109 @@ describe("Scripts", () => { }, }); }); + + test("list-custom-code-blocks (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/custom_code/blocks") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.listCustomCodeBlocks("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list-custom-code-blocks (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_code/blocks") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.listCustomCodeBlocks("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list-custom-code-blocks (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_code/blocks") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.listCustomCodeBlocks("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list-custom-code-blocks (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_code/blocks") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.listCustomCodeBlocks("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list-custom-code-blocks (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/custom_code/blocks") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.scripts.listCustomCodeBlocks("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/sites/wellKnown.test.ts b/tests/wire/sites/wellKnown.test.ts index 2693fdb1..a89303c2 100644 --- a/tests/wire/sites/wellKnown.test.ts +++ b/tests/wire/sites/wellKnown.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("WellKnown", () => { - test("put", async () => { + test("put (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -36,7 +35,132 @@ describe("WellKnown", () => { expect(response).toEqual(undefined); }); - test("delete", async () => { + test("put (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.put("site_id", { + fileName: "fileName", + fileData: "fileData", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("put (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.put("site_id", { + fileName: "fileName", + fileData: "fileData", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("put (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.put("site_id", { + fileName: "fileName", + fileData: "fileData", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("put (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.put("site_id", { + fileName: "fileName", + fileData: "fileData", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("put (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .put("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.put("site_id", { + fileName: "fileName", + fileData: "fileData", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -55,4 +179,114 @@ describe("WellKnown", () => { const response = await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741"); expect(response).toEqual(undefined); }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.delete("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.delete("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.delete("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.delete("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/well_known") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.sites.wellKnown.delete("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/token.test.ts b/tests/wire/token.test.ts index 6b339053..cd9db18e 100644 --- a/tests/wire/token.test.ts +++ b/tests/wire/token.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Token", () => { - test("authorized-by", async () => { + test("authorized-by (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -36,7 +35,49 @@ describe("Token", () => { }); }); - test("introspect", async () => { + test("authorized-by (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/token/authorized_by") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.token.authorizedBy(); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("authorized-by (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/token/authorized_by") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.token.authorizedBy(); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("introspect (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -89,4 +130,19 @@ describe("Token", () => { }, }); }); + + test("introspect (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server.mockEndpoint().get("/token/introspect").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.token.introspect(); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); }); diff --git a/tests/wire/users.test.ts b/tests/wire/users.test.ts index 935240c5..e1f9c478 100644 --- a/tests/wire/users.test.ts +++ b/tests/wire/users.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Users", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -169,7 +168,133 @@ describe("Users", () => { }); }); - test("get", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/users") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/users") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/users") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.list("site_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/users") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/users") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/users") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -230,7 +355,133 @@ describe("Users", () => { }); }); - test("delete", async () => { + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/users/user_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.get("site_id", "user_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/users/user_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.get("site_id", "user_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/users/user_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.get("site_id", "user_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/users/user_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.get("site_id", "user_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/users/user_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.get("site_id", "user_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/users/user_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.get("site_id", "user_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -248,7 +499,133 @@ describe("Users", () => { expect(response).toEqual(undefined); }); - test("update", async () => { + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/users/user_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.delete("site_id", "user_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/users/user_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.delete("site_id", "user_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/sites/site_id/users/user_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.delete("site_id", "user_id"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/users/user_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.delete("site_id", "user_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/users/user_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.delete("site_id", "user_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/sites/site_id/users/user_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.delete("site_id", "user_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("update (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -333,7 +710,139 @@ describe("Users", () => { }); }); - test("invite", async () => { + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/users/user_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.update("site_id", "user_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/users/user_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.update("site_id", "user_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/sites/site_id/users/user_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.update("site_id", "user_id", {}); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/users/user_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.update("site_id", "user_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/users/user_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.update("site_id", "user_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("update (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .patch("/sites/site_id/users/user_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.update("site_id", "user_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("invite (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -397,4 +906,172 @@ describe("Users", () => { }, }); }); + + test("invite (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.invite("site_id", { + email: "email", + }); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("invite (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.invite("site_id", { + email: "email", + }); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("invite (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.invite("site_id", { + email: "email", + }); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("invite (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.invite("site_id", { + email: "email", + }); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("invite (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.invite("site_id", { + email: "email", + }); + }).rejects.toThrow(Webflow.ConflictError); + }); + + test("invite (7)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.invite("site_id", { + email: "email", + }); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("invite (8)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.users.invite("site_id", { + email: "email", + }); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts index a2bf9815..de28d4c1 100644 --- a/tests/wire/webhooks.test.ts +++ b/tests/wire/webhooks.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool.js"; +import * as Webflow from "../../src/api/index"; import { WebflowClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Webhooks", () => { - test("list", async () => { + test("list (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -104,7 +103,112 @@ describe("Webhooks", () => { }); }); - test("create", async () => { + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/sites/site_id/webhooks") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.list("site_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/webhooks") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.list("site_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/webhooks") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.list("site_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/webhooks") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.list("site_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("list (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/sites/site_id/webhooks") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.list("site_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("create (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -161,7 +265,117 @@ describe("Webhooks", () => { }); }); - test("get", async () => { + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/sites/site_id/webhooks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.create("site_id", {}); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/webhooks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.create("site_id", {}); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/webhooks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.create("site_id", {}); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/webhooks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.create("site_id", {}); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/sites/site_id/webhooks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.create("site_id", {}); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("get (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -201,7 +415,112 @@ describe("Webhooks", () => { }); }); - test("delete", async () => { + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/webhooks/webhook_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.get("webhook_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/webhooks/webhook_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.get("webhook_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/webhooks/webhook_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.get("webhook_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/webhooks/webhook_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.get("webhook_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/webhooks/webhook_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.get("webhook_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); + + test("delete (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -213,4 +532,109 @@ describe("Webhooks", () => { const response = await client.webhooks.delete("580e64008c9a982ac9b8b754"); expect(response).toEqual(undefined); }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/webhooks/webhook_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.delete("webhook_id"); + }).rejects.toThrow(Webflow.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/webhooks/webhook_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.delete("webhook_id"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/webhooks/webhook_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.delete("webhook_id"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/webhooks/webhook_id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.delete("webhook_id"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .delete("/webhooks/webhook_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.delete("webhook_id"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tests/wire/workspaces/auditLogs.test.ts b/tests/wire/workspaces/auditLogs.test.ts index 92b24417..6e579dcc 100644 --- a/tests/wire/workspaces/auditLogs.test.ts +++ b/tests/wire/workspaces/auditLogs.test.ts @@ -1,12 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool.js"; +import * as Webflow from "../../../src/api/index"; import { WebflowClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("AuditLogs", () => { - test("get-workspace-audit_logs", async () => { + test("get-workspace-audit_logs (1)", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -16,25 +15,25 @@ describe("AuditLogs", () => { const rawResponseBody = { items: [ { - eventSubType: "login", eventType: "user_access", timestamp: "2025-04-29T20:30:06Z", actor: { id: "6661ccb359b561c69f29d554", email: "someone@email.com" }, workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, + eventSubType: "login", }, { - eventSubType: "user_added", eventType: "workspace_membership", timestamp: "2025-04-30T20:30:06Z", actor: { id: "60492e55bbddce079561cd7a", email: "someone@webflow.com" }, workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, + eventSubType: "user_added", }, { - eventSubType: "user_added", eventType: "site_membership", timestamp: "2025-04-30T00:33:31Z", actor: { id: "671fe00d185fc8c1ad409d37", email: "someone@webflow.com" }, workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, + eventSubType: "user_added", }, ], pagination: { limit: 10, offset: 0, total: 3 }, @@ -77,4 +76,109 @@ describe("AuditLogs", () => { }, }); }); + + test("get-workspace-audit_logs (2)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/workspaces/workspace_id_or_slug/audit_logs") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); + }).rejects.toThrow(Webflow.UnauthorizedError); + }); + + test("get-workspace-audit_logs (3)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/workspaces/workspace_id_or_slug/audit_logs") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); + }).rejects.toThrow(Webflow.ForbiddenError); + }); + + test("get-workspace-audit_logs (4)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/workspaces/workspace_id_or_slug/audit_logs") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); + }).rejects.toThrow(Webflow.NotFoundError); + }); + + test("get-workspace-audit_logs (5)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/workspaces/workspace_id_or_slug/audit_logs") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); + }).rejects.toThrow(Webflow.TooManyRequestsError); + }); + + test("get-workspace-audit_logs (6)", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/workspaces/workspace_id_or_slug/audit_logs") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); + }).rejects.toThrow(Webflow.InternalServerError); + }); }); diff --git a/tsconfig.json b/tsconfig.json index 1ec87dd7..0140f411 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,8 @@ "outDir": "dist", "rootDir": "src", "baseUrl": "src", + "isolatedModules": true, + "isolatedDeclarations": true, "module": "CommonJS" }, "include": ["src"], diff --git a/yarn.lock b/yarn.lock index db78e49b..fd567d4b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -270,6 +270,60 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@biomejs/biome@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.3.1.tgz#d1a9284f52986324f288cdaf450331a0f3fb1da7" + integrity sha512-A29evf1R72V5bo4o2EPxYMm5mtyGvzp2g+biZvRFx29nWebGyyeOSsDWGx3tuNNMFRepGwxmA9ZQ15mzfabK2w== + optionalDependencies: + "@biomejs/cli-darwin-arm64" "2.3.1" + "@biomejs/cli-darwin-x64" "2.3.1" + "@biomejs/cli-linux-arm64" "2.3.1" + "@biomejs/cli-linux-arm64-musl" "2.3.1" + "@biomejs/cli-linux-x64" "2.3.1" + "@biomejs/cli-linux-x64-musl" "2.3.1" + "@biomejs/cli-win32-arm64" "2.3.1" + "@biomejs/cli-win32-x64" "2.3.1" + +"@biomejs/cli-darwin-arm64@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.3.1.tgz#607835f8ef043e1a80f9ad2a232c9e860941ab60" + integrity sha512-ombSf3MnTUueiYGN1SeI9tBCsDUhpWzOwS63Dove42osNh0PfE1cUtHFx6eZ1+MYCCLwXzlFlYFdrJ+U7h6LcA== + +"@biomejs/cli-darwin-x64@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.3.1.tgz#654fe4aaa8ea5d5bde5457db4961ad5d214713ac" + integrity sha512-pcOfwyoQkrkbGvXxRvZNe5qgD797IowpJPovPX5biPk2FwMEV+INZqfCaz4G5bVq9hYnjwhRMamg11U4QsRXrQ== + +"@biomejs/cli-linux-arm64-musl@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.3.1.tgz#5fe502082a575c31ef808cf080cbcd4485964167" + integrity sha512-+DZYv8l7FlUtTrWs1Tdt1KcNCAmRO87PyOnxKGunbWm5HKg1oZBSbIIPkjrCtDZaeqSG1DiGx7qF+CPsquQRcg== + +"@biomejs/cli-linux-arm64@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.3.1.tgz#81c02547905d379dbb312e6ff24b04908c2e320f" + integrity sha512-td5O8pFIgLs8H1sAZsD6v+5quODihyEw4nv2R8z7swUfIK1FKk+15e4eiYVLcAE4jUqngvh4j3JCNgg0Y4o4IQ== + +"@biomejs/cli-linux-x64-musl@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.3.1.tgz#c7c00beb5eda1ad25185544897e66eeec6be3b0b" + integrity sha512-Y3Ob4nqgv38Mh+6EGHltuN+Cq8aj/gyMTJYzkFZV2AEj+9XzoXB9VNljz9pjfFNHUxvLEV4b55VWyxozQTBaUQ== + +"@biomejs/cli-linux-x64@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.3.1.tgz#7481d2e7be98d4de574df233766a5bdda037c897" + integrity sha512-PYWgEO7up7XYwSAArOpzsVCiqxBCXy53gsReAb1kKYIyXaoAlhBaBMvxR/k2Rm9aTuZ662locXUmPk/Aj+Xu+Q== + +"@biomejs/cli-win32-arm64@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.3.1.tgz#dac8c7c7223e97f86cd0eed7aa95584984761481" + integrity sha512-RHIG/zgo+69idUqVvV3n8+j58dKYABRpMyDmfWu2TITC+jwGPiEaT0Q3RKD+kQHiS80mpBrST0iUGeEXT0bU9A== + +"@biomejs/cli-win32-x64@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.3.1.tgz#f8818ab2c1e3a6e2ed8a656935173e5ce4c720be" + integrity sha512-izl30JJ5Dp10mi90Eko47zhxE6pYyWPcnX1NQxKpL/yMhXxf95oLTzfpu4q+MDBh/gemNqyJEwjBpe0MT5iWPA== + "@bundled-es-modules/cookie@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz#b41376af6a06b3e32a15241d927b840a9b4de507" @@ -284,42 +338,42 @@ dependencies: statuses "^2.0.1" -"@inquirer/ansi@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@inquirer/ansi/-/ansi-1.0.2.tgz#674a4c4d81ad460695cb2a1fc69d78cd187f337e" - integrity sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ== +"@inquirer/ansi@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@inquirer/ansi/-/ansi-1.0.1.tgz#994f7dd16a00c547a7b110e04bf4f4eca1857929" + integrity sha512-yqq0aJW/5XPhi5xOAL1xRCpe1eh8UFVgYFpFsjEqmIR8rKLyP+HINvFXwUaxYICflJrVlxnp7lLN6As735kVpw== "@inquirer/confirm@^5.0.0": - version "5.1.21" - resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-5.1.21.tgz#610c4acd7797d94890a6e2dde2c98eb1e891dd12" - integrity sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ== + version "5.1.19" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-5.1.19.tgz#bf28b420898999eb7479ab55623a3fbaf1453ff4" + integrity sha512-wQNz9cfcxrtEnUyG5PndC8g3gZ7lGDBzmWiXZkX8ot3vfZ+/BLjR8EvyGX4YzQLeVqtAlY/YScZpW7CW8qMoDQ== dependencies: - "@inquirer/core" "^10.3.2" - "@inquirer/type" "^3.0.10" + "@inquirer/core" "^10.3.0" + "@inquirer/type" "^3.0.9" -"@inquirer/core@^10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-10.3.2.tgz#535979ff3ff4fe1e7cc4f83e2320504c743b7e20" - integrity sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A== +"@inquirer/core@^10.3.0": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-10.3.0.tgz#342e4fd62cbd33ea62089364274995dbec1f2ffe" + integrity sha512-Uv2aPPPSK5jeCplQmQ9xadnFx2Zhj9b5Dj7bU6ZeCdDNNY11nhYy4btcSdtDguHqCT2h5oNeQTcUNSGGLA7NTA== dependencies: - "@inquirer/ansi" "^1.0.2" - "@inquirer/figures" "^1.0.15" - "@inquirer/type" "^3.0.10" + "@inquirer/ansi" "^1.0.1" + "@inquirer/figures" "^1.0.14" + "@inquirer/type" "^3.0.9" cli-width "^4.1.0" mute-stream "^2.0.0" signal-exit "^4.1.0" wrap-ansi "^6.2.0" - yoctocolors-cjs "^2.1.3" + yoctocolors-cjs "^2.1.2" -"@inquirer/figures@^1.0.15": - version "1.0.15" - resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.15.tgz#dbb49ed80df11df74268023b496ac5d9acd22b3a" - integrity sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g== +"@inquirer/figures@^1.0.14": + version "1.0.14" + resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.14.tgz#12a7bfd344a83ae6cc5d6004b389ed11f6db6be4" + integrity sha512-DbFgdt+9/OZYFM+19dbpXOSeAstPy884FPy1KjDu4anWwymZeOYhMY1mdFri172htv6mvc/uvIAAi7b7tvjJBQ== -"@inquirer/type@^3.0.10": - version "3.0.10" - resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-3.0.10.tgz#11ed564ec78432a200ea2601a212d24af8150d50" - integrity sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA== +"@inquirer/type@^3.0.9": + version "3.0.9" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-3.0.9.tgz#f7f9696e9276e4e1ae9332767afb9199992e31d9" + integrity sha512-QPaNt/nmE2bLGQa9b7wwyRJoLZ7pN6rcyXvzU0YCmivmJyq1BVo94G98tStRWkoD1RgDX5C+dPlhhHzNdu/W/w== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -741,9 +795,9 @@ form-data "^4.0.4" "@types/node@*": - version "25.0.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-25.0.2.tgz#411f9dd6cb2bf5ee46aed7199a9f85ca6b068b4e" - integrity sha512-gWEkeiyYE4vqjON/+Obqcoeffmk0NF15WSBwSs7zwVA2bAbTaE0SJ7P0WNGoJn8uE7fiaV5a7dKYIJriEqOrmA== + version "24.9.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.9.2.tgz#90ded2422dbfcafcf72080f28975adc21366148d" + integrity sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA== dependencies: undici-types "~7.16.0" @@ -754,15 +808,10 @@ dependencies: undici-types "~5.26.4" -"@types/qs@^6.9.17": - version "6.14.0" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.14.0.tgz#d8b60cecf62f2db0fb68e5e006077b9178b85de5" - integrity sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ== - "@types/readable-stream@^4.0.18": - version "4.0.23" - resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.23.tgz#fcd0f7472f45ceb43154f08f0083ccd1c76e53ce" - integrity sha512-wwXrtQvbMHxCbBgjHaMGEmImFTQxxpfMOR/ZoQnXxB1woqkUbdLGFDgauo00Py9IudiaqSeiBiulSV9i6XIPig== + version "4.0.22" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.22.tgz#882fda4f17b6580acb257df3f22ca69c05470b29" + integrity sha512-/FFhJpfCLAPwAcN3mFycNUa77ddnr8jTgF5VmSNetaemWB2cIlfCA9t0YTM3JAT0wOcv8D4tjPo7pkDhK3EJIg== dependencies: "@types/node" "*" @@ -781,20 +830,15 @@ resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== -"@types/url-join@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/url-join/-/url-join-4.0.1.tgz#4989c97f969464647a8586c7252d97b449cdc045" - integrity sha512-wDXw9LEEUHyV+7UWy7U315nrJGJ7p1BzaCxDpEoLr789Dk1WDVMMlf3iBfbG2F8NdWnYyFbtTxUn2ZNbm1Q4LQ== - "@types/yargs-parser@*": version "21.0.3" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^17.0.8": - version "17.0.35" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.35.tgz#07013e46aa4d7d7d50a49e15604c1c5340d4eb24" - integrity sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg== + version "17.0.34" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.34.tgz#1c2f9635b71d5401827373a01ce2e8a7670ea839" + integrity sha512-KExbHVa92aJpw9WDQvzBaGVE2/Pz+pLZQloT2hjL8IqsZnV62rlPOYvNnLmf/L2dyllfVUOVBj64M0z/46eR2A== dependencies: "@types/yargs-parser" "*" @@ -1130,10 +1174,10 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -baseline-browser-mapping@^2.9.0: - version "2.9.7" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.7.tgz#d36ce64f2a2c468f6f743c8db495d319120007db" - integrity sha512-k9xFKplee6KIio3IDbwj+uaCLpqzOwakOgmqzPezM0sFJlFKcg30vk2wOiAJtkTSfx0SSQDSe8q+mWA/fSH5Zg== +baseline-browser-mapping@^2.8.19: + version "2.8.20" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.20.tgz#6766cf270f3668d20b6712b9c54cc911b87da714" + integrity sha512-JMWsdF+O8Orq3EMukbUN1QfbLK9mX2CkUmQBcW2T0s8OmdAUL5LLM/6wFwSrqXzlXB13yhyK9gTKS1rIizOduQ== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: version "4.12.2" @@ -1221,15 +1265,15 @@ browserify-sign@^4.2.3: safe-buffer "^5.2.1" browserslist@^4.24.0, browserslist@^4.26.3: - version "4.28.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" - integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== + version "4.27.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.27.0.tgz#755654744feae978fbb123718b2f139bc0fa6697" + integrity sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw== dependencies: - baseline-browser-mapping "^2.9.0" - caniuse-lite "^1.0.30001759" - electron-to-chromium "^1.5.263" - node-releases "^2.0.27" - update-browserslist-db "^1.2.0" + baseline-browser-mapping "^2.8.19" + caniuse-lite "^1.0.30001751" + electron-to-chromium "^1.5.238" + node-releases "^2.0.26" + update-browserslist-db "^1.1.4" bs-logger@^0.2.6: version "0.2.6" @@ -1281,7 +1325,7 @@ call-bind@^1.0.8: get-intrinsic "^1.2.4" set-function-length "^1.2.2" -call-bound@^1.0.2, call-bound@^1.0.3, call-bound@^1.0.4: +call-bound@^1.0.3, call-bound@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== @@ -1304,10 +1348,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001759: - version "1.0.30001760" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001760.tgz#bdd1960fafedf8d5f04ff16e81460506ff9b798f" - integrity sha512-7AAMPcueWELt1p3mi13HR/LHH0TJLT11cnwDJEs3xA4+CK/PLKeO9Kl1oru24htkyUKtkGCvAx4ohB0Ttry8Dw== +caniuse-lite@^1.0.30001751: + version "1.0.30001751" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001751.tgz#dacd5d9f4baeea841641640139d2b2a4df4226ad" + integrity sha512-A0QJhug0Ly64Ii3eIqHu5X51ebln3k4yTUkY1j8drqpWHVreg/VLijN48cZ1bYPiqOQuqpkIKnzr/Ul8V+p6Cw== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1597,10 +1641,10 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" gopd "^1.2.0" -electron-to-chromium@^1.5.263: - version "1.5.267" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" - integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== +electron-to-chromium@^1.5.238: + version "1.5.241" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.241.tgz#350a2cdcde43829d36af245a27167243e917c6ed" + integrity sha512-ILMvKX/ZV5WIJzzdtuHg8xquk2y0BOGlFOxBVwTpbiXqWIH0hamG45ddU4R3PQ0gYu+xgo0vdHXHli9sHIGb4w== elliptic@^6.5.3, elliptic@^6.6.1: version "6.6.1" @@ -1626,9 +1670,9 @@ emoji-regex@^8.0.0: integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.3: - version "5.18.4" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz#c22d33055f3952035ce6a144ce092447c525f828" - integrity sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q== + version "5.18.3" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz#9b5f4c5c076b8787c78fe540392ce76a88855b44" + integrity sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -1827,9 +1871,9 @@ for-each@^0.3.5: is-callable "^1.2.7" form-data@^4.0.0, form-data@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" - integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== + version "4.0.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" + integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -1867,7 +1911,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: +get-intrinsic@^1.2.4, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== @@ -1929,9 +1973,9 @@ graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== graphql@^16.8.1: - version "16.12.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.12.0.tgz#28cc2462435b1ac3fdc6976d030cef83a0c13ac7" - integrity sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ== + version "16.11.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.11.0.tgz#96d17f66370678027fdf59b2d4c20b4efaa8a633" + integrity sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw== handlebars@^4.7.8: version "4.7.8" @@ -2599,20 +2643,15 @@ jest@^29.7.0: import-local "^3.0.2" jest-cli "^29.7.0" -js-base64@3.7.7: - version "3.7.7" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79" - integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw== - js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.14.2" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0" - integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg== + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -2684,7 +2723,7 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -loader-runner@^4.3.1: +loader-runner@^4.2.0: version "4.3.1" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.1.tgz#6c76ed29b0ccce9af379208299f07f876de737e3" integrity sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q== @@ -2858,10 +2897,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.27: - version "2.0.27" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" - integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== +node-releases@^2.0.26: + version "2.0.26" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.26.tgz#fdfa272f2718a1309489d18aef4ef5ba7f5dfb52" + integrity sha512-S2M9YimhSjBSvYnlr5/+umAnPHE++ODwt5e2Ij6FoX45HA/s4vHdkDx1eax2pAPeAOqu4s9b7ppahsyEFdVqQA== normalize-path@^3.0.0: version "3.0.0" @@ -2876,14 +2915,9 @@ npm-run-path@^4.0.1: path-key "^3.0.0" nwsapi@^2.2.2: - version "2.2.23" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.23.tgz#59712c3a88e6de2bb0b6ccc1070397267019cf6c" - integrity sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ== - -object-inspect@^1.13.3: - version "1.13.4" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" - integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== + version "2.2.22" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.22.tgz#109f9530cda6c156d6a713cdf5939e9f0de98b9d" + integrity sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ== once@^1.3.0: version "1.4.0" @@ -3022,11 +3056,6 @@ possible-typed-array-names@^1.0.0: resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz#93e3582bc0e5426586d9d07b79ee40fc841de4ae" integrity sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg== -prettier@^3.4.2: - version "3.7.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.7.4.tgz#d2f8335d4b1cec47e1c8098645411b0c9dff9c0f" - integrity sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA== - pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" @@ -3088,13 +3117,6 @@ pure-rand@^6.0.0: resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== -qs@^6.13.1: - version "6.14.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" - integrity sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w== - dependencies: - side-channel "^1.1.0" - querystringify@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" @@ -3280,46 +3302,6 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -side-channel-list@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" - integrity sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== - dependencies: - es-errors "^1.3.0" - object-inspect "^1.13.3" - -side-channel-map@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42" - integrity sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== - dependencies: - call-bound "^1.0.2" - es-errors "^1.3.0" - get-intrinsic "^1.2.5" - object-inspect "^1.13.3" - -side-channel-weakmap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea" - integrity sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== - dependencies: - call-bound "^1.0.2" - es-errors "^1.3.0" - get-intrinsic "^1.2.5" - object-inspect "^1.13.3" - side-channel-map "^1.0.1" - -side-channel@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" - integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== - dependencies: - es-errors "^1.3.0" - object-inspect "^1.13.3" - side-channel-list "^1.0.0" - side-channel-map "^1.0.1" - side-channel-weakmap "^1.0.2" - signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -3471,9 +3453,9 @@ tapable@^2.2.0, tapable@^2.3.0: integrity sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg== terser-webpack-plugin@^5.3.11: - version "5.3.16" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz#741e448cc3f93d8026ebe4f7ef9e4afacfd56330" - integrity sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q== + version "5.3.14" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" + integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" @@ -3482,9 +3464,9 @@ terser-webpack-plugin@^5.3.11: terser "^5.31.1" terser@^5.31.1: - version "5.44.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.1.tgz#e391e92175c299b8c284ad6ded609e37303b0a9c" - integrity sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw== + version "5.44.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.0.tgz#ebefb8e5b8579d93111bfdfc39d2cf63879f4a82" + integrity sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3500,17 +3482,17 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -tldts-core@^7.0.19: - version "7.0.19" - resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.19.tgz#9dd8a457a09b4e65c8266c029f1847fa78dead20" - integrity sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A== +tldts-core@^7.0.17: + version "7.0.17" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.17.tgz#dadfee3750dd272ed219d7367beb7cbb2ff29eb8" + integrity sha512-DieYoGrP78PWKsrXr8MZwtQ7GLCUeLxihtjC1jZsW1DnvSMdKPitJSe8OSYDM2u5H6g3kWJZpePqkp43TfLh0g== tldts@^7.0.5: - version "7.0.19" - resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.19.tgz#84cd7a7f04e68ec93b93b106fac038c527b99368" - integrity sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA== + version "7.0.17" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.17.tgz#a6cdc067b9e80ea05f3be471c0ea410688cc78b2" + integrity sha512-Y1KQBgDd/NUc+LfOtKS6mNsC9CCaH+m2P1RoIZy7RAPo3C3/t8X45+zgut31cRZtZ3xKPjfn3TkGTrctC2TQIQ== dependencies: - tldts-core "^7.0.19" + tldts-core "^7.0.17" tmpl@1.0.5: version "1.0.5" @@ -3563,9 +3545,9 @@ tr46@~0.0.3: integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-jest@^29.3.4: - version "29.4.6" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.6.tgz#51cb7c133f227396818b71297ad7409bb77106e9" - integrity sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA== + version "29.4.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.5.tgz#a6b0dc401e521515d5342234be87f1ca96390a6f" + integrity sha512-HO3GyiWn2qvTQA4kTgjDcXiMwYQt68a1Y8+JuLRVpdIzm+UOLSHgl/XqR4c6nzJkq5rOkjc02O2I7P7l/Yof0Q== dependencies: bs-logger "^0.2.6" fast-json-stable-stringify "^2.1.0" @@ -3637,19 +3619,14 @@ universalify@^0.2.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -update-browserslist-db@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.2.tgz#cfb4358afa08b3d5731a2ecd95eebf4ddef8033e" - integrity sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA== +update-browserslist-db@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz#7802aa2ae91477f255b86e0e46dbc787a206ad4a" + integrity sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A== dependencies: escalade "^3.2.0" picocolors "^1.1.1" -url-join@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" - integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== - url-parse@^1.5.3: version "1.5.10" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" @@ -3710,9 +3687,9 @@ webpack-sources@^3.3.3: integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg== webpack@^5.97.1: - version "5.103.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.103.0.tgz#17a7c5a5020d5a3a37c118d002eade5ee2c6f3da" - integrity sha512-HU1JOuV1OavsZ+mfigY0j8d1TgQgbZ6M+J75zDkpEAwYeXjWSqrGJtgnPblJjd/mAyTNQ7ygw0MiKOn6etz8yw== + version "5.102.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.102.1.tgz#1003a3024741a96ba99c37431938bf61aad3d988" + integrity sha512-7h/weGm9d/ywQ6qzJ+Xy+r9n/3qgp/thalBbpOi5i223dPXKi04IBtqPN9nTd+jBc7QKfvDbaBnFipYp4sJAUQ== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" @@ -3731,7 +3708,7 @@ webpack@^5.97.1: glob-to-regexp "^0.4.1" graceful-fs "^4.2.11" json-parse-even-better-errors "^2.3.1" - loader-runner "^4.3.1" + loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" schema-utils "^4.3.3" @@ -3872,7 +3849,7 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -yoctocolors-cjs@^2.1.3: +yoctocolors-cjs@^2.1.2: version "2.1.3" resolved "https://registry.yarnpkg.com/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz#7e4964ea8ec422b7a40ac917d3a344cfd2304baa" integrity sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==