diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index 17f9d9c5..55e4d7ab 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -614,7 +614,7 @@ types: - PlainText - RichText - Switch - - Video + - VideoLink docs: Choose these appropriate field type for your collection data inline: true source: @@ -754,17 +754,19 @@ types: - DateTime - Email - ExtFileRef + - File - Image - Link - MultiImage - MultiReference - Number + - Option - Phone - PlainText - Reference - RichText - Switch - - Video + - VideoLink docs: Choose these appropriate field type for your collection data inline: true source: @@ -1132,6 +1134,222 @@ types: fieldData: optional source: openapi: ../../../openapi/referenced-specs/v2.yml + CommentThreadAuthor: + properties: + userId: + type: string + docs: The unique identifier of the author + email: + type: string + docs: Email of the author + name: + type: string + docs: Name of the author + source: + openapi: ../../../openapi/referenced-specs/v2.yml + inline: true + CommentThreadMentionedUsersItem: + properties: + userId: + type: string + docs: The unique identifier of the mentioned user + email: + type: string + docs: Email of the user + name: + type: string + docs: Name of the User + source: + openapi: ../../../openapi/referenced-specs/v2.yml + inline: true + CommentThread: + docs: > + 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. + properties: + id: + type: string + docs: Unique identifier for the comment thread + access: read-only + siteId: + type: string + docs: The site unique identifier + access: read-only + pageId: + type: string + docs: The page unique identifier + access: read-only + localeId: + type: optional + docs: The locale unique identifier + access: read-only + itemId: + type: optional + docs: The item unique identifier + access: read-only + breakpoint: + type: string + docs: The breakpoint the comment was left on + access: read-only + url: + type: string + docs: The URL of the page the comment was left on + access: read-only + content: + type: string + docs: The content of the comment reply + isResolved: + type: boolean + docs: Boolean determining if the comment thread is resolved + default: false + author: CommentThreadAuthor + mentionedUsers: + docs: >- + List of mentioned users. This is an empty array until email + notifications are sent, which can take up to 5 minutes after the + comment is created. + type: list + createdOn: + type: string + docs: The date the item was created + access: read-only + lastUpdated: + type: string + docs: The date the item was last updated + access: read-only + source: + openapi: ../../../openapi/referenced-specs/v2.yml + CommentThreadListPagination: + properties: + limit: + type: double + docs: The limit specified in the request (default 100) + default: 100 + offset: + type: double + docs: The offset specified for pagination + default: 0 + total: + type: double + docs: Total number of comment threads + source: + openapi: ../../../openapi/referenced-specs/v2.yml + inline: true + CommentThreadList: + docs: > + A list of comment threads on the site. Contains the content of the first + reply. + properties: + comments: list + pagination: CommentThreadListPagination + source: + openapi: ../../../openapi/referenced-specs/v2.yml + CommentReplyAuthor: + properties: + id: + type: string + docs: The unique identifier of the author + email: + type: string + docs: Email of the author + name: + type: string + docs: Name of the author + source: + openapi: ../../../openapi/referenced-specs/v2.yml + inline: true + CommentReplyMentionedUsersItem: + properties: + id: + type: string + docs: The unique identifier of the mentioned user + email: + type: string + docs: Email of the user + name: + type: string + docs: Name of the User + source: + openapi: ../../../openapi/referenced-specs/v2.yml + inline: true + CommentReply: + docs: > + A comment thread represents a conversation between users on a specific + page. Each comment thread has a unique identifier and can contain multiple + comments. + properties: + id: + type: string + docs: Unique identifier for the comment thread + access: read-only + commentId: + type: string + docs: The comment reply unique identifier + access: read-only + siteId: + type: string + docs: The site unique identifier + access: read-only + pageId: + type: string + docs: The page unique identifier + access: read-only + localeId: + type: optional + docs: The locale unique identifier + access: read-only + breakpoint: + type: string + docs: The breakpoint the comment was left on + access: read-only + content: + type: string + docs: The content of the comment reply + isResolved: + type: boolean + docs: Boolean determining if the comment thread is resolved + default: false + author: CommentReplyAuthor + mentionedUsers: + type: optional> + docs: >- + List of mentioned users is an empty array until email notifications + are sent. + lastUpdated: + type: string + docs: The date the item was last updated + access: read-only + createdOn: + type: string + docs: The date the item was created + access: read-only + source: + openapi: ../../../openapi/referenced-specs/v2.yml + CommentReplyListPagination: + properties: + limit: + type: double + docs: The limit specified in the request (default 100) + default: 100 + offset: + type: double + docs: The offset specified for pagination + default: 0 + total: + type: double + docs: Total number of comment replies + source: + openapi: ../../../openapi/referenced-specs/v2.yml + inline: true + CommentReplyList: + docs: | + A list of comment replies. + properties: + comments: list + pagination: CommentReplyListPagination + source: + openapi: ../../../openapi/referenced-specs/v2.yml PageSeo: docs: SEO-related fields for the Page properties: @@ -1892,6 +2110,7 @@ types: - collection_item_changed - collection_item_deleted - collection_item_unpublished + - comment_created docs: > The type of event that triggered the request. See the the documentation for details on [supported events](/data/reference/all-events). @@ -2432,8 +2651,10 @@ types: SkuValueList: type: map docs: > - A dictionary that maps a SKU property to a SKU value. The key of the - dictionary is the SKU property ID, and the value is the SKU value ID. + 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. SkuFieldDataPrice: docs: price of SKU properties: @@ -2443,6 +2664,9 @@ types: unit: type: optional docs: Currency of Item + currency: + type: optional + docs: Currency of Item (alternative representation) source: openapi: ../../../openapi/referenced-specs/v2.yml inline: true @@ -2561,6 +2785,15 @@ types: quantity: type: optional docs: Quantity of SKU that will be tracked as items are ordered. + main-image: + type: optional + docs: The URL for the main image of the SKU + sku: + type: optional + docs: A unique identifier for the SKU + sku-properties: + type: optional> + docs: The properties of the SKU source: openapi: ../../../openapi/referenced-specs/v2.yml Sku: diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml index aee9acdf..b881d163 100644 --- a/.mock/definition/api.yml +++ b/.mock/definition/api.yml @@ -3,8 +3,15 @@ error-discrimination: strategy: status-code display-name: Data API environments: - Default: https://api.webflow.com/v2 -default-environment: Default + Data API: + urls: + Base: https://api.webflow.com/v2 + Data API: https://api.webflow.com/v2 + Content Delivery API: https://api-cdn.webflow.com/v2 + Production: https://api.webflow.com/v2 + CDN: https://api-cdn.webflow.com/v2 +default-environment: Data API +default-url: Base auth-schemes: BearerToken: scheme: bearer diff --git a/.mock/definition/collections/items.yml b/.mock/definition/collections/items.yml index 2fae3a3b..a80fd3c8 100644 --- a/.mock/definition/collections/items.yml +++ b/.mock/definition/collections/items.yml @@ -340,7 +340,7 @@ service: name: ItemsDeleteItemsRequest body: properties: - items: optional> + items: list content-type: application/json errors: - root.BadRequestError @@ -352,7 +352,9 @@ service: examples: - path-parameters: collection_id: 580e63fc8c9a982ac9b8b745 - request: {} + request: + items: + - id: 580e64008c9a982ac9b8b754 update-items: path: /collections/{collection_id}/items method: PATCH @@ -568,6 +570,11 @@ service: docs: | List all published items in a collection. + + To serve content to your other frontends applications, enterprise sites have access to a dedicated [content delivery API](/data/docs/cms-content-delivery), available at api-cdn.webflow.com. + + + Required scope | `CMS:read` source: openapi: ../../../openapi/referenced-specs/v2.yml @@ -610,6 +617,7 @@ service: docs: Request was successful type: root.CollectionItemList status-code: 200 + url: Data API errors: - root.BadRequestError - root.UnauthorizedError @@ -786,7 +794,7 @@ service: name: ItemsDeleteItemsLiveRequest body: properties: - items: optional> + items: list content-type: application/json errors: - root.BadRequestError @@ -797,7 +805,9 @@ service: examples: - path-parameters: collection_id: 580e63fc8c9a982ac9b8b745 - request: {} + request: + items: + - id: 580e64008c9a982ac9b8b754 update-items-live: path: /collections/{collection_id}/items/live method: PATCH @@ -1323,6 +1333,7 @@ service: docs: Request was successful type: root.CollectionItem status-code: 200 + url: Production errors: - root.BadRequestError - root.UnauthorizedError @@ -1452,6 +1463,11 @@ service: docs: | Get details of a selected Collection live Item. + + To serve content to your other frontends applications, enterprise sites have access to a dedicated [content delivery API](/data/docs/cms-content-delivery), available at api-cdn.webflow.com. + + + Required scope | `CMS:read` source: openapi: ../../../openapi/referenced-specs/v2.yml @@ -1477,6 +1493,7 @@ service: docs: Request was successful type: root.CollectionItem status-code: 200 + url: Data API errors: - root.BadRequestError - root.UnauthorizedError diff --git a/.mock/definition/products.yml b/.mock/definition/products.yml index 966236a1..1f251307 100644 --- a/.mock/definition/products.yml +++ b/.mock/definition/products.yml @@ -84,13 +84,24 @@ service: createdOn: '2023-03-17T18:47:35Z' fieldData: sku-values: - ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 - name: Blue T-shirt - slug: t-shirt-blue + color: blue + size: small + name: Colorful T-shirt - Default + slug: colorful-t-shirt-default price: - value: 100 + value: 2499 unit: USD + currency: USD quantity: 10 + main-image: https://www.example.com/image.jpg + sku: '1234567890' + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue pagination: limit: 100 offset: 0 @@ -100,20 +111,14 @@ service: method: POST auth: true docs: > - Create a new product and SKU. + Create a new ecommerce product and defaultSKU. A product, at minimum, + must have a single SKU. - When you create a product, you will always create a SKU, since a Product - Item must have, at minimum, a single SKU. - - - To create a Product with multiple SKUs - for example a T-shirt in sizes - small, medium and large: - - Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). - - A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. - - Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created. - - In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. - - After you've created your product, you can create additional SKUs using the [Create SKU endpoint.](/data/reference/ecommerce/products/create-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) Upon creation, the default product type will be `Advanced`, which ensures all Product and SKU fields will be shown to users in the @@ -133,8 +138,8 @@ service: body: properties: publishStatus: optional - product: optional - sku: optional + product: ProductSkuCreateProduct + sku: ProductSkuCreateSku content-type: application/json response: docs: Request was successful @@ -151,7 +156,50 @@ service: examples: - path-parameters: site_id: 580e63e98c9a982ac9b8b741 - request: {} + request: + publishStatus: staging + product: + fieldData: + name: Colorful T-shirt + slug: colorful-t-shirt + description: >- + Our best-selling t-shirt available in multiple colors and + sizes + sku-properties: + - id: color + name: Color + enum: + - id: red + name: Red + slug: red + - id: yellow + name: Yellow + slug: yellow + - id: blue + name: Blue + slug: blue + - id: size + name: Size + enum: + - id: small + name: Small + slug: small + - id: medium + name: Medium + slug: medium + - id: large + name: Large + slug: large + sku: + fieldData: + name: Colorful T-shirt - Red Small + slug: colorful-t-shirt-red-small + price: + value: 2499 + unit: USD + currency: USD + main-image: >- + https://rocketamp-sample-store.myshopify.com/cdn/shop/products/Gildan_2000_Antique_Cherry_Red_Front_1024x1024.jpg?v=1527232987 response: body: product: @@ -187,13 +235,24 @@ service: createdOn: '2023-03-17T18:47:35Z' fieldData: sku-values: - ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 - name: Blue T-shirt - slug: t-shirt-blue + color: blue + size: small + name: Colorful T-shirt - Default + slug: colorful-t-shirt-default price: - value: 100 + value: 2499 unit: USD + currency: USD quantity: 10 + main-image: https://www.example.com/image.jpg + sku: '1234567890' + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue get: path: /sites/{site_id}/products/{product_id} method: GET @@ -264,13 +323,24 @@ service: createdOn: '2023-03-17T18:47:35Z' fieldData: sku-values: - ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 - name: Blue T-shirt - slug: t-shirt-blue + color: blue + size: small + name: Colorful T-shirt - Default + slug: colorful-t-shirt-default price: - value: 100 + value: 2499 unit: USD + currency: USD quantity: 10 + main-image: https://www.example.com/image.jpg + sku: '1234567890' + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue update: path: /sites/{site_id}/products/{product_id} method: PATCH @@ -370,7 +440,7 @@ service: product_id: type: string docs: Unique identifier for a Product - display-name: Create SKU + display-name: Create SKUs request: name: ProductsCreateSkuRequest body: @@ -398,11 +468,15 @@ service: product_id: 580e63fc8c9a982ac9b8b745 request: skus: - - {} + - fieldData: + name: Colorful T-shirt - Default + slug: colorful-t-shirt-default + price: + value: 2499 + unit: USD + currency: USD response: body: - required: - key: value skus: - id: 580e63fc8c9a982ac9b8b745 cmsLocaleId: 653ad57de882f528b32e810e @@ -411,13 +485,24 @@ service: createdOn: '2023-03-17T18:47:35Z' fieldData: sku-values: - ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 - name: Blue T-shirt - slug: t-shirt-blue + color: blue + size: small + name: Colorful T-shirt - Default + slug: colorful-t-shirt-default price: - value: 100 + value: 2499 unit: USD + currency: USD quantity: 10 + main-image: https://www.example.com/image.jpg + sku: '1234567890' + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue update-sku: path: /sites/{site_id}/products/{product_id}/skus/{sku_id} method: PATCH @@ -470,7 +555,14 @@ service: product_id: 580e63fc8c9a982ac9b8b745 sku_id: 5e8518516e147040726cc415 request: - sku: {} + sku: + fieldData: + name: Colorful T-shirt - Default + slug: colorful-t-shirt-default + price: + value: 2499 + unit: USD + currency: USD response: body: id: 580e63fc8c9a982ac9b8b745 @@ -480,12 +572,14 @@ service: createdOn: '2023-03-17T18:47:35Z' fieldData: sku-values: - ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 - name: Blue T-shirt - slug: t-shirt-blue + color: blue + size: small + name: Colorful T-shirt - Default + slug: colorful-t-shirt-default price: - value: 100 + value: 2499 unit: USD + currency: USD compare-at-price: value: 100 unit: USD @@ -498,12 +592,32 @@ service: - {} track-inventory: true quantity: 10 + main-image: https://www.example.com/image.jpg + sku: '1234567890' + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue source: openapi: ../../../openapi/referenced-specs/v2.yml types: + ProductSkuCreateProduct: + properties: + fieldData: optional + source: + openapi: ../../../openapi/referenced-specs/v2.yml + inline: true + ProductSkuCreateSku: + properties: + fieldData: optional + source: + openapi: ../../../openapi/referenced-specs/v2.yml + inline: true ProductsCreateSkuResponse: properties: - required: optional - skus: optional> + skus: list source: openapi: ../../../openapi/referenced-specs/v2.yml diff --git a/.mock/definition/sites/comments.yml b/.mock/definition/sites/comments.yml new file mode 100644 index 00000000..3e3b4960 --- /dev/null +++ b/.mock/definition/sites/comments.yml @@ -0,0 +1,325 @@ +types: + CommentsListCommentThreadsRequestSortBy: + enum: + - createdOn + - lastUpdated + source: + openapi: ../../../openapi/referenced-specs/v2.yml + CommentsListCommentThreadsRequestSortOrder: + enum: + - asc + - desc + source: + openapi: ../../../openapi/referenced-specs/v2.yml + CommentsGetCommentThreadRequestSortBy: + enum: + - createdOn + - lastUpdated + source: + openapi: ../../../openapi/referenced-specs/v2.yml + CommentsGetCommentThreadRequestSortOrder: + enum: + - asc + - desc + source: + openapi: ../../../openapi/referenced-specs/v2.yml + CommentsListCommentRepliesRequestSortBy: + enum: + - createdOn + - lastUpdated + source: + openapi: ../../../openapi/referenced-specs/v2.yml + CommentsListCommentRepliesRequestSortOrder: + enum: + - asc + - desc + source: + openapi: ../../../openapi/referenced-specs/v2.yml +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list-comment-threads: + path: /sites/{site_id}/comments + method: GET + auth: true + docs: | + List all comment threads for a site. + + + There may be a delay of up to 5 minutes before new comments appear in the system. + + + Required scope | `comments:read` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Comment Threads + request: + name: CommentsListCommentThreadsRequest + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + sortBy: + type: optional + docs: >- + Sort results by the provided value. Only allowed when sortOrder is + provided. + sortOrder: + type: optional + docs: Sorts the results by asc or desc + response: + docs: Request was successful + type: root.CommentThreadList + status-code: 200 + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + comments: + - id: 679d2ddb5196117ad04d1ffa + siteId: 679826b3b20b045e176bc4b5 + pageId: 679826b3b20b045e176bc4bc + localeId: 67993753d910db250db64b3e + itemId: 580e64008c9a982ac9b8b754 + breakpoint: main + url: >- + https://webflow.com/design/site-slug-4ec832?workflow=comment&commentId=679d2ddb5196117ad04d1ff8&pageId=679826b3b20b045e176bc4bc + content: 'Let''s go to the pub! [[6287ec36a841b25637c663df]] ' + isResolved: false + author: + userId: 6287ec36a841b25637c663df + email: ford.prefect@heartofgold.spaceship + name: Ford Prefect + mentionedUsers: + - userId: 6287ec36a841b25637c663df + email: arthur.dent@heartofgold.spaceship + name: Arthur Dent + createdOn: '2025-01-31T20:08:59.759Z' + lastUpdated: '2025-01-31T20:08:59.759Z' + - id: 679d2ddb5196117ad04d1ffc + siteId: 679826b3b20b045e176bc4b5 + pageId: 679826b3b20b045e176bc4bc + localeId: 67993753d910db250db64b3e + itemId: 580e64008c9a982ac9b8b754 + breakpoint: main + url: >- + https://webflow.com/design/site-slug-4ec832?workflow=comment&commentId=679d2ddb5196117ad04d1ff8&pageId=679826b3b20b045e176bc4bc + content: >- + You have five minutes left to drink it + [[6287ec36a841b25637c663df]] + isResolved: false + author: + userId: 6287ec36a841b25637c663df + email: ford.prefect@heartofgold.spaceship + name: Ford Prefect + mentionedUsers: + - userId: 6287ec36a841b25637c663df + email: arthur.dent@heartofgold.spaceship + name: Arthur Dent + createdOn: '2025-01-31T20:08:59.759Z' + lastUpdated: '2025-01-31T20:08:59.759Z' + pagination: + limit: 2 + offset: 0 + total: 2 + get-comment-thread: + path: /sites/{site_id}/comments/{comment_thread_id} + method: GET + auth: true + docs: | + Get details of a specific comment thread. + + + There may be a delay of up to 5 minutes before new comments appear in the system. + + + Required scope | `comments:read` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + comment_thread_id: + type: string + docs: Unique identifier for a Comment Thread + display-name: Get Comment Thread + request: + name: CommentsGetCommentThreadRequest + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + sortBy: + type: optional + docs: >- + Sort results by the provided value. Only allowed when sortOrder is + provided. + sortOrder: + type: optional + docs: Sorts the results by asc or desc + response: + docs: Request was successful + type: root.CommentThread + status-code: 200 + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + comment_thread_id: 580e63e98c9a982ac9b8b741 + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + id: 580e64008c9a982ac9b8b754 + siteId: 580e64008c9a982ac9b8b754 + pageId: 580e64008c9a982ac9b8b754 + localeId: 580e64008c9a982ac9b8b754 + itemId: 580e64008c9a982ac9b8b754 + breakpoint: main + url: >- + https://webflow.com/design/site-slug-4ec832?workflow=comment&commentId=679d2ddb5196117ad04d1ff8&pageId=679826b3b20b045e176bc4bc + content: This is a comment reply + isResolved: true + author: + userId: userId + email: email + name: name + mentionedUsers: + - userId: 6287ec36a841b25637c663df + email: arthur.dent@heartofgold.spaceship + name: Arthur Dent + createdOn: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + list-comment-replies: + path: /sites/{site_id}/comments/{comment_thread_id}/replies + method: GET + auth: true + docs: | + List all replies to a specific comment thread. + + + There may be a delay of up to 5 minutes before new comments appear in the system. + + + Required scope | `comments:read` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + comment_thread_id: + type: string + docs: Unique identifier for a Comment Thread + display-name: List Comment Replies + request: + name: CommentsListCommentRepliesRequest + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + sortBy: + type: optional + docs: >- + Sort results by the provided value. Only allowed when sortOrder is + provided. + sortOrder: + type: optional + docs: Sorts the results by asc or desc + response: + docs: Request was successful + type: root.CommentReplyList + status-code: 200 + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + comment_thread_id: 580e63e98c9a982ac9b8b741 + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + comments: + - id: 679d2ddb5196117ad04d1ffa + commentId: 679d2ddb5196117ad04d1ff8 + siteId: 679826b3b20b045e176bc4b5 + pageId: 679826b3b20b045e176bc4bc + localeId: 67993753d910db250db64b3e + breakpoint: main + content: >- + This comment mentions another user + [[6287ec36a841b25637c663df]] + isResolved: false + author: + id: id + email: email + name: name + mentionedUsers: + - id: id + email: arthur.dent@example.com + name: Arthur Dent + lastUpdated: '2025-01-31T20:08:59.759Z' + createdOn: '2025-01-31T20:08:59.759Z' + pagination: + limit: 2 + offset: 0 + total: 1 + source: + openapi: ../../../openapi/referenced-specs/v2.yml diff --git a/.mock/definition/sites/robotsTxt.yml b/.mock/definition/sites/robotsTxt.yml index 032bce5d..1259a149 100644 --- a/.mock/definition/sites/robotsTxt.yml +++ b/.mock/definition/sites/robotsTxt.yml @@ -8,9 +8,14 @@ service: path: /sites/{site_id}/robots_txt method: GET auth: true - docs: | + docs: > Retrieve the robots.txt configuration for various user agents. + + This endpoint requires an Enterprise + workspace. + + Required scope: `site_config:read` source: openapi: ../../../openapi/referenced-specs/v2.yml @@ -46,9 +51,14 @@ service: path: /sites/{site_id}/robots_txt method: PUT auth: true - docs: | + docs: > Replace the `robots.txt` configuration for various user agents. + + This endpoint requires an Enterprise + workspace. + + Required scope | `site_config:write` source: openapi: ../../../openapi/referenced-specs/v2.yml @@ -107,6 +117,10 @@ service: access unrestricted unless other directives apply. + This endpoint requires an Enterprise + workspace. + + Required scope: `site_config:write` source: openapi: ../../../openapi/referenced-specs/v2.yml @@ -152,9 +166,14 @@ service: path: /sites/{site_id}/robots_txt method: PATCH auth: true - docs: | + docs: > Update the `robots.txt` configuration for various user agents. + + This endpoint requires an Enterprise + workspace. + + Required scope | `site_config:write` source: openapi: ../../../openapi/referenced-specs/v2.yml diff --git a/.mock/definition/sites/wellKnown.yml b/.mock/definition/sites/wellKnown.yml new file mode 100644 index 00000000..0ba91e13 --- /dev/null +++ b/.mock/definition/sites/wellKnown.yml @@ -0,0 +1,114 @@ +types: + WellKnownFileContentType: + enum: + - value: application/json + name: ApplicationJson + - value: text/plain + name: TextPlain + docs: The content type of the file. Defaults to application/json + default: application/json + inline: true + source: + openapi: ../../../openapi/referenced-specs/v2.yml +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + put: + path: /sites/{site_id}/well_known + method: PUT + auth: true + docs: > + 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` + + + `.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. + + + This endpoint requires an Enterprise + workspace. + + + Required scope: `site_config:write` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Set a well-known file + request: + name: WellKnownFile + body: + properties: + fileName: + type: string + docs: The name of the file + fileData: + type: string + docs: The contents of the file + contentType: + type: optional + docs: The content type of the file. Defaults to application/json + default: application/json + content-type: application/json + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + fileName: fileName + fileData: fileData + delete: + path: /sites/{site_id}/well_known + method: DELETE + auth: true + docs: > + Delete existing well-known files from a site. + + + This endpoint requires an Enterprise + workspace. + + + Required scope: `site_config:write` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Delete a well-known file + request: + name: WellKnownDeleteRequest + body: + properties: + fileNames: + type: optional> + docs: A list of file names to delete + content-type: application/json + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: {} + source: + openapi: ../../../openapi/referenced-specs/v2.yml diff --git a/.mock/fern.config.json b/.mock/fern.config.json index cc6319dc..7838ceaf 100644 --- a/.mock/fern.config.json +++ b/.mock/fern.config.json @@ -1,4 +1,4 @@ { "organization" : "webflow", - "version" : "0.56.16" + "version" : "0.56.34" } \ No newline at end of file diff --git a/package.json b/package.json index bf009cfa..6307c67f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webflow-api", - "version": "3.1.1", + "version": "3.1.2", "private": false, "repository": "https://github.com/webflow/js-webflow-api", "main": "./index.js", @@ -19,7 +19,7 @@ "qs": "6.11.2", "readable-stream": "^4.5.2", "js-base64": "3.7.2", - "crypto-browserify": "^3.12.1" + "crypto-browserify": "^3.12.0" }, "devDependencies": { "@types/url-join": "4.0.1", @@ -41,5 +41,8 @@ "os": false, "path": false, "crypto": false + }, + "resolutions": { + "@types/babel__traverse": "7.20.6" } } diff --git a/reference.md b/reference.md index 9bb92edc..edb5410a 100644 --- a/reference.md +++ b/reference.md @@ -3920,17 +3920,13 @@ await client.products.list("580e63e98c9a982ac9b8b741");
-Create a new product and SKU. +Create a new ecommerce product and defaultSKU. A product, at minimum, must have a single SKU. -When you create a product, you will always create a SKU, since a Product Item must have, at minimum, a single SKU. +To create a product with multiple SKUs: -To create a Product with multiple SKUs - for example a T-shirt in sizes small, medium and large: - -- Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). -- A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. -- Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created. -- In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. -- After you've created your product, you can create additional SKUs using the [Create SKU 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. @@ -3950,7 +3946,73 @@ Required scope | `ecommerce:write`
```typescript -await client.products.create("580e63e98c9a982ac9b8b741"); +await client.products.create("580e63e98c9a982ac9b8b741", { + publishStatus: "staging", + product: { + fieldData: { + name: "Colorful T-shirt", + slug: "colorful-t-shirt", + description: "Our best-selling t-shirt available in multiple colors and sizes", + skuProperties: [ + { + id: "color", + name: "Color", + enum: [ + { + id: "red", + name: "Red", + slug: "red", + }, + { + id: "yellow", + name: "Yellow", + slug: "yellow", + }, + { + id: "blue", + name: "Blue", + slug: "blue", + }, + ], + }, + { + id: "size", + name: "Size", + enum: [ + { + id: "small", + name: "Small", + slug: "small", + }, + { + id: "medium", + name: "Medium", + slug: "medium", + }, + { + id: "large", + name: "Large", + slug: "large", + }, + ], + }, + ], + }, + }, + sku: { + fieldData: { + name: "Colorful T-shirt - Red Small", + slug: "colorful-t-shirt-red-small", + price: { + value: 2499, + unit: "USD", + currency: "USD", + }, + mainImage: + "https://rocketamp-sample-store.myshopify.com/cdn/shop/products/Gildan_2000_Antique_Cherry_Red_Front_1024x1024.jpg?v=1527232987", + }, + }, +}); ```
@@ -4183,7 +4245,19 @@ Required scope | `ecommerce:write` ```typescript await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745", { - skus: [{}], + skus: [ + { + fieldData: { + name: "Colorful T-shirt - Default", + slug: "colorful-t-shirt-default", + price: { + value: 2499, + unit: "USD", + currency: "USD", + }, + }, + }, + ], }); ``` @@ -4268,7 +4342,17 @@ Required scope | `ecommerce:write` ```typescript await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745", "5e8518516e147040726cc415", { - sku: {}, + sku: { + fieldData: { + name: "Colorful T-shirt - Default", + slug: "colorful-t-shirt-default", + price: { + value: 2499, + unit: "USD", + currency: "USD", + }, + }, + }, }); ``` @@ -5064,6 +5148,7 @@ Required scope | `cms:write` ```typescript await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + id: "562ac0395358780a1f5e6fbc", isEditable: true, isRequired: false, type: "RichText", @@ -5459,7 +5544,13 @@ Required scope | `CMS:write`
```typescript -await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745"); +await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "580e64008c9a982ac9b8b754", + }, + ], +}); ```
@@ -5628,6 +5719,11 @@ await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { List all published items in a collection. + + To serve content to your other frontends applications, enterprise sites have access to a dedicated [content delivery API](/data/docs/cms-content-delivery), available at api-cdn.webflow.com. + + + Required scope | `CMS:read` @@ -5720,6 +5816,9 @@ Required scope | `CMS:write` ```typescript await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", isArchived: false, isDraft: false, fieldData: { @@ -5803,7 +5902,13 @@ Required scope | `CMS:write`
```typescript -await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745"); +await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "580e64008c9a982ac9b8b754", + }, + ], +}); ```
@@ -6306,6 +6411,11 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008 Get details of a selected Collection live Item. + + To serve content to your other frontends applications, enterprise sites have access to a dedicated [content delivery API](/data/docs/cms-content-delivery), available at api-cdn.webflow.com. + + + Required scope | `CMS:read` @@ -7247,6 +7357,8 @@ await client.sites.plans.getSitePlan("580e63e98c9a982ac9b8b741"); Retrieve the robots.txt configuration for various user agents. +This endpoint requires an Enterprise workspace. + Required scope: `site_config:read` @@ -7312,6 +7424,8 @@ await client.sites.robotsTxt.get("580e63e98c9a982ac9b8b741"); Replace the `robots.txt` configuration for various user agents. +This endpoint requires an Enterprise workspace. + Required scope | `site_config:write` @@ -7396,6 +7510,8 @@ Remove specific rules for a user-agent in your `robots.txt` file. To delete all **Note:** Deleting a user-agent with no rules will make the user-agent's access unrestricted unless other directives apply. +This endpoint requires an Enterprise workspace. + Required scope: `site_config:write` @@ -7477,6 +7593,8 @@ await client.sites.robotsTxt.delete("580e63e98c9a982ac9b8b741", { Update the `robots.txt` configuration for various user agents. +This endpoint requires an Enterprise workspace. + Required scope | `site_config:write` @@ -7545,6 +7663,171 @@ await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", {
+## Sites WellKnown + +
client.sites.wellKnown.put(siteId, { ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +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` + + + `.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. + + +This endpoint requires an Enterprise workspace. + +Required scope: `site_config:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", { + fileName: "fileName", + fileData: "fileData", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**request:** `Webflow.sites.WellKnownFile` + +
+
+ +
+
+ +**requestOptions:** `WellKnown.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.sites.wellKnown.delete(siteId, { ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete existing well-known files from a site. + +This endpoint requires an Enterprise workspace. + +Required scope: `site_config:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**request:** `Webflow.sites.WellKnownDeleteRequest` + +
+
+ +
+
+ +**requestOptions:** `WellKnown.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Sites ActivityLogs
client.sites.activityLogs.list(siteId, { ...params }) -> Webflow.SiteActivityLogResponse @@ -7622,6 +7905,261 @@ await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741");
+## Sites Comments + +
client.sites.comments.listCommentThreads(siteId, { ...params }) -> Webflow.CommentThreadList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List all comment threads for a site. + + + There may be a delay of up to 5 minutes before new comments appear in the system. + + +Required scope | `comments:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", { + localeId: "65427cf400e02b306eaa04a0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**request:** `Webflow.sites.CommentsListCommentThreadsRequest` + +
+
+ +
+
+ +**requestOptions:** `Comments.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.sites.comments.getCommentThread(siteId, commentThreadId, { ...params }) -> Webflow.CommentThread +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details of a specific comment thread. + + + There may be a delay of up to 5 minutes before new comments appear in the system. + + +Required scope | `comments:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { + localeId: "65427cf400e02b306eaa04a0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**commentThreadId:** `string` — Unique identifier for a Comment Thread + +
+
+ +
+
+ +**request:** `Webflow.sites.CommentsGetCommentThreadRequest` + +
+
+ +
+
+ +**requestOptions:** `Comments.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.sites.comments.listCommentReplies(siteId, commentThreadId, { ...params }) -> Webflow.CommentReplyList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List all replies to a specific comment thread. + + + There may be a delay of up to 5 minutes before new comments appear in the system. + + +Required scope | `comments:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { + localeId: "65427cf400e02b306eaa04a0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**commentThreadId:** `string` — Unique identifier for a Comment Thread + +
+
+ +
+
+ +**request:** `Webflow.sites.CommentsListCommentRepliesRequest` + +
+
+ +
+
+ +**requestOptions:** `Comments.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Sites Scripts
client.sites.scripts.getCustomCode(siteId) -> Webflow.ScriptApplyList diff --git a/src/Client.ts b/src/Client.ts index 8794a022..90d85942 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -22,7 +22,7 @@ import { Ecommerce } from "./api/resources/ecommerce/client/Client"; export declare namespace WebflowClient { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } diff --git a/src/api/resources/accessGroups/client/Client.ts b/src/api/resources/accessGroups/client/Client.ts index 715e0d3f..8e1ac251 100644 --- a/src/api/resources/accessGroups/client/Client.ts +++ b/src/api/resources/accessGroups/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace AccessGroups { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -70,7 +70,7 @@ export class AccessGroups { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/accessgroups` ), method: "GET", @@ -78,8 +78,8 @@ export class AccessGroups { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/assets/client/Client.ts b/src/api/resources/assets/client/Client.ts index c048c471..810251c6 100644 --- a/src/api/resources/assets/client/Client.ts +++ b/src/api/resources/assets/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Assets { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -53,7 +53,7 @@ export class Assets { public async list(siteId: string, requestOptions?: Assets.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/assets` ), method: "GET", @@ -61,8 +61,8 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -187,7 +187,7 @@ export class Assets { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/assets` ), method: "POST", @@ -195,8 +195,8 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -309,7 +309,7 @@ export class Assets { public async get(assetId: string, requestOptions?: Assets.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `assets/${encodeURIComponent(assetId)}` ), method: "GET", @@ -317,8 +317,8 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -426,7 +426,7 @@ export class Assets { public async delete(assetId: string, requestOptions?: Assets.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `assets/${encodeURIComponent(assetId)}` ), method: "DELETE", @@ -434,8 +434,8 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -542,7 +542,7 @@ export class Assets { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `assets/${encodeURIComponent(assetId)}` ), method: "PATCH", @@ -550,8 +550,8 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -664,7 +664,7 @@ export class Assets { public async listFolders(siteId: string, requestOptions?: Assets.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/asset_folders` ), method: "GET", @@ -672,8 +672,8 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -790,7 +790,7 @@ export class Assets { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/asset_folders` ), method: "POST", @@ -798,8 +798,8 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -917,7 +917,7 @@ export class Assets { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `asset_folders/${encodeURIComponent(assetFolderId)}` ), method: "GET", @@ -925,8 +925,8 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/collections/client/Client.ts b/src/api/resources/collections/client/Client.ts index 9cbe3faf..19304f71 100644 --- a/src/api/resources/collections/client/Client.ts +++ b/src/api/resources/collections/client/Client.ts @@ -13,7 +13,7 @@ import { Items } from "../resources/items/client/Client"; export declare namespace Collections { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -55,7 +55,7 @@ export class Collections { public async list(siteId: string, requestOptions?: Collections.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/collections` ), method: "GET", @@ -63,8 +63,8 @@ export class Collections { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -201,7 +201,7 @@ export class Collections { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/collections` ), method: "POST", @@ -209,8 +209,8 @@ export class Collections { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -327,7 +327,7 @@ export class Collections { public async get(collectionId: string, requestOptions?: Collections.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}` ), method: "GET", @@ -335,8 +335,8 @@ export class Collections { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -444,7 +444,7 @@ export class Collections { public async delete(collectionId: string, requestOptions?: Collections.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}` ), method: "DELETE", @@ -452,8 +452,8 @@ export class Collections { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/collections/resources/fields/client/Client.ts b/src/api/resources/collections/resources/fields/client/Client.ts index c206502c..cd63a459 100644 --- a/src/api/resources/collections/resources/fields/client/Client.ts +++ b/src/api/resources/collections/resources/fields/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../../../errors/index"; export declare namespace Fields { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -53,6 +53,7 @@ export class Fields { * * @example * await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + * id: "562ac0395358780a1f5e6fbc", * isEditable: true, * isRequired: false, * type: "RichText", @@ -62,6 +63,7 @@ export class Fields { * * @example * await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + * id: "562ac0395358780a1f5e6fbc", * isEditable: true, * isRequired: false, * type: "Option", @@ -80,6 +82,7 @@ export class Fields { * * @example * await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + * id: "562ac0395358780a1f5e6fbd", * isEditable: true, * isRequired: false, * type: "Reference", @@ -97,7 +100,7 @@ export class Fields { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/fields` ), method: "POST", @@ -105,8 +108,8 @@ export class Fields { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -224,7 +227,7 @@ export class Fields { public async delete(collectionId: string, fieldId: string, requestOptions?: Fields.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}` ), method: "DELETE", @@ -232,8 +235,8 @@ export class Fields { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -348,7 +351,7 @@ export class Fields { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}` ), method: "PATCH", @@ -356,8 +359,8 @@ export class Fields { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/collections/resources/items/client/Client.ts b/src/api/resources/collections/resources/items/client/Client.ts index d5f29bd0..5c5c2bf4 100644 --- a/src/api/resources/collections/resources/items/client/Client.ts +++ b/src/api/resources/collections/resources/items/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../../../errors/index"; export declare namespace Items { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -85,7 +85,7 @@ export class Items { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items` ), method: "GET", @@ -93,8 +93,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -239,7 +239,7 @@ export class Items { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items` ), method: "POST", @@ -247,8 +247,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -362,16 +362,20 @@ export class Items { * @throws {@link Webflow.InternalServerError} * * @example - * await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745") + * await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", { + * items: [{ + * id: "580e64008c9a982ac9b8b754" + * }] + * }) */ public async deleteItems( collectionId: string, - request: Webflow.collections.ItemsDeleteItemsRequest = {}, + request: Webflow.collections.ItemsDeleteItemsRequest, requestOptions?: Items.RequestOptions ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items` ), method: "DELETE", @@ -379,8 +383,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -551,7 +555,7 @@ export class Items { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items` ), method: "PATCH", @@ -559,8 +563,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -658,6 +662,11 @@ export class Items { /** * List all published items in a collection. * + * + * To serve content to your other frontends applications, enterprise sites have access to a dedicated [content delivery API](/data/docs/cms-content-delivery), available at api-cdn.webflow.com. + * + * + * * Required scope | `CMS:read` * * @param {string} collectionId - Unique identifier for a Collection @@ -710,7 +719,8 @@ export class Items { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) + .dataApi, `collections/${encodeURIComponent(collectionId)}/items/live` ), method: "GET", @@ -718,8 +728,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -831,6 +841,9 @@ export class Items { * * @example * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + * lastPublished: "2023-03-17T18:47:35.560Z", + * lastUpdated: "2023-03-17T18:47:35.560Z", + * createdOn: "2023-03-17T18:47:35.560Z", * isArchived: false, * isDraft: false, * fieldData: { @@ -842,6 +855,9 @@ export class Items { * @example * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { * items: [{ + * lastPublished: "2023-03-17T18:47:35.560Z", + * lastUpdated: "2023-03-17T18:47:35.560Z", + * createdOn: "2023-03-17T18:47:35.560Z", * isArchived: false, * isDraft: false, * fieldData: { @@ -849,6 +865,9 @@ export class Items { * slug: "senior-data-analyst" * } * }, { + * lastPublished: "2023-03-17T18:47:35.560Z", + * lastUpdated: "2023-03-17T18:47:35.560Z", + * createdOn: "2023-03-17T18:47:35.560Z", * isArchived: false, * isDraft: false, * fieldData: { @@ -865,7 +884,7 @@ export class Items { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/live` ), method: "POST", @@ -873,8 +892,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -989,16 +1008,20 @@ export class Items { * @throws {@link Webflow.InternalServerError} * * @example - * await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745") + * await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", { + * items: [{ + * id: "580e64008c9a982ac9b8b754" + * }] + * }) */ public async deleteItemsLive( collectionId: string, - request: Webflow.collections.ItemsDeleteItemsLiveRequest = {}, + request: Webflow.collections.ItemsDeleteItemsLiveRequest, requestOptions?: Items.RequestOptions ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/live` ), method: "DELETE", @@ -1006,8 +1029,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1175,7 +1198,7 @@ export class Items { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/live` ), method: "PATCH", @@ -1183,8 +1206,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1333,7 +1356,7 @@ export class Items { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/bulk` ), method: "POST", @@ -1341,8 +1364,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1470,7 +1493,8 @@ export class Items { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) + .production, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}` ), method: "GET", @@ -1478,8 +1502,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1603,7 +1627,7 @@ export class Items { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}` ), method: "DELETE", @@ -1611,8 +1635,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1731,7 +1755,7 @@ export class Items { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}` ), method: "PATCH", @@ -1739,8 +1763,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1838,6 +1862,11 @@ export class Items { /** * Get details of a selected Collection live Item. * + * + * To serve content to your other frontends applications, enterprise sites have access to a dedicated [content delivery API](/data/docs/cms-content-delivery), available at api-cdn.webflow.com. + * + * + * * Required scope | `CMS:read` * * @param {string} collectionId - Unique identifier for a Collection @@ -1868,7 +1897,8 @@ export class Items { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) + .dataApi, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live` ), method: "GET", @@ -1876,8 +1906,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -2003,7 +2033,7 @@ export class Items { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live` ), method: "DELETE", @@ -2011,8 +2041,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -2132,7 +2162,7 @@ export class Items { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live` ), method: "PATCH", @@ -2140,8 +2170,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -2266,7 +2296,7 @@ export class Items { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/publish` ), method: "POST", @@ -2274,8 +2304,8 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, 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 88fa549f..779fb410 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts @@ -6,8 +6,12 @@ import * as Webflow from "../../../../../../index"; /** * @example - * {} + * { + * items: [{ + * id: "580e64008c9a982ac9b8b754" + * }] + * } */ export interface ItemsDeleteItemsLiveRequest { - items?: Webflow.collections.ItemsDeleteItemsLiveRequestItemsItem[]; + items: Webflow.collections.ItemsDeleteItemsLiveRequestItemsItem[]; } 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 39d30414..503c93a0 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts @@ -6,8 +6,12 @@ import * as Webflow from "../../../../../../index"; /** * @example - * {} + * { + * items: [{ + * id: "580e64008c9a982ac9b8b754" + * }] + * } */ export interface ItemsDeleteItemsRequest { - items?: Webflow.collections.ItemsDeleteItemsRequestItemsItem[]; + items: Webflow.collections.ItemsDeleteItemsRequestItemsItem[]; } diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts index 7135aa46..9949c063 100644 --- a/src/api/resources/components/client/Client.ts +++ b/src/api/resources/components/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Components { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -65,7 +65,7 @@ export class Components { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/components` ), method: "GET", @@ -73,8 +73,8 @@ export class Components { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -209,7 +209,7 @@ export class Components { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom` ), method: "GET", @@ -217,8 +217,8 @@ export class Components { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -369,7 +369,7 @@ export class Components { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom` ), method: "POST", @@ -377,8 +377,8 @@ export class Components { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -521,7 +521,7 @@ export class Components { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties` ), method: "GET", @@ -529,8 +529,8 @@ export class Components { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -667,7 +667,7 @@ export class Components { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties` ), method: "POST", @@ -675,8 +675,8 @@ export class Components { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index 0ead87cc..adb153b7 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Ecommerce { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -55,7 +55,7 @@ export class Ecommerce { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/ecommerce/settings` ), method: "GET", @@ -63,8 +63,8 @@ export class Ecommerce { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/forms/client/Client.ts b/src/api/resources/forms/client/Client.ts index 17bc44f7..ac7079bd 100644 --- a/src/api/resources/forms/client/Client.ts +++ b/src/api/resources/forms/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Forms { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -70,7 +70,7 @@ export class Forms { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/forms` ), method: "GET", @@ -78,8 +78,8 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -193,7 +193,7 @@ export class Forms { public async get(formId: string, requestOptions?: Forms.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `forms/${encodeURIComponent(formId)}` ), method: "GET", @@ -201,8 +201,8 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -334,7 +334,7 @@ export class Forms { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `forms/${encodeURIComponent(formId)}/submissions` ), method: "GET", @@ -342,8 +342,8 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -458,7 +458,7 @@ export class Forms { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `form_submissions/${encodeURIComponent(formSubmissionId)}` ), method: "GET", @@ -466,8 +466,8 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -582,7 +582,7 @@ export class Forms { public async deleteSubmission(formSubmissionId: string, requestOptions?: Forms.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `form_submissions/${encodeURIComponent(formSubmissionId)}` ), method: "DELETE", @@ -590,8 +590,8 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -706,7 +706,7 @@ export class Forms { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `form_submissions/${encodeURIComponent(formSubmissionId)}` ), method: "PATCH", @@ -714,8 +714,8 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -858,7 +858,7 @@ export class Forms { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/form_submissions` ), method: "GET", @@ -866,8 +866,8 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index 864cb36f..5421aab5 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Inventory { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -60,7 +60,7 @@ export class Inventory { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/inventory` ), method: "GET", @@ -68,8 +68,8 @@ export class Inventory { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -198,7 +198,7 @@ export class Inventory { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/inventory` ), method: "PATCH", @@ -206,8 +206,8 @@ export class Inventory { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/orders/client/Client.ts b/src/api/resources/orders/client/Client.ts index e618dd83..3c32f5bc 100644 --- a/src/api/resources/orders/client/Client.ts +++ b/src/api/resources/orders/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Orders { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -74,7 +74,7 @@ export class Orders { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/orders` ), method: "GET", @@ -82,8 +82,8 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -200,7 +200,7 @@ export class Orders { public async get(siteId: string, orderId: string, requestOptions?: Orders.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}` ), method: "GET", @@ -208,8 +208,8 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -334,7 +334,7 @@ export class Orders { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}` ), method: "PATCH", @@ -342,8 +342,8 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -471,7 +471,7 @@ export class Orders { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/fulfill` ), method: "POST", @@ -479,8 +479,8 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -606,7 +606,7 @@ export class Orders { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/unfulfill` ), method: "POST", @@ -614,8 +614,8 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -739,7 +739,7 @@ export class Orders { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/refund` ), method: "POST", @@ -747,8 +747,8 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/pages/client/Client.ts b/src/api/resources/pages/client/Client.ts index cb565d69..bac479f5 100644 --- a/src/api/resources/pages/client/Client.ts +++ b/src/api/resources/pages/client/Client.ts @@ -12,7 +12,7 @@ import { Scripts } from "../resources/scripts/client/Client"; export declare namespace Pages { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -75,7 +75,7 @@ export class Pages { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/pages` ), method: "GET", @@ -83,8 +83,8 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -206,7 +206,7 @@ export class Pages { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `pages/${encodeURIComponent(pageId)}` ), method: "GET", @@ -214,8 +214,8 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -365,7 +365,7 @@ export class Pages { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `pages/${encodeURIComponent(pageId)}` ), method: "PUT", @@ -373,8 +373,8 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -514,7 +514,7 @@ export class Pages { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `pages/${encodeURIComponent(pageId)}/dom` ), method: "GET", @@ -522,8 +522,8 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -669,7 +669,7 @@ export class Pages { _queryParams["localeId"] = localeId; const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `pages/${encodeURIComponent(pageId)}/dom` ), method: "POST", @@ -677,8 +677,8 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/pages/resources/scripts/client/Client.ts b/src/api/resources/pages/resources/scripts/client/Client.ts index 59d9db00..c4d6064d 100644 --- a/src/api/resources/pages/resources/scripts/client/Client.ts +++ b/src/api/resources/pages/resources/scripts/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../../../errors/index"; export declare namespace Scripts { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -53,7 +53,7 @@ export class Scripts { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `pages/${encodeURIComponent(pageId)}/custom_code` ), method: "GET", @@ -61,8 +61,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -193,7 +193,7 @@ export class Scripts { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `pages/${encodeURIComponent(pageId)}/custom_code` ), method: "PUT", @@ -201,8 +201,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -319,7 +319,7 @@ export class Scripts { public async deleteCustomCode(pageId: string, requestOptions?: Scripts.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `pages/${encodeURIComponent(pageId)}/custom_code` ), method: "DELETE", @@ -327,8 +327,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/products/client/Client.ts b/src/api/resources/products/client/Client.ts index 3821c2d5..3b0ea51d 100644 --- a/src/api/resources/products/client/Client.ts +++ b/src/api/resources/products/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Products { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -70,7 +70,7 @@ export class Products { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/products` ), method: "GET", @@ -78,8 +78,8 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -173,16 +173,12 @@ export class Products { } /** - * Create a new product and SKU. + * Create a new ecommerce product and defaultSKU. A product, at minimum, must have a single SKU. * - * When you create a product, you will always create a SKU, since a Product Item must have, at minimum, a single SKU. - * - * To create a Product with multiple SKUs - for example a T-shirt in sizes small, medium and large: - * - Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). - * - A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. - * - Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created. - * - In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. - * - After you've created your product, you can create additional SKUs using the [Create SKU endpoint.](/data/reference/ecommerce/products/create-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) * * Upon creation, the default product type will be `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. * @@ -201,16 +197,70 @@ export class Products { * @throws {@link Webflow.InternalServerError} * * @example - * await client.products.create("580e63e98c9a982ac9b8b741") + * await client.products.create("580e63e98c9a982ac9b8b741", { + * publishStatus: "staging", + * product: { + * fieldData: { + * name: "Colorful T-shirt", + * slug: "colorful-t-shirt", + * description: "Our best-selling t-shirt available in multiple colors and sizes", + * skuProperties: [{ + * id: "color", + * name: "Color", + * enum: [{ + * id: "red", + * name: "Red", + * slug: "red" + * }, { + * id: "yellow", + * name: "Yellow", + * slug: "yellow" + * }, { + * id: "blue", + * name: "Blue", + * slug: "blue" + * }] + * }, { + * id: "size", + * name: "Size", + * enum: [{ + * id: "small", + * name: "Small", + * slug: "small" + * }, { + * id: "medium", + * name: "Medium", + * slug: "medium" + * }, { + * id: "large", + * name: "Large", + * slug: "large" + * }] + * }] + * } + * }, + * sku: { + * fieldData: { + * name: "Colorful T-shirt - Red Small", + * slug: "colorful-t-shirt-red-small", + * price: { + * value: 2499, + * unit: "USD", + * currency: "USD" + * }, + * mainImage: "https://rocketamp-sample-store.myshopify.com/cdn/shop/products/Gildan_2000_Antique_Cherry_Red_Front_1024x1024.jpg?v=1527232987" + * } + * } + * }) */ public async create( siteId: string, - request: Webflow.ProductSkuCreate = {}, + request: Webflow.ProductSkuCreate, requestOptions?: Products.RequestOptions ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/products` ), method: "POST", @@ -218,8 +268,8 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -344,7 +394,7 @@ export class Products { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}` ), method: "GET", @@ -352,8 +402,8 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -478,7 +528,7 @@ export class Products { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}` ), method: "PATCH", @@ -486,8 +536,8 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -608,7 +658,17 @@ export class Products { * * @example * await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745", { - * skus: [{}] + * skus: [{ + * fieldData: { + * name: "Colorful T-shirt - Default", + * slug: "colorful-t-shirt-default", + * price: { + * value: 2499, + * unit: "USD", + * currency: "USD" + * } + * } + * }] * }) */ public async createSku( @@ -619,7 +679,7 @@ export class Products { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}/skus` ), method: "POST", @@ -627,8 +687,8 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -750,7 +810,17 @@ export class Products { * * @example * await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745", "5e8518516e147040726cc415", { - * sku: {} + * sku: { + * fieldData: { + * name: "Colorful T-shirt - Default", + * slug: "colorful-t-shirt-default", + * price: { + * value: 2499, + * unit: "USD", + * currency: "USD" + * } + * } + * } * }) */ public async updateSku( @@ -762,7 +832,7 @@ export class Products { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent( productId )}/skus/${encodeURIComponent(skuId)}` @@ -772,8 +842,8 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/products/client/requests/ProductSkuCreate.ts b/src/api/resources/products/client/requests/ProductSkuCreate.ts index f5eeb9a9..d8dd5b6c 100644 --- a/src/api/resources/products/client/requests/ProductSkuCreate.ts +++ b/src/api/resources/products/client/requests/ProductSkuCreate.ts @@ -6,10 +6,64 @@ import * as Webflow from "../../../../index"; /** * @example - * {} + * { + * publishStatus: "staging", + * product: { + * fieldData: { + * name: "Colorful T-shirt", + * slug: "colorful-t-shirt", + * description: "Our best-selling t-shirt available in multiple colors and sizes", + * skuProperties: [{ + * id: "color", + * name: "Color", + * enum: [{ + * id: "red", + * name: "Red", + * slug: "red" + * }, { + * id: "yellow", + * name: "Yellow", + * slug: "yellow" + * }, { + * id: "blue", + * name: "Blue", + * slug: "blue" + * }] + * }, { + * id: "size", + * name: "Size", + * enum: [{ + * id: "small", + * name: "Small", + * slug: "small" + * }, { + * id: "medium", + * name: "Medium", + * slug: "medium" + * }, { + * id: "large", + * name: "Large", + * slug: "large" + * }] + * }] + * } + * }, + * sku: { + * fieldData: { + * name: "Colorful T-shirt - Red Small", + * slug: "colorful-t-shirt-red-small", + * price: { + * value: 2499, + * unit: "USD", + * currency: "USD" + * }, + * mainImage: "https://rocketamp-sample-store.myshopify.com/cdn/shop/products/Gildan_2000_Antique_Cherry_Red_Front_1024x1024.jpg?v=1527232987" + * } + * } + * } */ export interface ProductSkuCreate { publishStatus?: Webflow.PublishStatus; - product?: Webflow.Product; - sku?: Webflow.Sku; + product: Webflow.ProductSkuCreateProduct; + sku: Webflow.ProductSkuCreateSku; } diff --git a/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts b/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts index 6d2e7fd0..3abc641b 100644 --- a/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts +++ b/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts @@ -7,7 +7,17 @@ import * as Webflow from "../../../../index"; /** * @example * { - * skus: [{}] + * skus: [{ + * fieldData: { + * name: "Colorful T-shirt - Default", + * slug: "colorful-t-shirt-default", + * price: { + * value: 2499, + * unit: "USD", + * currency: "USD" + * } + * } + * }] * } */ export interface ProductsCreateSkuRequest { diff --git a/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts b/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts index 9f79e47a..168ef74b 100644 --- a/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts +++ b/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts @@ -7,7 +7,17 @@ import * as Webflow from "../../../../index"; /** * @example * { - * sku: {} + * sku: { + * fieldData: { + * name: "Colorful T-shirt - Default", + * slug: "colorful-t-shirt-default", + * price: { + * value: 2499, + * unit: "USD", + * currency: "USD" + * } + * } + * } * } */ export interface ProductsUpdateSkuRequest { diff --git a/src/api/resources/products/types/ProductSkuCreateProduct.ts b/src/api/resources/products/types/ProductSkuCreateProduct.ts new file mode 100644 index 00000000..c8638f46 --- /dev/null +++ b/src/api/resources/products/types/ProductSkuCreateProduct.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * 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 new file mode 100644 index 00000000..c704fa2f --- /dev/null +++ b/src/api/resources/products/types/ProductSkuCreateSku.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * 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 0f1f0c50..c0a565fa 100644 --- a/src/api/resources/products/types/ProductsCreateSkuResponse.ts +++ b/src/api/resources/products/types/ProductsCreateSkuResponse.ts @@ -5,5 +5,5 @@ import * as Webflow from "../../../index"; export interface ProductsCreateSkuResponse { - skus?: Webflow.Sku[]; + skus: Webflow.Sku[]; } diff --git a/src/api/resources/products/types/index.ts b/src/api/resources/products/types/index.ts index e286df49..61d70f8d 100644 --- a/src/api/resources/products/types/index.ts +++ b/src/api/resources/products/types/index.ts @@ -1 +1,3 @@ +export * from "./ProductSkuCreateProduct"; +export * from "./ProductSkuCreateSku"; export * from "./ProductsCreateSkuResponse"; diff --git a/src/api/resources/scripts/client/Client.ts b/src/api/resources/scripts/client/Client.ts index d0325277..7eb642ff 100644 --- a/src/api/resources/scripts/client/Client.ts +++ b/src/api/resources/scripts/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Scripts { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -54,7 +54,7 @@ export class Scripts { public async list(siteId: string, requestOptions?: Scripts.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/registered_scripts` ), method: "GET", @@ -62,8 +62,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -187,7 +187,7 @@ export class Scripts { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/registered_scripts/hosted` ), method: "POST", @@ -195,8 +195,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -324,7 +324,7 @@ export class Scripts { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/registered_scripts/inline` ), method: "POST", @@ -332,8 +332,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index 49fdc368..c2164bb2 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -11,12 +11,14 @@ 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 { ActivityLogs } from "../resources/activityLogs/client/Client"; +import { Comments } from "../resources/comments/client/Client"; import { Scripts } from "../resources/scripts/client/Client"; export declare namespace Sites { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -68,7 +70,7 @@ export class Sites { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `workspaces/${encodeURIComponent(workspaceId)}/sites` ), method: "POST", @@ -76,8 +78,8 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -191,7 +193,7 @@ export class Sites { public async list(requestOptions?: Sites.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, "sites" ), method: "GET", @@ -199,8 +201,8 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -296,7 +298,7 @@ export class Sites { public async get(siteId: string, requestOptions?: Sites.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}` ), method: "GET", @@ -304,8 +306,8 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -416,7 +418,7 @@ export class Sites { public async delete(siteId: string, requestOptions?: Sites.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}` ), method: "DELETE", @@ -424,8 +426,8 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -537,7 +539,7 @@ export class Sites { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}` ), method: "PATCH", @@ -545,8 +547,8 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -661,7 +663,7 @@ export class Sites { public async getCustomDomain(siteId: string, requestOptions?: Sites.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/custom_domains` ), method: "GET", @@ -669,8 +671,8 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -787,7 +789,7 @@ export class Sites { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/publish` ), method: "POST", @@ -795,8 +797,8 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -899,12 +901,24 @@ export class Sites { return (this._robotsTxt ??= new RobotsTxt(this._options)); } + protected _wellKnown: WellKnown | undefined; + + public get wellKnown(): WellKnown { + return (this._wellKnown ??= new WellKnown(this._options)); + } + protected _activityLogs: ActivityLogs | undefined; public get activityLogs(): ActivityLogs { return (this._activityLogs ??= new ActivityLogs(this._options)); } + protected _comments: Comments | undefined; + + public get comments(): Comments { + return (this._comments ??= new Comments(this._options)); + } + protected _scripts: Scripts | undefined; public get scripts(): Scripts { diff --git a/src/api/resources/sites/index.ts b/src/api/resources/sites/index.ts index 848e75ab..a931b363 100644 --- a/src/api/resources/sites/index.ts +++ b/src/api/resources/sites/index.ts @@ -1,3 +1,3 @@ export * from "./types"; -export * from "./client"; export * from "./resources"; +export * from "./client"; diff --git a/src/api/resources/sites/resources/activityLogs/client/Client.ts b/src/api/resources/sites/resources/activityLogs/client/Client.ts index dee394dd..7f75b0f5 100644 --- a/src/api/resources/sites/resources/activityLogs/client/Client.ts +++ b/src/api/resources/sites/resources/activityLogs/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../../../errors/index"; export declare namespace ActivityLogs { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -66,7 +66,7 @@ export class ActivityLogs { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/activity_logs` ), method: "GET", @@ -74,8 +74,8 @@ export class ActivityLogs { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/sites/resources/comments/client/Client.ts b/src/api/resources/sites/resources/comments/client/Client.ts new file mode 100644 index 00000000..4f78551d --- /dev/null +++ b/src/api/resources/sites/resources/comments/client/Client.ts @@ -0,0 +1,497 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../../../environments"; +import * as core from "../../../../../../core"; +import * as Webflow from "../../../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; + +export declare namespace Comments { + interface Options { + environment?: core.Supplier; + accessToken: core.Supplier; + } + + 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; + } +} + +export class Comments { + constructor(protected readonly _options: Comments.Options) {} + + /** + * List all comment threads for a site. + * + * + * There may be a delay of up to 5 minutes before new comments appear in the system. + * + * + * Required scope | `comments:read` + * + * @param {string} siteId - Unique identifier for a Site + * @param {Webflow.sites.CommentsListCommentThreadsRequest} request + * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", { + * localeId: "65427cf400e02b306eaa04a0" + * }) + */ + public async listCommentThreads( + siteId: string, + request: Webflow.sites.CommentsListCommentThreadsRequest = {}, + requestOptions?: Comments.RequestOptions + ): Promise { + const { localeId, offset, limit, sortBy, sortOrder } = request; + const _queryParams: Record = {}; + if (localeId != null) { + _queryParams["localeId"] = localeId; + } + + if (offset != null) { + _queryParams["offset"] = offset.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (sortBy != null) { + _queryParams["sortBy"] = sortBy; + } + + if (sortOrder != null) { + _queryParams["sortOrder"] = sortOrder; + } + + const _response = await core.fetcher({ + url: urlJoin( + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, + `sites/${encodeURIComponent(siteId)}/comments` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CommentThreadList.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/comments."); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Get details of a specific comment thread. + * + * + * There may be a delay of up to 5 minutes before new comments appear in the system. + * + * + * Required scope | `comments:read` + * + * @param {string} siteId - Unique identifier for a Site + * @param {string} commentThreadId - Unique identifier for a Comment Thread + * @param {Webflow.sites.CommentsGetCommentThreadRequest} request + * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { + * localeId: "65427cf400e02b306eaa04a0" + * }) + */ + public async getCommentThread( + siteId: string, + commentThreadId: string, + request: Webflow.sites.CommentsGetCommentThreadRequest = {}, + requestOptions?: Comments.RequestOptions + ): Promise { + const { localeId, offset, limit, sortBy, sortOrder } = request; + const _queryParams: Record = {}; + if (localeId != null) { + _queryParams["localeId"] = localeId; + } + + if (offset != null) { + _queryParams["offset"] = offset.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (sortBy != null) { + _queryParams["sortBy"] = sortBy; + } + + if (sortOrder != null) { + _queryParams["sortOrder"] = sortOrder; + } + + const _response = await core.fetcher({ + url: urlJoin( + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, + `sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CommentThread.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/comments/{comment_thread_id}." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * List all replies to a specific comment thread. + * + * + * There may be a delay of up to 5 minutes before new comments appear in the system. + * + * + * Required scope | `comments:read` + * + * @param {string} siteId - Unique identifier for a Site + * @param {string} commentThreadId - Unique identifier for a Comment Thread + * @param {Webflow.sites.CommentsListCommentRepliesRequest} request + * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { + * localeId: "65427cf400e02b306eaa04a0" + * }) + */ + public async listCommentReplies( + siteId: string, + commentThreadId: string, + request: Webflow.sites.CommentsListCommentRepliesRequest = {}, + requestOptions?: Comments.RequestOptions + ): Promise { + const { localeId, offset, limit, sortBy, sortOrder } = request; + const _queryParams: Record = {}; + if (localeId != null) { + _queryParams["localeId"] = localeId; + } + + if (offset != null) { + _queryParams["offset"] = offset.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (sortBy != null) { + _queryParams["sortBy"] = sortBy; + } + + if (sortOrder != null) { + _queryParams["sortOrder"] = sortOrder; + } + + const _response = await core.fetcher({ + url: urlJoin( + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, + `sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}/replies` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CommentReplyList.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/comments/{comment_thread_id}/replies." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.accessToken)}`; + } +} diff --git a/src/api/resources/sites/resources/comments/client/index.ts b/src/api/resources/sites/resources/comments/client/index.ts new file mode 100644 index 00000000..415726b7 --- /dev/null +++ b/src/api/resources/sites/resources/comments/client/index.ts @@ -0,0 +1 @@ +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 new file mode 100644 index 00000000..451ff87b --- /dev/null +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * { + * localeId: "65427cf400e02b306eaa04a0" + * } + */ +export interface CommentsGetCommentThreadRequest { + /** + * Unique identifier for a specific locale. Applicable, when using localization. + */ + localeId?: string; + /** + * Offset used for pagination if the results have more than limit records + */ + offset?: number; + /** + * Maximum number of records to be returned (max limit: 100) + */ + limit?: number; + /** + * Sort results by the provided value. Only allowed when sortOrder is provided. + */ + sortBy?: Webflow.sites.CommentsGetCommentThreadRequestSortBy; + /** + * 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 new file mode 100644 index 00000000..5e2589dd --- /dev/null +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * { + * localeId: "65427cf400e02b306eaa04a0" + * } + */ +export interface CommentsListCommentRepliesRequest { + /** + * Unique identifier for a specific locale. Applicable, when using localization. + */ + localeId?: string; + /** + * Offset used for pagination if the results have more than limit records + */ + offset?: number; + /** + * Maximum number of records to be returned (max limit: 100) + */ + limit?: number; + /** + * Sort results by the provided value. Only allowed when sortOrder is provided. + */ + sortBy?: Webflow.sites.CommentsListCommentRepliesRequestSortBy; + /** + * 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 new file mode 100644 index 00000000..2f9fac0b --- /dev/null +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * { + * localeId: "65427cf400e02b306eaa04a0" + * } + */ +export interface CommentsListCommentThreadsRequest { + /** + * Unique identifier for a specific locale. Applicable, when using localization. + */ + localeId?: string; + /** + * Offset used for pagination if the results have more than limit records + */ + offset?: number; + /** + * Maximum number of records to be returned (max limit: 100) + */ + limit?: number; + /** + * Sort results by the provided value. Only allowed when sortOrder is provided. + */ + sortBy?: Webflow.sites.CommentsListCommentThreadsRequestSortBy; + /** + * 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 new file mode 100644 index 00000000..6a4c7581 --- /dev/null +++ b/src/api/resources/sites/resources/comments/client/requests/index.ts @@ -0,0 +1,3 @@ +export { type CommentsListCommentThreadsRequest } from "./CommentsListCommentThreadsRequest"; +export { type CommentsGetCommentThreadRequest } from "./CommentsGetCommentThreadRequest"; +export { type CommentsListCommentRepliesRequest } from "./CommentsListCommentRepliesRequest"; diff --git a/src/api/resources/sites/resources/comments/index.ts b/src/api/resources/sites/resources/comments/index.ts new file mode 100644 index 00000000..c9240f83 --- /dev/null +++ b/src/api/resources/sites/resources/comments/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts new file mode 100644 index 00000000..b4890b59 --- /dev/null +++ b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts @@ -0,0 +1,10 @@ +/** + * 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; diff --git a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts new file mode 100644 index 00000000..4d59c9ec --- /dev/null +++ b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts @@ -0,0 +1,10 @@ +/** + * 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; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts new file mode 100644 index 00000000..495bb8ca --- /dev/null +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts @@ -0,0 +1,10 @@ +/** + * 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; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts new file mode 100644 index 00000000..7e890721 --- /dev/null +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts @@ -0,0 +1,10 @@ +/** + * 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; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts new file mode 100644 index 00000000..4f903c7c --- /dev/null +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts @@ -0,0 +1,10 @@ +/** + * 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; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts new file mode 100644 index 00000000..f8c50a9b --- /dev/null +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts @@ -0,0 +1,10 @@ +/** + * 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; diff --git a/src/api/resources/sites/resources/comments/types/index.ts b/src/api/resources/sites/resources/comments/types/index.ts new file mode 100644 index 00000000..0d2c5090 --- /dev/null +++ b/src/api/resources/sites/resources/comments/types/index.ts @@ -0,0 +1,6 @@ +export * from "./CommentsListCommentThreadsRequestSortBy"; +export * from "./CommentsListCommentThreadsRequestSortOrder"; +export * from "./CommentsGetCommentThreadRequestSortBy"; +export * from "./CommentsGetCommentThreadRequestSortOrder"; +export * from "./CommentsListCommentRepliesRequestSortBy"; +export * from "./CommentsListCommentRepliesRequestSortOrder"; diff --git a/src/api/resources/sites/resources/index.ts b/src/api/resources/sites/resources/index.ts index 35fcc5b7..e0f7c245 100644 --- a/src/api/resources/sites/resources/index.ts +++ b/src/api/resources/sites/resources/index.ts @@ -1,7 +1,13 @@ +export * as wellKnown from "./wellKnown"; +export * from "./wellKnown/types"; +export * as comments from "./comments"; +export * from "./comments/types"; export * as redirects from "./redirects"; export * as plans from "./plans"; export * as robotsTxt from "./robotsTxt"; export * as activityLogs from "./activityLogs"; export * as scripts from "./scripts"; +export * from "./wellKnown/client/requests"; export * from "./activityLogs/client/requests"; +export * from "./comments/client/requests"; export * from "./scripts/client/requests"; diff --git a/src/api/resources/sites/resources/plans/client/Client.ts b/src/api/resources/sites/resources/plans/client/Client.ts index 24b35aea..118700a9 100644 --- a/src/api/resources/sites/resources/plans/client/Client.ts +++ b/src/api/resources/sites/resources/plans/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../../../errors/index"; export declare namespace Plans { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -52,7 +52,7 @@ export class Plans { public async getSitePlan(siteId: string, requestOptions?: Plans.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/plan` ), method: "GET", @@ -60,8 +60,8 @@ export class Plans { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/sites/resources/redirects/client/Client.ts b/src/api/resources/sites/resources/redirects/client/Client.ts index ebc41a36..a88b7b64 100644 --- a/src/api/resources/sites/resources/redirects/client/Client.ts +++ b/src/api/resources/sites/resources/redirects/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../../../errors/index"; export declare namespace Redirects { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -54,7 +54,7 @@ export class Redirects { public async list(siteId: string, requestOptions?: Redirects.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/redirects` ), method: "GET", @@ -62,8 +62,8 @@ export class Redirects { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -184,7 +184,7 @@ export class Redirects { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/redirects` ), method: "POST", @@ -192,8 +192,8 @@ export class Redirects { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -315,7 +315,7 @@ export class Redirects { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/redirects/${encodeURIComponent(redirectId)}` ), method: "DELETE", @@ -323,8 +323,8 @@ export class Redirects { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -447,7 +447,7 @@ export class Redirects { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/redirects/${encodeURIComponent(redirectId)}` ), method: "PATCH", @@ -455,8 +455,8 @@ export class Redirects { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/sites/resources/robotsTxt/client/Client.ts b/src/api/resources/sites/resources/robotsTxt/client/Client.ts index 366c03e8..b010a215 100644 --- a/src/api/resources/sites/resources/robotsTxt/client/Client.ts +++ b/src/api/resources/sites/resources/robotsTxt/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../../../errors/index"; export declare namespace RobotsTxt { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -33,6 +33,8 @@ export class RobotsTxt { /** * Retrieve the robots.txt configuration for various user agents. * + * This endpoint requires an Enterprise workspace. + * * Required scope: `site_config:read` * * @param {string} siteId - Unique identifier for a Site @@ -50,7 +52,7 @@ export class RobotsTxt { public async get(siteId: string, requestOptions?: RobotsTxt.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/robots_txt` ), method: "GET", @@ -58,8 +60,8 @@ export class RobotsTxt { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -150,6 +152,8 @@ export class RobotsTxt { /** * Replace the `robots.txt` configuration for various user agents. * + * This endpoint requires an Enterprise workspace. + * * Required scope | `site_config:write` * * @param {string} siteId - Unique identifier for a Site @@ -179,7 +183,7 @@ export class RobotsTxt { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/robots_txt` ), method: "PUT", @@ -187,8 +191,8 @@ export class RobotsTxt { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -286,6 +290,8 @@ export class RobotsTxt { * * **Note:** Deleting a user-agent with no rules will make the user-agent's access unrestricted unless other directives apply. * + * This endpoint requires an Enterprise workspace. + * * Required scope: `site_config:write` * * @param {string} siteId - Unique identifier for a Site @@ -314,7 +320,7 @@ export class RobotsTxt { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/robots_txt` ), method: "DELETE", @@ -322,8 +328,8 @@ export class RobotsTxt { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -421,6 +427,8 @@ export class RobotsTxt { /** * Update the `robots.txt` configuration for various user agents. * + * This endpoint requires an Enterprise workspace. + * * Required scope | `site_config:write` * * @param {string} siteId - Unique identifier for a Site @@ -450,7 +458,7 @@ export class RobotsTxt { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/robots_txt` ), method: "PATCH", @@ -458,8 +466,8 @@ export class RobotsTxt { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/sites/resources/scripts/client/Client.ts b/src/api/resources/sites/resources/scripts/client/Client.ts index 68d709cb..a0351114 100644 --- a/src/api/resources/sites/resources/scripts/client/Client.ts +++ b/src/api/resources/sites/resources/scripts/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../../../errors/index"; export declare namespace Scripts { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -57,7 +57,7 @@ export class Scripts { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/custom_code` ), method: "GET", @@ -65,8 +65,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -196,7 +196,7 @@ export class Scripts { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/custom_code` ), method: "PUT", @@ -204,8 +204,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -318,7 +318,7 @@ export class Scripts { public async deleteCustomCode(siteId: string, requestOptions?: Scripts.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/custom_code` ), method: "DELETE", @@ -326,8 +326,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -452,7 +452,7 @@ export class Scripts { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/custom_code/blocks` ), method: "GET", @@ -460,8 +460,8 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/sites/resources/wellKnown/client/Client.ts b/src/api/resources/sites/resources/wellKnown/client/Client.ts new file mode 100644 index 00000000..d6e6a29b --- /dev/null +++ b/src/api/resources/sites/resources/wellKnown/client/Client.ts @@ -0,0 +1,296 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../../../environments"; +import * as core from "../../../../../../core"; +import * as Webflow from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../../../errors/index"; + +export declare namespace WellKnown { + interface Options { + environment?: core.Supplier; + accessToken: core.Supplier; + } + + 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; + } +} + +export class WellKnown { + constructor(protected readonly _options: WellKnown.Options) {} + + /** + * 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` + * + * + * `.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. + * + * + * This endpoint requires an Enterprise workspace. + * + * Required scope: `site_config:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {Webflow.sites.WellKnownFile} request + * @param {WellKnown.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", { + * fileName: "fileName", + * fileData: "fileData" + * }) + */ + public async put( + siteId: string, + request: Webflow.sites.WellKnownFile, + requestOptions?: WellKnown.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, + `sites/${encodeURIComponent(siteId)}/well_known` + ), + method: "PUT", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + 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, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError("Timeout exceeded when calling PUT /sites/{site_id}/well_known."); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Delete existing well-known files from a site. + * + * This endpoint requires an Enterprise workspace. + * + * Required scope: `site_config:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {Webflow.sites.WellKnownDeleteRequest} request + * @param {WellKnown.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741") + */ + public async delete( + siteId: string, + request: Webflow.sites.WellKnownDeleteRequest = {}, + requestOptions?: WellKnown.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, + `sites/${encodeURIComponent(siteId)}/well_known` + ), + method: "DELETE", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + 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, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /sites/{site_id}/well_known." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.accessToken)}`; + } +} diff --git a/src/api/resources/sites/resources/wellKnown/client/index.ts b/src/api/resources/sites/resources/wellKnown/client/index.ts new file mode 100644 index 00000000..415726b7 --- /dev/null +++ b/src/api/resources/sites/resources/wellKnown/client/index.ts @@ -0,0 +1 @@ +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 new file mode 100644 index 00000000..12b026fe --- /dev/null +++ b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface WellKnownDeleteRequest { + /** A list of file names to delete */ + fileNames?: string[]; +} diff --git a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts new file mode 100644 index 00000000..14b408f6 --- /dev/null +++ b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * { + * fileName: "fileName", + * fileData: "fileData" + * } + */ +export interface WellKnownFile { + /** The name of the file */ + fileName: string; + /** The contents of the file */ + fileData: string; + /** The content type of the file. Defaults to application/json */ + contentType?: Webflow.sites.WellKnownFileContentType; +} diff --git a/src/api/resources/sites/resources/wellKnown/client/requests/index.ts b/src/api/resources/sites/resources/wellKnown/client/requests/index.ts new file mode 100644 index 00000000..80d597d9 --- /dev/null +++ b/src/api/resources/sites/resources/wellKnown/client/requests/index.ts @@ -0,0 +1,2 @@ +export { type WellKnownFile } from "./WellKnownFile"; +export { type WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; diff --git a/src/api/resources/sites/resources/wellKnown/index.ts b/src/api/resources/sites/resources/wellKnown/index.ts new file mode 100644 index 00000000..c9240f83 --- /dev/null +++ b/src/api/resources/sites/resources/wellKnown/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts b/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts new file mode 100644 index 00000000..459443e3 --- /dev/null +++ b/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts @@ -0,0 +1,13 @@ +/** + * 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"; + +export const WellKnownFileContentType = { + ApplicationJson: "application/json", + TextPlain: "text/plain", +} as const; diff --git a/src/api/resources/sites/resources/wellKnown/types/index.ts b/src/api/resources/sites/resources/wellKnown/types/index.ts new file mode 100644 index 00000000..e9347565 --- /dev/null +++ b/src/api/resources/sites/resources/wellKnown/types/index.ts @@ -0,0 +1 @@ +export * from "./WellKnownFileContentType"; diff --git a/src/api/resources/token/client/Client.ts b/src/api/resources/token/client/Client.ts index cf6acf0c..66e67b22 100644 --- a/src/api/resources/token/client/Client.ts +++ b/src/api/resources/token/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Token { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -46,7 +46,7 @@ export class Token { public async authorizedBy(requestOptions?: Token.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, "token/authorized_by" ), method: "GET", @@ -54,8 +54,8 @@ export class Token { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -128,7 +128,7 @@ export class Token { public async introspect(requestOptions?: Token.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, "token/introspect" ), method: "GET", @@ -136,8 +136,8 @@ export class Token { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/users/client/Client.ts b/src/api/resources/users/client/Client.ts index 95b20b60..fcbee63c 100644 --- a/src/api/resources/users/client/Client.ts +++ b/src/api/resources/users/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Users { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -70,7 +70,7 @@ export class Users { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/users` ), method: "GET", @@ -78,8 +78,8 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -192,7 +192,7 @@ export class Users { public async get(siteId: string, userId: string, requestOptions?: Users.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}` ), method: "GET", @@ -200,8 +200,8 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -315,7 +315,7 @@ export class Users { public async delete(siteId: string, userId: string, requestOptions?: Users.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}` ), method: "DELETE", @@ -323,8 +323,8 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -448,7 +448,7 @@ export class Users { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}` ), method: "PATCH", @@ -456,8 +456,8 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -586,7 +586,7 @@ export class Users { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/users/invite` ), method: "POST", @@ -594,8 +594,8 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index 2b527749..b4eaa2c3 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index"; export declare namespace Webhooks { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; accessToken: core.Supplier; } @@ -53,7 +53,7 @@ export class Webhooks { public async list(siteId: string, requestOptions?: Webhooks.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/webhooks` ), method: "GET", @@ -61,8 +61,8 @@ export class Webhooks { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -186,7 +186,7 @@ export class Webhooks { ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `sites/${encodeURIComponent(siteId)}/webhooks` ), method: "POST", @@ -194,8 +194,8 @@ export class Webhooks { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -308,7 +308,7 @@ export class Webhooks { public async get(webhookId: string, requestOptions?: Webhooks.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `webhooks/${encodeURIComponent(webhookId)}` ), method: "GET", @@ -316,8 +316,8 @@ export class Webhooks { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -425,7 +425,7 @@ export class Webhooks { public async delete(webhookId: string, requestOptions?: Webhooks.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi).base, `webhooks/${encodeURIComponent(webhookId)}` ), method: "DELETE", @@ -433,8 +433,8 @@ export class Webhooks { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.1.1", - "User-Agent": "webflow-api/3.1.1", + "X-Fern-SDK-Version": "3.1.2", + "User-Agent": "webflow-api/3.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/types/Asset.ts b/src/api/types/Asset.ts index 3b875559..54c7a8b0 100644 --- a/src/api/types/Asset.ts +++ b/src/api/types/Asset.ts @@ -9,25 +9,25 @@ import * as Webflow from "../index"; */ export interface Asset { /** Unique identifier for this asset */ - id?: string; + id: string; /** File format type */ - contentType?: string; + contentType: string; /** size in bytes */ - size?: number; + size: number; /** Unique identifier for the site that hosts this asset */ - siteId?: string; + siteId: string; /** Link to the asset */ - hostedUrl?: string; + hostedUrl: string; /** Original file name at the time of upload */ - originalFileName?: string; + originalFileName: string; /** Display name of the asset */ - displayName?: string; + displayName: string; /** Date the asset metadata was last updated */ - lastUpdated?: Date; + lastUpdated: Date; /** Date the asset metadata was created */ - createdOn?: Date; + createdOn: Date; /** A list of [asset variants](https://help.webflow.com/hc/en-us/articles/33961378697107-Responsive-images) created by Webflow to serve your site responsively. */ - variants?: Webflow.AssetVariant[]; + variants: Webflow.AssetVariant[]; /** The visual description of the asset */ altText?: string; } diff --git a/src/api/types/AssetVariant.ts b/src/api/types/AssetVariant.ts index 2f5052d8..7d2c25c8 100644 --- a/src/api/types/AssetVariant.ts +++ b/src/api/types/AssetVariant.ts @@ -7,19 +7,19 @@ */ export interface AssetVariant { /** URL of where the asset variant is hosted */ - hostedUrl?: string; + hostedUrl: string; /** Original file name of the variant */ - originalFileName?: string; + originalFileName: string; /** Display name of the variant */ - displayName?: string; + displayName: string; /** format of the variant */ - format?: string; + format: string; /** Width in pixels */ - width?: number; + width: number; /** Height in pixels */ - height?: number; + height: number; /** Value between 0 and 100 representing the image quality */ - quality?: number; + quality: number; /** Any associated validation errors */ error?: string; } diff --git a/src/api/types/Collection.ts b/src/api/types/Collection.ts index 1dba545f..5214eec9 100644 --- a/src/api/types/Collection.ts +++ b/src/api/types/Collection.ts @@ -11,9 +11,9 @@ export interface Collection { /** Unique identifier for a Collection */ id: string; /** Name given to the Collection */ - displayName?: string; + displayName: string; /** The name of one Item in Collection (e.g. ”Blog Post” if the Collection is called “Blog Posts”) */ - singularName?: string; + singularName: string; /** Slug of Collection in Site URL structure */ slug?: string; /** The date the collection was created */ diff --git a/src/api/types/CollectionItem.ts b/src/api/types/CollectionItem.ts index 2783d84b..67536fe9 100644 --- a/src/api/types/CollectionItem.ts +++ b/src/api/types/CollectionItem.ts @@ -17,11 +17,11 @@ export interface CollectionItem { /** Identifier for the locale of the CMS item */ cmsLocaleId?: string; /** The date the item was last published */ - lastPublished?: string; + lastPublished: string; /** The date the item was last updated */ - lastUpdated?: string; + lastUpdated: string; /** The date the item was created */ - createdOn?: string; + createdOn: string; /** Boolean determining if the Item is set to archived */ isArchived?: boolean; /** Boolean determining if the Item is set to draft */ diff --git a/src/api/types/CommentReply.ts b/src/api/types/CommentReply.ts new file mode 100644 index 00000000..da62cc86 --- /dev/null +++ b/src/api/types/CommentReply.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * 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. + */ +export interface CommentReply { + /** Unique identifier for the comment thread */ + id: string; + /** The comment reply unique identifier */ + commentId: string; + /** The site unique identifier */ + siteId: string; + /** The page unique identifier */ + pageId: string; + /** The locale unique identifier */ + localeId?: string; + /** The breakpoint the comment was left on */ + breakpoint: string; + /** The content of the comment reply */ + content: string; + /** Boolean determining if the comment thread is resolved */ + isResolved: boolean; + author: Webflow.CommentReplyAuthor; + /** List of mentioned users is an empty array until email notifications are sent. */ + mentionedUsers?: Webflow.CommentReplyMentionedUsersItem[]; + /** The date the item was last updated */ + lastUpdated: string; + /** The date the item was created */ + createdOn: string; +} diff --git a/src/api/types/CommentReplyAuthor.ts b/src/api/types/CommentReplyAuthor.ts new file mode 100644 index 00000000..a2e04427 --- /dev/null +++ b/src/api/types/CommentReplyAuthor.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CommentReplyAuthor { + /** The unique identifier of the author */ + id: string; + /** Email of the author */ + email: string; + /** Name of the author */ + name: string; +} diff --git a/src/api/types/CommentReplyList.ts b/src/api/types/CommentReplyList.ts new file mode 100644 index 00000000..16884f3c --- /dev/null +++ b/src/api/types/CommentReplyList.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * A list of comment replies. + */ +export interface CommentReplyList { + comments: Webflow.CommentReply[]; + pagination: Webflow.CommentReplyListPagination; +} diff --git a/src/api/types/CommentReplyListPagination.ts b/src/api/types/CommentReplyListPagination.ts new file mode 100644 index 00000000..e96f3972 --- /dev/null +++ b/src/api/types/CommentReplyListPagination.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CommentReplyListPagination { + /** The limit specified in the request (default 100) */ + limit: number; + /** The offset specified for pagination */ + offset: number; + /** Total number of comment replies */ + total: number; +} diff --git a/src/api/types/CommentReplyMentionedUsersItem.ts b/src/api/types/CommentReplyMentionedUsersItem.ts new file mode 100644 index 00000000..3d1a27ba --- /dev/null +++ b/src/api/types/CommentReplyMentionedUsersItem.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CommentReplyMentionedUsersItem { + /** The unique identifier of the mentioned user */ + id: string; + /** Email of the user */ + email: string; + /** Name of the User */ + name: string; +} diff --git a/src/api/types/CommentThread.ts b/src/api/types/CommentThread.ts new file mode 100644 index 00000000..c8e3e685 --- /dev/null +++ b/src/api/types/CommentThread.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * 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. + */ +export interface CommentThread { + /** Unique identifier for the comment thread */ + id: string; + /** The site unique identifier */ + siteId: string; + /** The page unique identifier */ + pageId: string; + /** The locale unique identifier */ + localeId?: string; + /** The item unique identifier */ + itemId?: string; + /** The breakpoint the comment was left on */ + breakpoint: string; + /** The URL of the page the comment was left on */ + url: string; + /** The content of the comment reply */ + content: string; + /** Boolean determining if the comment thread is resolved */ + isResolved: boolean; + author: Webflow.CommentThreadAuthor; + /** List of mentioned users. This is an empty array until email notifications are sent, which can take up to 5 minutes after the comment is created. */ + mentionedUsers: Webflow.CommentThreadMentionedUsersItem[]; + /** The date the item was created */ + createdOn: string; + /** The date the item was last updated */ + lastUpdated: string; +} diff --git a/src/api/types/CommentThreadAuthor.ts b/src/api/types/CommentThreadAuthor.ts new file mode 100644 index 00000000..3dd3cdb4 --- /dev/null +++ b/src/api/types/CommentThreadAuthor.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CommentThreadAuthor { + /** The unique identifier of the author */ + userId: string; + /** Email of the author */ + email: string; + /** Name of the author */ + name: string; +} diff --git a/src/api/types/CommentThreadList.ts b/src/api/types/CommentThreadList.ts new file mode 100644 index 00000000..dd90cfcc --- /dev/null +++ b/src/api/types/CommentThreadList.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * A list of comment threads on the site. Contains the content of the first reply. + */ +export interface CommentThreadList { + comments: Webflow.CommentThread[]; + pagination: Webflow.CommentThreadListPagination; +} diff --git a/src/api/types/CommentThreadListPagination.ts b/src/api/types/CommentThreadListPagination.ts new file mode 100644 index 00000000..6399f3e5 --- /dev/null +++ b/src/api/types/CommentThreadListPagination.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CommentThreadListPagination { + /** The limit specified in the request (default 100) */ + limit: number; + /** The offset specified for pagination */ + offset: number; + /** Total number of comment threads */ + total: number; +} diff --git a/src/api/types/CommentThreadMentionedUsersItem.ts b/src/api/types/CommentThreadMentionedUsersItem.ts new file mode 100644 index 00000000..851363c9 --- /dev/null +++ b/src/api/types/CommentThreadMentionedUsersItem.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CommentThreadMentionedUsersItem { + /** The unique identifier of the mentioned user */ + userId: string; + /** Email of the user */ + email: string; + /** Name of the User */ + name: string; +} diff --git a/src/api/types/ComponentNode.ts b/src/api/types/ComponentNode.ts index 33b9349c..6b1d4a62 100644 --- a/src/api/types/ComponentNode.ts +++ b/src/api/types/ComponentNode.ts @@ -9,9 +9,9 @@ import * as Webflow from "../index"; */ export interface ComponentNode { /** The unique identifier of the component instance node */ - id?: string; + id: string; /** The unique identifier of the component */ - componentId?: string; + componentId: string; /** List of component properties with overrides for a component instance. */ - propertyOverrides?: Webflow.ComponentProperty[]; + propertyOverrides: Webflow.ComponentProperty[]; } diff --git a/src/api/types/FieldType.ts b/src/api/types/FieldType.ts index 2cda2301..f8298384 100644 --- a/src/api/types/FieldType.ts +++ b/src/api/types/FieldType.ts @@ -10,32 +10,36 @@ export type FieldType = | "DateTime" | "Email" | "ExtFileRef" + | "File" | "Image" | "Link" | "MultiImage" | "MultiReference" | "Number" + | "Option" | "Phone" | "PlainText" | "Reference" | "RichText" | "Switch" - | "Video"; + | "VideoLink"; export const FieldType = { Color: "Color", DateTime: "DateTime", Email: "Email", ExtFileRef: "ExtFileRef", + File: "File", Image: "Image", Link: "Link", MultiImage: "MultiImage", MultiReference: "MultiReference", Number: "Number", + Option: "Option", Phone: "Phone", PlainText: "PlainText", Reference: "Reference", RichText: "RichText", Switch: "Switch", - Video: "Video", + VideoLink: "VideoLink", } as const; diff --git a/src/api/types/ImageNode.ts b/src/api/types/ImageNode.ts index fa70785b..8134be46 100644 --- a/src/api/types/ImageNode.ts +++ b/src/api/types/ImageNode.ts @@ -9,9 +9,9 @@ import * as Webflow from "../index"; */ export interface ImageNode { /** Node UUID */ - id?: string; + id: string; /** The image details of the node */ - image?: Webflow.ImageNodeImage; + image: Webflow.ImageNodeImage; /** The custom attributes of the node */ attributes?: Record; } diff --git a/src/api/types/Pagination.ts b/src/api/types/Pagination.ts index 1ee7cd06..3f34a0c1 100644 --- a/src/api/types/Pagination.ts +++ b/src/api/types/Pagination.ts @@ -7,9 +7,9 @@ */ export interface Pagination { /** The limit used for pagination */ - limit?: number; + limit: number; /** The offset used for pagination */ - offset?: number; + offset: number; /** The total number of records */ - total?: number; + total: number; } diff --git a/src/api/types/SkuFieldData.ts b/src/api/types/SkuFieldData.ts index 9c4e5e84..19807009 100644 --- a/src/api/types/SkuFieldData.ts +++ b/src/api/types/SkuFieldData.ts @@ -25,4 +25,10 @@ export interface SkuFieldData { trackInventory?: boolean; /** Quantity of SKU that will be tracked as items are ordered. */ quantity?: number; + /** The URL for the main image of the SKU */ + mainImage?: string; + /** A unique identifier for the SKU */ + sku?: string; + /** The properties of the SKU */ + skuProperties?: Webflow.SkuPropertyList[]; } diff --git a/src/api/types/SkuFieldDataPrice.ts b/src/api/types/SkuFieldDataPrice.ts index 3266db3a..d37d51d9 100644 --- a/src/api/types/SkuFieldDataPrice.ts +++ b/src/api/types/SkuFieldDataPrice.ts @@ -10,4 +10,6 @@ export interface SkuFieldDataPrice { value?: number; /** Currency of Item */ unit?: string; + /** Currency of Item (alternative representation) */ + currency?: string; } diff --git a/src/api/types/SkuValueList.ts b/src/api/types/SkuValueList.ts index a090b5d2..be5dd1f7 100644 --- a/src/api/types/SkuValueList.ts +++ b/src/api/types/SkuValueList.ts @@ -3,6 +3,6 @@ */ /** - * A dictionary that maps a SKU property to a SKU value. The key of the dictionary is the SKU property ID, and the value is the SKU value ID. + * 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. */ export type SkuValueList = Record; diff --git a/src/api/types/StaticFieldType.ts b/src/api/types/StaticFieldType.ts index 8d7749ef..56bd6d20 100644 --- a/src/api/types/StaticFieldType.ts +++ b/src/api/types/StaticFieldType.ts @@ -18,7 +18,7 @@ export type StaticFieldType = | "PlainText" | "RichText" | "Switch" - | "Video"; + | "VideoLink"; export const StaticFieldType = { Color: "Color", @@ -33,5 +33,5 @@ export const StaticFieldType = { PlainText: "PlainText", RichText: "RichText", Switch: "Switch", - Video: "Video", + VideoLink: "VideoLink", } as const; diff --git a/src/api/types/TextNode.ts b/src/api/types/TextNode.ts index cbd68242..13015905 100644 --- a/src/api/types/TextNode.ts +++ b/src/api/types/TextNode.ts @@ -9,9 +9,9 @@ import * as Webflow from "../index"; */ export interface TextNode { /** Node UUID */ - id?: string; + id: string; /** The text content of the node */ - text?: Webflow.TextNodeText; + text: Webflow.TextNodeText; /** The custom attributes of the node */ attributes?: Record; } diff --git a/src/api/types/TriggerType.ts b/src/api/types/TriggerType.ts index edcf942f..858a5e6c 100644 --- a/src/api/types/TriggerType.ts +++ b/src/api/types/TriggerType.ts @@ -20,7 +20,8 @@ export type TriggerType = | "collection_item_created" | "collection_item_changed" | "collection_item_deleted" - | "collection_item_unpublished"; + | "collection_item_unpublished" + | "comment_created"; export const TriggerType = { FormSubmission: "form_submission", @@ -38,4 +39,5 @@ export const TriggerType = { CollectionItemChanged: "collection_item_changed", CollectionItemDeleted: "collection_item_deleted", CollectionItemUnpublished: "collection_item_unpublished", + CommentCreated: "comment_created", } as const; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index d6442032..07c364a5 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -61,6 +61,16 @@ export * from "./BulkCollectionItemFieldData"; export * from "./BulkCollectionItem"; export * from "./CollectionItemPatchSingleFieldData"; 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 "./CommentReply"; +export * from "./CommentReplyListPagination"; +export * from "./CommentReplyList"; export * from "./PageSeo"; export * from "./PageOpenGraph"; export * from "./Page"; diff --git a/src/environments.ts b/src/environments.ts index fcea4017..84e3537b 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -2,8 +2,22 @@ * This file was auto-generated by Fern from our API Definition. */ +export interface WebflowEnvironmentUrls { + base: string; + dataApi: string; + contentDeliveryApi: string; + production: string; + cdn: string; +} + export const WebflowEnvironment = { - Default: "https://api.webflow.com/v2", + DataApi: { + base: "https://api.webflow.com/v2", + dataApi: "https://api.webflow.com/v2", + contentDeliveryApi: "https://api-cdn.webflow.com/v2", + production: "https://api.webflow.com/v2", + cdn: "https://api-cdn.webflow.com/v2", + }, } as const; -export type WebflowEnvironment = typeof WebflowEnvironment.Default; +export type WebflowEnvironment = typeof WebflowEnvironment.DataApi; 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 cb601ac2..8977f03a 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts @@ -11,11 +11,11 @@ export const ItemsDeleteItemsLiveRequest: core.serialization.Schema< serializers.collections.ItemsDeleteItemsLiveRequest.Raw, Webflow.collections.ItemsDeleteItemsLiveRequest > = core.serialization.object({ - items: core.serialization.list(ItemsDeleteItemsLiveRequestItemsItem).optional(), + items: core.serialization.list(ItemsDeleteItemsLiveRequestItemsItem), }); export declare namespace ItemsDeleteItemsLiveRequest { interface Raw { - items?: ItemsDeleteItemsLiveRequestItemsItem.Raw[] | null; + items: ItemsDeleteItemsLiveRequestItemsItem.Raw[]; } } 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 28d2785c..19db962e 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts @@ -11,11 +11,11 @@ export const ItemsDeleteItemsRequest: core.serialization.Schema< serializers.collections.ItemsDeleteItemsRequest.Raw, Webflow.collections.ItemsDeleteItemsRequest > = core.serialization.object({ - items: core.serialization.list(ItemsDeleteItemsRequestItemsItem).optional(), + items: core.serialization.list(ItemsDeleteItemsRequestItemsItem), }); export declare namespace ItemsDeleteItemsRequest { interface Raw { - items?: ItemsDeleteItemsRequestItemsItem.Raw[] | null; + items: ItemsDeleteItemsRequestItemsItem.Raw[]; } } diff --git a/src/serialization/resources/products/client/requests/ProductSkuCreate.ts b/src/serialization/resources/products/client/requests/ProductSkuCreate.ts index 48fee055..27e7b36e 100644 --- a/src/serialization/resources/products/client/requests/ProductSkuCreate.ts +++ b/src/serialization/resources/products/client/requests/ProductSkuCreate.ts @@ -6,20 +6,20 @@ import * as serializers from "../../../../index"; import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; import { PublishStatus } from "../../../../types/PublishStatus"; -import { Product } from "../../../../types/Product"; -import { Sku } from "../../../../types/Sku"; +import { ProductSkuCreateProduct } from "../../types/ProductSkuCreateProduct"; +import { ProductSkuCreateSku } from "../../types/ProductSkuCreateSku"; export const ProductSkuCreate: core.serialization.Schema = core.serialization.object({ publishStatus: PublishStatus.optional(), - product: Product.optional(), - sku: Sku.optional(), + product: ProductSkuCreateProduct, + sku: ProductSkuCreateSku, }); export declare namespace ProductSkuCreate { interface Raw { publishStatus?: PublishStatus.Raw | null; - product?: Product.Raw | null; - sku?: Sku.Raw | null; + product: ProductSkuCreateProduct.Raw; + sku: ProductSkuCreateSku.Raw; } } diff --git a/src/serialization/resources/products/types/ProductSkuCreateProduct.ts b/src/serialization/resources/products/types/ProductSkuCreateProduct.ts new file mode 100644 index 00000000..8e6003b8 --- /dev/null +++ b/src/serialization/resources/products/types/ProductSkuCreateProduct.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; +import * as core from "../../../../core"; +import { ProductFieldData } from "../../../types/ProductFieldData"; + +export const ProductSkuCreateProduct: core.serialization.ObjectSchema< + serializers.ProductSkuCreateProduct.Raw, + Webflow.ProductSkuCreateProduct +> = core.serialization.object({ + fieldData: ProductFieldData.optional(), +}); + +export declare namespace ProductSkuCreateProduct { + interface Raw { + fieldData?: ProductFieldData.Raw | null; + } +} diff --git a/src/serialization/resources/products/types/ProductSkuCreateSku.ts b/src/serialization/resources/products/types/ProductSkuCreateSku.ts new file mode 100644 index 00000000..7a2e3082 --- /dev/null +++ b/src/serialization/resources/products/types/ProductSkuCreateSku.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; +import * as core from "../../../../core"; +import { SkuFieldData } from "../../../types/SkuFieldData"; + +export const ProductSkuCreateSku: core.serialization.ObjectSchema< + serializers.ProductSkuCreateSku.Raw, + Webflow.ProductSkuCreateSku +> = core.serialization.object({ + fieldData: SkuFieldData.optional(), +}); + +export declare namespace ProductSkuCreateSku { + interface Raw { + fieldData?: SkuFieldData.Raw | null; + } +} diff --git a/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts b/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts index 4ca5e4a7..c92b5e4e 100644 --- a/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts +++ b/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts @@ -11,11 +11,11 @@ export const ProductsCreateSkuResponse: core.serialization.ObjectSchema< serializers.ProductsCreateSkuResponse.Raw, Webflow.ProductsCreateSkuResponse > = core.serialization.object({ - skus: core.serialization.list(Sku).optional(), + skus: core.serialization.list(Sku), }); export declare namespace ProductsCreateSkuResponse { interface Raw { - skus?: Sku.Raw[] | null; + skus: Sku.Raw[]; } } diff --git a/src/serialization/resources/products/types/index.ts b/src/serialization/resources/products/types/index.ts index e286df49..61d70f8d 100644 --- a/src/serialization/resources/products/types/index.ts +++ b/src/serialization/resources/products/types/index.ts @@ -1 +1,3 @@ +export * from "./ProductSkuCreateProduct"; +export * from "./ProductSkuCreateSku"; export * from "./ProductsCreateSkuResponse"; diff --git a/src/serialization/resources/sites/index.ts b/src/serialization/resources/sites/index.ts index c9240f83..a931b363 100644 --- a/src/serialization/resources/sites/index.ts +++ b/src/serialization/resources/sites/index.ts @@ -1,2 +1,3 @@ export * from "./types"; +export * from "./resources"; export * from "./client"; diff --git a/src/serialization/resources/sites/resources/comments/index.ts b/src/serialization/resources/sites/resources/comments/index.ts new file mode 100644 index 00000000..eea524d6 --- /dev/null +++ b/src/serialization/resources/sites/resources/comments/index.ts @@ -0,0 +1 @@ +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 new file mode 100644 index 00000000..65c623fa --- /dev/null +++ b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const CommentsGetCommentThreadRequestSortBy: core.serialization.Schema< + serializers.sites.CommentsGetCommentThreadRequestSortBy.Raw, + Webflow.sites.CommentsGetCommentThreadRequestSortBy +> = core.serialization.enum_(["createdOn", "lastUpdated"]); + +export declare namespace CommentsGetCommentThreadRequestSortBy { + type Raw = "createdOn" | "lastUpdated"; +} diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts new file mode 100644 index 00000000..48f607bb --- /dev/null +++ b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const CommentsGetCommentThreadRequestSortOrder: core.serialization.Schema< + serializers.sites.CommentsGetCommentThreadRequestSortOrder.Raw, + Webflow.sites.CommentsGetCommentThreadRequestSortOrder +> = core.serialization.enum_(["asc", "desc"]); + +export declare namespace CommentsGetCommentThreadRequestSortOrder { + type Raw = "asc" | "desc"; +} diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts new file mode 100644 index 00000000..1e2133d3 --- /dev/null +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const CommentsListCommentRepliesRequestSortBy: core.serialization.Schema< + serializers.sites.CommentsListCommentRepliesRequestSortBy.Raw, + Webflow.sites.CommentsListCommentRepliesRequestSortBy +> = core.serialization.enum_(["createdOn", "lastUpdated"]); + +export declare namespace CommentsListCommentRepliesRequestSortBy { + type Raw = "createdOn" | "lastUpdated"; +} diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts new file mode 100644 index 00000000..68233b45 --- /dev/null +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const CommentsListCommentRepliesRequestSortOrder: core.serialization.Schema< + serializers.sites.CommentsListCommentRepliesRequestSortOrder.Raw, + Webflow.sites.CommentsListCommentRepliesRequestSortOrder +> = core.serialization.enum_(["asc", "desc"]); + +export declare namespace CommentsListCommentRepliesRequestSortOrder { + type Raw = "asc" | "desc"; +} diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts new file mode 100644 index 00000000..4671c2ee --- /dev/null +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const CommentsListCommentThreadsRequestSortBy: core.serialization.Schema< + serializers.sites.CommentsListCommentThreadsRequestSortBy.Raw, + Webflow.sites.CommentsListCommentThreadsRequestSortBy +> = core.serialization.enum_(["createdOn", "lastUpdated"]); + +export declare namespace CommentsListCommentThreadsRequestSortBy { + type Raw = "createdOn" | "lastUpdated"; +} diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts new file mode 100644 index 00000000..f978dba3 --- /dev/null +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const CommentsListCommentThreadsRequestSortOrder: core.serialization.Schema< + serializers.sites.CommentsListCommentThreadsRequestSortOrder.Raw, + Webflow.sites.CommentsListCommentThreadsRequestSortOrder +> = core.serialization.enum_(["asc", "desc"]); + +export declare namespace CommentsListCommentThreadsRequestSortOrder { + type Raw = "asc" | "desc"; +} diff --git a/src/serialization/resources/sites/resources/comments/types/index.ts b/src/serialization/resources/sites/resources/comments/types/index.ts new file mode 100644 index 00000000..0d2c5090 --- /dev/null +++ b/src/serialization/resources/sites/resources/comments/types/index.ts @@ -0,0 +1,6 @@ +export * from "./CommentsListCommentThreadsRequestSortBy"; +export * from "./CommentsListCommentThreadsRequestSortOrder"; +export * from "./CommentsGetCommentThreadRequestSortBy"; +export * from "./CommentsGetCommentThreadRequestSortOrder"; +export * from "./CommentsListCommentRepliesRequestSortBy"; +export * from "./CommentsListCommentRepliesRequestSortOrder"; diff --git a/src/serialization/resources/sites/resources/index.ts b/src/serialization/resources/sites/resources/index.ts new file mode 100644 index 00000000..134f72ad --- /dev/null +++ b/src/serialization/resources/sites/resources/index.ts @@ -0,0 +1,5 @@ +export * as wellKnown from "./wellKnown"; +export * from "./wellKnown/types"; +export * as comments from "./comments"; +export * from "./comments/types"; +export * from "./wellKnown/client/requests"; diff --git a/src/serialization/resources/sites/resources/wellKnown/client/index.ts b/src/serialization/resources/sites/resources/wellKnown/client/index.ts new file mode 100644 index 00000000..415726b7 --- /dev/null +++ b/src/serialization/resources/sites/resources/wellKnown/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts new file mode 100644 index 00000000..268f0571 --- /dev/null +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; +import * as core from "../../../../../../../core"; + +export const WellKnownDeleteRequest: core.serialization.Schema< + serializers.sites.WellKnownDeleteRequest.Raw, + Webflow.sites.WellKnownDeleteRequest +> = core.serialization.object({ + fileNames: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace WellKnownDeleteRequest { + interface Raw { + fileNames?: string[] | null; + } +} diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts new file mode 100644 index 00000000..c26ad88f --- /dev/null +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; +import * as core from "../../../../../../../core"; +import { WellKnownFileContentType } from "../../types/WellKnownFileContentType"; + +export const WellKnownFile: core.serialization.Schema< + serializers.sites.WellKnownFile.Raw, + Webflow.sites.WellKnownFile +> = core.serialization.object({ + fileName: core.serialization.string(), + fileData: core.serialization.string(), + contentType: WellKnownFileContentType.optional(), +}); + +export declare namespace WellKnownFile { + interface Raw { + fileName: string; + fileData: string; + contentType?: WellKnownFileContentType.Raw | null; + } +} diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts new file mode 100644 index 00000000..64acd63b --- /dev/null +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts @@ -0,0 +1,2 @@ +export { WellKnownFile } from "./WellKnownFile"; +export { WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; diff --git a/src/serialization/resources/sites/resources/wellKnown/index.ts b/src/serialization/resources/sites/resources/wellKnown/index.ts new file mode 100644 index 00000000..c9240f83 --- /dev/null +++ b/src/serialization/resources/sites/resources/wellKnown/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts b/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts new file mode 100644 index 00000000..293cc580 --- /dev/null +++ b/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const WellKnownFileContentType: core.serialization.Schema< + serializers.sites.WellKnownFileContentType.Raw, + Webflow.sites.WellKnownFileContentType +> = core.serialization.enum_(["application/json", "text/plain"]); + +export declare namespace WellKnownFileContentType { + type Raw = "application/json" | "text/plain"; +} diff --git a/src/serialization/resources/sites/resources/wellKnown/types/index.ts b/src/serialization/resources/sites/resources/wellKnown/types/index.ts new file mode 100644 index 00000000..e9347565 --- /dev/null +++ b/src/serialization/resources/sites/resources/wellKnown/types/index.ts @@ -0,0 +1 @@ +export * from "./WellKnownFileContentType"; diff --git a/src/serialization/types/Asset.ts b/src/serialization/types/Asset.ts index 12f39e6a..7a3f5c8d 100644 --- a/src/serialization/types/Asset.ts +++ b/src/serialization/types/Asset.ts @@ -8,31 +8,31 @@ import * as core from "../../core"; import { AssetVariant } from "./AssetVariant"; export const Asset: core.serialization.ObjectSchema = core.serialization.object({ - id: core.serialization.string().optional(), - contentType: core.serialization.string().optional(), - size: core.serialization.number().optional(), - siteId: core.serialization.string().optional(), - hostedUrl: core.serialization.string().optional(), - originalFileName: core.serialization.string().optional(), - displayName: core.serialization.string().optional(), - lastUpdated: core.serialization.date().optional(), - createdOn: core.serialization.date().optional(), - variants: core.serialization.list(AssetVariant).optional(), + id: core.serialization.string(), + contentType: core.serialization.string(), + size: core.serialization.number(), + siteId: core.serialization.string(), + hostedUrl: core.serialization.string(), + originalFileName: core.serialization.string(), + displayName: core.serialization.string(), + lastUpdated: core.serialization.date(), + createdOn: core.serialization.date(), + variants: core.serialization.list(AssetVariant), altText: core.serialization.string().optional(), }); export declare namespace Asset { interface Raw { - id?: string | null; - contentType?: string | null; - size?: number | null; - siteId?: string | null; - hostedUrl?: string | null; - originalFileName?: string | null; - displayName?: string | null; - lastUpdated?: string | null; - createdOn?: string | null; - variants?: AssetVariant.Raw[] | null; + id: string; + contentType: string; + size: number; + siteId: string; + hostedUrl: string; + originalFileName: string; + displayName: string; + lastUpdated: string; + createdOn: string; + variants: AssetVariant.Raw[]; altText?: string | null; } } diff --git a/src/serialization/types/AssetVariant.ts b/src/serialization/types/AssetVariant.ts index 094173b7..64b5f71a 100644 --- a/src/serialization/types/AssetVariant.ts +++ b/src/serialization/types/AssetVariant.ts @@ -8,25 +8,25 @@ import * as core from "../../core"; export const AssetVariant: core.serialization.ObjectSchema = core.serialization.object({ - hostedUrl: core.serialization.string().optional(), - originalFileName: core.serialization.string().optional(), - displayName: core.serialization.string().optional(), - format: core.serialization.string().optional(), - width: core.serialization.number().optional(), - height: core.serialization.number().optional(), - quality: core.serialization.number().optional(), + hostedUrl: core.serialization.string(), + originalFileName: core.serialization.string(), + displayName: core.serialization.string(), + format: core.serialization.string(), + width: core.serialization.number(), + height: core.serialization.number(), + quality: core.serialization.number(), error: core.serialization.string().optional(), }); export declare namespace AssetVariant { interface Raw { - hostedUrl?: string | null; - originalFileName?: string | null; - displayName?: string | null; - format?: string | null; - width?: number | null; - height?: number | null; - quality?: number | null; + hostedUrl: string; + originalFileName: string; + displayName: string; + format: string; + width: number; + height: number; + quality: number; error?: string | null; } } diff --git a/src/serialization/types/Collection.ts b/src/serialization/types/Collection.ts index 5e5b5e66..fd55335c 100644 --- a/src/serialization/types/Collection.ts +++ b/src/serialization/types/Collection.ts @@ -10,8 +10,8 @@ import { Field } from "./Field"; export const Collection: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string(), - displayName: core.serialization.string().optional(), - singularName: core.serialization.string().optional(), + displayName: core.serialization.string(), + singularName: core.serialization.string(), slug: core.serialization.string().optional(), createdOn: core.serialization.date().optional(), lastUpdated: core.serialization.date().optional(), @@ -21,8 +21,8 @@ export const Collection: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + commentId: core.serialization.string(), + siteId: core.serialization.string(), + pageId: core.serialization.string(), + localeId: core.serialization.string().optional(), + breakpoint: core.serialization.string(), + content: core.serialization.string(), + isResolved: core.serialization.boolean(), + author: CommentReplyAuthor, + mentionedUsers: core.serialization.list(CommentReplyMentionedUsersItem).optional(), + lastUpdated: core.serialization.string(), + createdOn: core.serialization.string(), + }); + +export declare namespace CommentReply { + interface Raw { + id: string; + commentId: string; + siteId: string; + pageId: string; + localeId?: string | null; + breakpoint: string; + content: string; + isResolved: boolean; + author: CommentReplyAuthor.Raw; + mentionedUsers?: CommentReplyMentionedUsersItem.Raw[] | null; + lastUpdated: string; + createdOn: string; + } +} diff --git a/src/serialization/types/CommentReplyAuthor.ts b/src/serialization/types/CommentReplyAuthor.ts new file mode 100644 index 00000000..43c33b43 --- /dev/null +++ b/src/serialization/types/CommentReplyAuthor.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const CommentReplyAuthor: core.serialization.ObjectSchema< + serializers.CommentReplyAuthor.Raw, + Webflow.CommentReplyAuthor +> = core.serialization.object({ + id: core.serialization.string(), + email: core.serialization.string(), + name: core.serialization.string(), +}); + +export declare namespace CommentReplyAuthor { + interface Raw { + id: string; + email: string; + name: string; + } +} diff --git a/src/serialization/types/CommentReplyList.ts b/src/serialization/types/CommentReplyList.ts new file mode 100644 index 00000000..114fd508 --- /dev/null +++ b/src/serialization/types/CommentReplyList.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { CommentReply } from "./CommentReply"; +import { CommentReplyListPagination } from "./CommentReplyListPagination"; + +export const CommentReplyList: core.serialization.ObjectSchema< + serializers.CommentReplyList.Raw, + Webflow.CommentReplyList +> = core.serialization.object({ + comments: core.serialization.list(CommentReply), + pagination: CommentReplyListPagination, +}); + +export declare namespace CommentReplyList { + interface Raw { + comments: CommentReply.Raw[]; + pagination: CommentReplyListPagination.Raw; + } +} diff --git a/src/serialization/types/CommentReplyListPagination.ts b/src/serialization/types/CommentReplyListPagination.ts new file mode 100644 index 00000000..86ed8d08 --- /dev/null +++ b/src/serialization/types/CommentReplyListPagination.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const CommentReplyListPagination: core.serialization.ObjectSchema< + serializers.CommentReplyListPagination.Raw, + Webflow.CommentReplyListPagination +> = core.serialization.object({ + limit: core.serialization.number(), + offset: core.serialization.number(), + total: core.serialization.number(), +}); + +export declare namespace CommentReplyListPagination { + interface Raw { + limit: number; + offset: number; + total: number; + } +} diff --git a/src/serialization/types/CommentReplyMentionedUsersItem.ts b/src/serialization/types/CommentReplyMentionedUsersItem.ts new file mode 100644 index 00000000..d08e20e5 --- /dev/null +++ b/src/serialization/types/CommentReplyMentionedUsersItem.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const CommentReplyMentionedUsersItem: core.serialization.ObjectSchema< + serializers.CommentReplyMentionedUsersItem.Raw, + Webflow.CommentReplyMentionedUsersItem +> = core.serialization.object({ + id: core.serialization.string(), + email: core.serialization.string(), + name: core.serialization.string(), +}); + +export declare namespace CommentReplyMentionedUsersItem { + interface Raw { + id: string; + email: string; + name: string; + } +} diff --git a/src/serialization/types/CommentThread.ts b/src/serialization/types/CommentThread.ts new file mode 100644 index 00000000..636bcc25 --- /dev/null +++ b/src/serialization/types/CommentThread.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { CommentThreadAuthor } from "./CommentThreadAuthor"; +import { CommentThreadMentionedUsersItem } from "./CommentThreadMentionedUsersItem"; + +export const CommentThread: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + siteId: core.serialization.string(), + pageId: core.serialization.string(), + localeId: core.serialization.string().optional(), + itemId: core.serialization.string().optional(), + breakpoint: core.serialization.string(), + url: core.serialization.string(), + content: core.serialization.string(), + isResolved: core.serialization.boolean(), + author: CommentThreadAuthor, + mentionedUsers: core.serialization.list(CommentThreadMentionedUsersItem), + createdOn: core.serialization.string(), + lastUpdated: core.serialization.string(), + }); + +export declare namespace CommentThread { + interface Raw { + id: string; + siteId: string; + pageId: string; + localeId?: string | null; + itemId?: string | null; + breakpoint: string; + url: string; + content: string; + isResolved: boolean; + author: CommentThreadAuthor.Raw; + mentionedUsers: CommentThreadMentionedUsersItem.Raw[]; + createdOn: string; + lastUpdated: string; + } +} diff --git a/src/serialization/types/CommentThreadAuthor.ts b/src/serialization/types/CommentThreadAuthor.ts new file mode 100644 index 00000000..0b876243 --- /dev/null +++ b/src/serialization/types/CommentThreadAuthor.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const CommentThreadAuthor: core.serialization.ObjectSchema< + serializers.CommentThreadAuthor.Raw, + Webflow.CommentThreadAuthor +> = core.serialization.object({ + userId: core.serialization.string(), + email: core.serialization.string(), + name: core.serialization.string(), +}); + +export declare namespace CommentThreadAuthor { + interface Raw { + userId: string; + email: string; + name: string; + } +} diff --git a/src/serialization/types/CommentThreadList.ts b/src/serialization/types/CommentThreadList.ts new file mode 100644 index 00000000..20858bb6 --- /dev/null +++ b/src/serialization/types/CommentThreadList.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { CommentThread } from "./CommentThread"; +import { CommentThreadListPagination } from "./CommentThreadListPagination"; + +export const CommentThreadList: core.serialization.ObjectSchema< + serializers.CommentThreadList.Raw, + Webflow.CommentThreadList +> = core.serialization.object({ + comments: core.serialization.list(CommentThread), + pagination: CommentThreadListPagination, +}); + +export declare namespace CommentThreadList { + interface Raw { + comments: CommentThread.Raw[]; + pagination: CommentThreadListPagination.Raw; + } +} diff --git a/src/serialization/types/CommentThreadListPagination.ts b/src/serialization/types/CommentThreadListPagination.ts new file mode 100644 index 00000000..83f463ed --- /dev/null +++ b/src/serialization/types/CommentThreadListPagination.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const CommentThreadListPagination: core.serialization.ObjectSchema< + serializers.CommentThreadListPagination.Raw, + Webflow.CommentThreadListPagination +> = core.serialization.object({ + limit: core.serialization.number(), + offset: core.serialization.number(), + total: core.serialization.number(), +}); + +export declare namespace CommentThreadListPagination { + interface Raw { + limit: number; + offset: number; + total: number; + } +} diff --git a/src/serialization/types/CommentThreadMentionedUsersItem.ts b/src/serialization/types/CommentThreadMentionedUsersItem.ts new file mode 100644 index 00000000..2eabece3 --- /dev/null +++ b/src/serialization/types/CommentThreadMentionedUsersItem.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const CommentThreadMentionedUsersItem: core.serialization.ObjectSchema< + serializers.CommentThreadMentionedUsersItem.Raw, + Webflow.CommentThreadMentionedUsersItem +> = core.serialization.object({ + userId: core.serialization.string(), + email: core.serialization.string(), + name: core.serialization.string(), +}); + +export declare namespace CommentThreadMentionedUsersItem { + interface Raw { + userId: string; + email: string; + name: string; + } +} diff --git a/src/serialization/types/ComponentNode.ts b/src/serialization/types/ComponentNode.ts index 4118e39d..41f7160c 100644 --- a/src/serialization/types/ComponentNode.ts +++ b/src/serialization/types/ComponentNode.ts @@ -9,15 +9,15 @@ import { ComponentProperty } from "./ComponentProperty"; export const ComponentNode: core.serialization.ObjectSchema = core.serialization.object({ - id: core.serialization.string().optional(), - componentId: core.serialization.string().optional(), - propertyOverrides: core.serialization.list(ComponentProperty).optional(), + id: core.serialization.string(), + componentId: core.serialization.string(), + propertyOverrides: core.serialization.list(ComponentProperty), }); export declare namespace ComponentNode { interface Raw { - id?: string | null; - componentId?: string | null; - propertyOverrides?: ComponentProperty.Raw[] | null; + id: string; + componentId: string; + propertyOverrides: ComponentProperty.Raw[]; } } diff --git a/src/serialization/types/FieldType.ts b/src/serialization/types/FieldType.ts index 57d06f96..368daa41 100644 --- a/src/serialization/types/FieldType.ts +++ b/src/serialization/types/FieldType.ts @@ -12,17 +12,19 @@ export const FieldType: core.serialization.Schema = core.serialization.object({ - id: core.serialization.string().optional(), - image: ImageNodeImage.optional(), + id: core.serialization.string(), + image: ImageNodeImage, attributes: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), }); export declare namespace ImageNode { interface Raw { - id?: string | null; - image?: ImageNodeImage.Raw | null; + id: string; + image: ImageNodeImage.Raw; attributes?: Record | null; } } diff --git a/src/serialization/types/Pagination.ts b/src/serialization/types/Pagination.ts index 4d81b8f8..cd186256 100644 --- a/src/serialization/types/Pagination.ts +++ b/src/serialization/types/Pagination.ts @@ -8,15 +8,15 @@ import * as core from "../../core"; export const Pagination: core.serialization.ObjectSchema = core.serialization.object({ - limit: core.serialization.number().optional(), - offset: core.serialization.number().optional(), - total: core.serialization.number().optional(), + limit: core.serialization.number(), + offset: core.serialization.number(), + total: core.serialization.number(), }); export declare namespace Pagination { interface Raw { - limit?: number | null; - offset?: number | null; - total?: number | null; + limit: number; + offset: number; + total: number; } } diff --git a/src/serialization/types/SkuFieldData.ts b/src/serialization/types/SkuFieldData.ts index 4bd54836..6c789187 100644 --- a/src/serialization/types/SkuFieldData.ts +++ b/src/serialization/types/SkuFieldData.ts @@ -10,6 +10,7 @@ import { SkuFieldDataPrice } from "./SkuFieldDataPrice"; import { SkuFieldDataCompareAtPrice } from "./SkuFieldDataCompareAtPrice"; import { SkuFieldDataEcSkuBillingMethod } from "./SkuFieldDataEcSkuBillingMethod"; import { SkuFieldDataEcSkuSubscriptionPlan } from "./SkuFieldDataEcSkuSubscriptionPlan"; +import { SkuPropertyList } from "./SkuPropertyList"; export const SkuFieldData: core.serialization.ObjectSchema = core.serialization.object({ @@ -28,6 +29,12 @@ export const SkuFieldData: core.serialization.ObjectSchema = core.serialization.object({ value: core.serialization.number().optional(), unit: core.serialization.string().optional(), + currency: core.serialization.string().optional(), }); export declare namespace SkuFieldDataPrice { interface Raw { value?: number | null; unit?: string | null; + currency?: string | null; } } diff --git a/src/serialization/types/StaticFieldType.ts b/src/serialization/types/StaticFieldType.ts index 642b3abc..30e9710a 100644 --- a/src/serialization/types/StaticFieldType.ts +++ b/src/serialization/types/StaticFieldType.ts @@ -20,7 +20,7 @@ export const StaticFieldType: core.serialization.Schema = core.serialization.object({ - id: core.serialization.string().optional(), - text: TextNodeText.optional(), + id: core.serialization.string(), + text: TextNodeText, attributes: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), }); export declare namespace TextNode { interface Raw { - id?: string | null; - text?: TextNodeText.Raw | null; + id: string; + text: TextNodeText.Raw; attributes?: Record | null; } } diff --git a/src/serialization/types/TriggerType.ts b/src/serialization/types/TriggerType.ts index b6411437..671583db 100644 --- a/src/serialization/types/TriggerType.ts +++ b/src/serialization/types/TriggerType.ts @@ -23,6 +23,7 @@ export const TriggerType: core.serialization.Schema