diff --git a/.mock/definition/assets.yml b/.mock/definition/assets.yml index 73c7559c..8c142ae3 100644 --- a/.mock/definition/assets.yml +++ b/.mock/definition/assets.yml @@ -242,6 +242,7 @@ service: width: 500 height: 900 quality: 100 + error: error altText: A single candy wrapper delete: path: /assets/{asset_id} @@ -335,6 +336,7 @@ service: width: 500 height: 900 quality: 100 + error: error altText: A single candy wrapper list-folders: path: /sites/{site_id}/asset_folders @@ -371,6 +373,7 @@ service: assetFolders: - id: 6390c49774a71f0e3c1a08ee displayName: emoji icons + parentFolder: 6390c49774a71f99f21a08eb assets: - 63e5889e7fe4eafa7384cea4 - 659595234426a9fcbad57043 diff --git a/.mock/definition/collections.yml b/.mock/definition/collections.yml index 5ddf39bb..b9ee7cd1 100644 --- a/.mock/definition/collections.yml +++ b/.mock/definition/collections.yml @@ -303,18 +303,21 @@ service: type: File slug: guide-file displayName: Guide File + helpText: helpText - id: 7f8e9d0c1b2a3f4e5d6c8b9e isRequired: false isEditable: true type: Email slug: contributor-email displayName: Contributor Email + helpText: helpText - id: 3a4f5e6d7c8b9a0e1d2c4b5f isRequired: false isEditable: true type: Phone slug: emergency-contact displayName: Emergency Contact + helpText: helpText delete: path: /collections/{collection_id} method: DELETE diff --git a/.mock/definition/comments.yml b/.mock/definition/comments.yml index 91de1be8..573e375e 100644 --- a/.mock/definition/comments.yml +++ b/.mock/definition/comments.yml @@ -17,6 +17,7 @@ webhooks: siteId: 679826b3b20b045e176bc4b5 pageId: 679826b3b20b045e176bc4bc localeId: 67993753d910db250db64b3e + itemId: 580e64008c9a982ac9b8b754 breakpoint: main url: >- https://webflow.com/design/site-slug-4ec832?workflow=comment&commentId=679d2ddb5196117ad04d1ffa&pageId=679826b3b20b045e176bc4bc diff --git a/.mock/definition/components.yml b/.mock/definition/components.yml index 6a8a0077..9bca51f3 100644 --- a/.mock/definition/components.yml +++ b/.mock/definition/components.yml @@ -69,9 +69,13 @@ service: readonly: true - id: 6258612d1ee792848f805dcf name: Card + group: Buttons + description: A button component that can be used across the site readonly: true - id: 68a2b1d1ee792848f805dcf name: Nav + group: Buttons + description: A button component that can be used across the site readonly: true pagination: limit: 20 diff --git a/.mock/definition/forms.yml b/.mock/definition/forms.yml index 44592f7d..4dedf935 100644 --- a/.mock/definition/forms.yml +++ b/.mock/definition/forms.yml @@ -59,13 +59,16 @@ service: fields: '0': displayName: Email + placeholder: Enter your email userVisible: true '1': displayName: Email + placeholder: Enter your email userVisible: true responseSettings: redirectUrl: https://example.com redirectMethod: GET + redirectAction: POST https://example.com sendEmailConfirmation: true id: 589a331aa51e760df7ccb89e siteId: 580e63e98c9a982ac9b8b741 @@ -80,10 +83,12 @@ service: fields: '0': displayName: Email + placeholder: Enter your email userVisible: true responseSettings: redirectUrl: https://example.com redirectMethod: GET + redirectAction: POST https://example.com sendEmailConfirmation: false id: 580ff8d7ba3e45ba9fe588e9 siteId: 580e63e98c9a982ac9b8b741 @@ -136,6 +141,7 @@ service: 660d5bcc9c0772150459dfb1: displayName: Name type: Plain + placeholder: Enter your email userVisible: true 589a331aa51e760df7ccb89d: displayName: Email @@ -145,6 +151,7 @@ service: responseSettings: redirectUrl: https://example.com redirectMethod: GET + redirectAction: POST https://example.com sendEmailConfirmation: true id: 589a331aa51e760df7ccb89e siteId: 580e63e98c9a982ac9b8b741 @@ -430,6 +437,212 @@ service: limit: 25 offset: 0 total: 2 + list-submissions-by-form-and-site: + path: /sites/{site_id}/forms/{form_id}/submissions + method: GET + auth: + - OAuth2: + - forms:read + docs: | + List form submissions for a given form within a specific site. + + Required scope | `forms:read` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + form_id: + type: string + docs: Unique identifier for a Form + display-name: List Form Submissions by Form and Site + request: + name: FormsListSubmissionsByFormAndSiteRequest + query-parameters: + 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)' + response: + docs: Request was successful + type: root.FormSubmissionList + status-code: 200 + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + form_id: 580e63e98c9a982ac9b8b741 + query-parameters: + offset: 1.1 + limit: 1.1 + response: + body: + formSubmissions: + - id: 6321ca84df3949bfc6752327 + displayName: Sample Form + siteId: 62749158efef318abc8d5a0f + workspaceId: 62749158efef318abc8d5a0f + dateSubmitted: '2022-09-14T12:35:16Z' + formResponse: + First Name: Arthur + Last Name: Dent + - id: 660d64fabf6e0a0d4edab981 + displayName: Sample Form + siteId: 62749158efef318abc8d5a0f + workspaceId: 62749158efef318abc8d5a0f + dateSubmitted: '2022-09-14T12:35:16Z' + formResponse: + First Name: Ford + Last Name: Prefect + pagination: + limit: 25 + offset: 0 + total: 2 + get-submission-by-site: + path: /sites/{site_id}/form_submissions/{form_submission_id} + method: GET + auth: + - OAuth2: + - forms:read + docs: | + Get information about a form submission within a specific site. + + Required scope | `forms:read` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + form_submission_id: + type: string + docs: Unique identifier for a Form Submission + display-name: Get Form Submission by Site + response: + docs: Request was successful + type: root.FormSubmission + status-code: 200 + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + form_submission_id: 580e63e98c9a982ac9b8b741 + response: + body: + id: 6321ca84df3949bfc6752327 + displayName: Sample Form + siteId: 62749158efef318abc8d5a0f + workspaceId: 62749158efef318abc8d5a0f + dateSubmitted: '2022-09-14T12:35:16Z' + formResponse: + First Name: Arthur + Last Name: Dent + delete-submission-by-site: + path: /sites/{site_id}/form_submissions/{form_submission_id} + method: DELETE + auth: + - OAuth2: + - forms:write + docs: | + Delete a form submission within a specific site. + + Required scope | `forms:write` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + form_submission_id: + type: string + docs: Unique identifier for a Form Submission + display-name: Delete Form Submission by Site + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + form_submission_id: 580e63e98c9a982ac9b8b741 + update-submission-by-site: + path: /sites/{site_id}/form_submissions/{form_submission_id} + method: PATCH + auth: + - OAuth2: + - forms:write + docs: | + Update hidden fields on a form submission within a specific site. + + Required scope | `forms:write` + source: + openapi: ../../../openapi/referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + form_submission_id: + type: string + docs: Unique identifier for a Form Submission + display-name: Modify Form Submission by Site + request: + name: FormsUpdateSubmissionBySiteRequest + body: + properties: + formSubmissionData: + type: optional> + docs: >- + An existing **hidden field** defined on the form schema, and the + corresponding value to set + content-type: application/json + response: + docs: Request was successful + type: root.FormSubmission + status-code: 200 + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + form_submission_id: 580e63e98c9a982ac9b8b741 + request: {} + response: + body: + id: 6321ca84df3949bfc6752327 + displayName: Sample Form + siteId: 62749158efef318abc8d5a0f + workspaceId: 62749158efef318abc8d5a0f + dateSubmitted: '2022-09-14T12:35:16Z' + formResponse: + First Name: Arthur + Last Name: Dent source: openapi: ../../../openapi/referenced-specs/v2.yml display-name: Forms diff --git a/.mock/definition/items.yml b/.mock/definition/items.yml index f65b6d7b..634f1f75 100644 --- a/.mock/definition/items.yml +++ b/.mock/definition/items.yml @@ -83,6 +83,7 @@ webhooks: siteId: 65427cf400e02b306eaa049c workspaceId: 625860a7a6c16d624927122f collectionId: 664243617fcc8b464b23c4ee + cmsLocaleId: 681442a144bb80bd00480fda docs: Information about a collection item that was published collection_item_unpublished: audiences: [] diff --git a/.mock/definition/orders.yml b/.mock/definition/orders.yml index 0eeeabde..82affd79 100644 --- a/.mock/definition/orders.yml +++ b/.mock/definition/orders.yml @@ -88,6 +88,11 @@ service: Please gift wrap with a personal note saying "Happy Birthday, Ford! 🎉 acceptedOn: '2024-04-10T13:16:21Z' + fulfilledOn: '2018-12-03T22:06:15Z' + refundedOn: '2018-12-03T22:06:15Z' + disputedOn: '2018-12-03T22:06:15Z' + disputeUpdatedOn: '2018-12-03T22:06:15Z' + disputeLastStatus: warning_needs_response customerPaid: unit: USD value: '5892' @@ -187,15 +192,18 @@ service: unit: USD value: '5892' string: \$ 83.09 USD + weight: 5 width: 19 height: 72 length: 18 purchasedItemsCount: 3 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1P410gJYFi4lcbXWbeKghqjK paymentIntentId: pi_3P410iJYFi4lcbXW0EKKgcVg customerId: cus_Ptod8KJBiiPgnH chargeId: ch_3P410iJYFi4lcbXW0DxUkzCH + refundReason: requested_by_customer stripeCard: last4: '4242' brand: Visa @@ -203,6 +211,13 @@ service: expires: year: 2025 month: 4 + paypalDetails: + orderId: 1a2b3c4d5e6f7g8h9i0j + payerId: 9k8j7i6h5g4f3e2d1c0b + captureId: qwe123rty456uio789p + refundId: abcde12345fghij67890 + refundReason: Customer requested refund + disputeId: zxcvbnm987poiuytrewq customData: - key: value metadata: @@ -230,7 +245,11 @@ service: comment: Example comment to myself orderComment: '' acceptedOn: '2024-03-29T21:29:21Z' + fulfilledOn: '2018-12-03T22:06:15Z' refundedOn: '2024-04-08T18:25:04Z' + disputedOn: '2018-12-03T22:06:15Z' + disputeUpdatedOn: '2018-12-03T22:06:15Z' + disputeLastStatus: warning_needs_response customerPaid: unit: USD value: '5892' @@ -337,6 +356,7 @@ service: length: 40 purchasedItemsCount: 2 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft customerId: cus_PpRsNHwWdUoRKR @@ -350,6 +370,13 @@ service: expires: year: 2024 month: 4 + paypalDetails: + orderId: 1a2b3c4d5e6f7g8h9i0j + payerId: 9k8j7i6h5g4f3e2d1c0b + captureId: qwe123rty456uio789p + refundId: abcde12345fghij67890 + refundReason: Customer requested refund + disputeId: zxcvbnm987poiuytrewq customData: - key: value metadata: @@ -558,10 +585,12 @@ service: length: 40 purchasedItemsCount: 2 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft customerId: cus_PpRsNHwWdUoRKR chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + disputeId: disputeId refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk refundReason: fraudulent stripeCard: @@ -571,6 +600,13 @@ service: expires: year: 2024 month: 4 + paypalDetails: + orderId: 1a2b3c4d5e6f7g8h9i0j + payerId: 9k8j7i6h5g4f3e2d1c0b + captureId: qwe123rty456uio789p + refundId: abcde12345fghij67890 + refundReason: Customer requested refund + disputeId: zxcvbnm987poiuytrewq customData: - key: value metadata: @@ -794,10 +830,12 @@ service: length: 40 purchasedItemsCount: 2 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft customerId: cus_PpRsNHwWdUoRKR chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + disputeId: disputeId refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk refundReason: fraudulent stripeCard: @@ -807,6 +845,13 @@ service: expires: year: 2024 month: 4 + paypalDetails: + orderId: 1a2b3c4d5e6f7g8h9i0j + payerId: 9k8j7i6h5g4f3e2d1c0b + captureId: qwe123rty456uio789p + refundId: abcde12345fghij67890 + refundReason: Customer requested refund + disputeId: zxcvbnm987poiuytrewq customData: - key: value metadata: @@ -1020,10 +1065,12 @@ service: length: 40 purchasedItemsCount: 2 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft customerId: cus_PpRsNHwWdUoRKR chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + disputeId: disputeId refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk refundReason: fraudulent stripeCard: @@ -1033,6 +1080,13 @@ service: expires: year: 2024 month: 4 + paypalDetails: + orderId: 1a2b3c4d5e6f7g8h9i0j + payerId: 9k8j7i6h5g4f3e2d1c0b + captureId: qwe123rty456uio789p + refundId: abcde12345fghij67890 + refundReason: Customer requested refund + disputeId: zxcvbnm987poiuytrewq customData: - key: value metadata: @@ -1236,10 +1290,12 @@ service: length: 40 purchasedItemsCount: 2 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft customerId: cus_PpRsNHwWdUoRKR chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + disputeId: disputeId refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk refundReason: fraudulent stripeCard: @@ -1249,6 +1305,13 @@ service: expires: year: 2024 month: 4 + paypalDetails: + orderId: 1a2b3c4d5e6f7g8h9i0j + payerId: 9k8j7i6h5g4f3e2d1c0b + captureId: qwe123rty456uio789p + refundId: abcde12345fghij67890 + refundReason: Customer requested refund + disputeId: zxcvbnm987poiuytrewq customData: - key: value metadata: @@ -1462,10 +1525,12 @@ service: length: 40 purchasedItemsCount: 2 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft customerId: cus_PpRsNHwWdUoRKR chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + disputeId: disputeId refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk refundReason: fraudulent stripeCard: @@ -1475,6 +1540,13 @@ service: expires: year: 2024 month: 4 + paypalDetails: + orderId: 1a2b3c4d5e6f7g8h9i0j + payerId: 9k8j7i6h5g4f3e2d1c0b + captureId: qwe123rty456uio789p + refundId: abcde12345fghij67890 + refundReason: Customer requested refund + disputeId: zxcvbnm987poiuytrewq customData: - key: value metadata: @@ -1544,6 +1616,10 @@ webhooks: Please gift wrap with a personal note saying "Happy Birthday, Ford! 🎉 acceptedOn: '2024-03-29T21:29:21Z' + fulfilledOn: '2018-12-03T22:06:15Z' + refundedOn: '2018-12-03T22:06:15Z' + disputedOn: '2018-12-03T22:06:15Z' + disputeUpdatedOn: '2018-12-03T22:06:15Z' customerPaid: unit: USD value: '5892' @@ -1647,6 +1723,7 @@ webhooks: length: 40 purchasedItemsCount: 2 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft customerId: cus_PpRsNHwWdUoRKR @@ -1833,6 +1910,7 @@ webhooks: length: 40 purchasedItemsCount: 2 stripeDetails: + subscriptionId: sub_1J6xwG2eZvKYlo2CXu9Zt0Tn paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft customerId: cus_PpRsNHwWdUoRKR diff --git a/.mock/definition/pages.yml b/.mock/definition/pages.yml index 88b8aa21..a4f63b00 100644 --- a/.mock/definition/pages.yml +++ b/.mock/definition/pages.yml @@ -64,6 +64,8 @@ service: siteId: 6258612d1ee792848f805dcf title: Guide to the Galaxy slug: guide-to-the-galaxy + parentId: 6419db964a9c435aa3af6251 + collectionId: 6390c49774a71f12831a08e3 createdOn: '2024-03-11T10:42:00Z' lastUpdated: '2024-03-11T10:42:42Z' archived: false @@ -89,12 +91,15 @@ service: siteId: 6258612d1ee792848f805dcf title: Towel Day Celebrations slug: towel-day + parentId: 6419db964a9c435aa3af6251 + collectionId: 6390c49774a71f12831a08e3 createdOn: '2024-05-25T09:00:00Z' lastUpdated: '2024-05-25T09:42:00Z' archived: false draft: false canBranch: true isBranch: false + branchId: 68026fa68ef6dc744c75b833 seo: title: Celebrate Towel Day - The Hitchhiker's Guide to the Galaxy description: >- @@ -164,6 +169,8 @@ service: siteId: 6258612d1ee792848f805dcf title: Guide to the Galaxy slug: guide-to-the-galaxy + parentId: 6419db964a9c435aa3af6251 + collectionId: 6390c49774a71f12831a08e3 createdOn: '2024-03-11T10:42:00Z' lastUpdated: '2024-03-11T10:42:42Z' archived: false @@ -271,6 +278,8 @@ service: siteId: 6258612d1ee792848f805dcf title: Guide to the Galaxy slug: guide-to-the-galaxy + parentId: 6419db964a9c435aa3af6251 + collectionId: 6390c49774a71f12831a08e3 createdOn: '2024-03-11T10:42:00Z' lastUpdated: '2024-03-11T10:42:42Z' archived: false diff --git a/.mock/definition/scripts.yml b/.mock/definition/scripts.yml index 0989ace5..4ff0c7d9 100644 --- a/.mock/definition/scripts.yml +++ b/.mock/definition/scripts.yml @@ -48,6 +48,7 @@ service: canCopy: false displayName: Alert hostedLocation: https://cdn.webflow.io/.../alert-0.0.1.js + integrityHash: integrityHash createdOn: '2022-10-26T00:28:54.191Z' lastUpdated: lastUpdated version: 0.0.1 @@ -55,6 +56,7 @@ service: canCopy: false displayName: Alert hostedLocation: https://cdn.webflow.io/.../alert-0.0.2.js + integrityHash: integrityHash createdOn: '2022-10-26T00:28:54.191Z' lastUpdated: lastUpdated version: 0.0.2 @@ -225,6 +227,7 @@ service: displayName: Alert hostedLocation: >- https://uploads-ssl.webflow.com/6258612d1ee792848f805dcf%2F64b6c769ff52ba6c3d904a91%2F660d6e15b3d1696f2d2b1447%2Falert-0.0.1.js + integrityHash: integrityHash createdOn: '2022-10-26T00:28:54.191Z' lastUpdated: lastUpdated version: 0.0.1 diff --git a/.mock/definition/sites.yml b/.mock/definition/sites.yml index 052dbbc2..ebc7cd09 100644 --- a/.mock/definition/sites.yml +++ b/.mock/definition/sites.yml @@ -64,12 +64,34 @@ service: createdOn: '2024-10-15T20:24:38Z' displayName: The Hitchiker's Guide shortName: hitchikers-guide + lastPublished: '2016-10-24T19:43:17Z' lastUpdated: '2024-10-15T20:24:38Z' + previewUrl: >- + https://dev-assets.website-files.com/580e63e98c9a982ac9b8b741/201610241243.png + timeZone: America/Los_Angeles parentFolderId: 670ece123598db72d9648be1 customDomains: - id: 589a331aa51e760df7ccb89d url: test-api-domain.com lastPublished: '2022-12-07T16:51:37Z' + locales: + primary: + id: 653fd9af6a07fc9cfd7a5e57 + cmsLocaleId: 653ad57de882f528b32e810e + enabled: false + displayName: English (United States) + displayImageId: displayImageId + redirect: true + subdirectory: '' + tag: en-US + secondary: + - id: 653fd9af6a07fc9cfd7a5e57 + cmsLocaleId: 653ad57de882f528b32e810e + enabled: false + displayName: English (United States) + redirect: true + subdirectory: '' + tag: en-US dataCollectionEnabled: true dataCollectionType: always list: @@ -148,6 +170,7 @@ service: previewUrl: >- https://dev-assets.website-files.com/42e63e98c9a982ac9b8b742/198110121200.png timeZone: DeepSpace/Depression + parentFolderId: 1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6 customDomains: - id: 589a331aa51e760df7ccb89f url: marvin.blog @@ -181,6 +204,7 @@ service: previewUrl: >- https://dev-assets.website-files.com/42e63e98c9a982ac9b8b743/198210121200.png timeZone: Vogsphere/PoetryHall + parentFolderId: 1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6 customDomains: - id: 589a331aa51e760df7ccb8a0 url: vogonpoetry.galaxy diff --git a/.mock/definition/sites/activityLogs.yml b/.mock/definition/sites/activityLogs.yml index 88d0822f..fc8d76f3 100644 --- a/.mock/definition/sites/activityLogs.yml +++ b/.mock/definition/sites/activityLogs.yml @@ -65,6 +65,10 @@ service: displayName: John Doe resourceId: 654c16c7b229e56bcf26870c resourceName: foo-bar + newValue: newValue + previousValue: previousValue + payload: + key: value pagination: limit: 25 offset: 0 diff --git a/.mock/definition/sites/comments.yml b/.mock/definition/sites/comments.yml index ac8b3a2d..e2afdd16 100644 --- a/.mock/definition/sites/comments.yml +++ b/.mock/definition/sites/comments.yml @@ -115,6 +115,7 @@ service: siteId: 679826b3b20b045e176bc4b5 pageId: 679826b3b20b045e176bc4bc localeId: 67993753d910db250db64b3e + itemId: 580e64008c9a982ac9b8b754 breakpoint: main url: >- https://webflow.com/design/site-slug-4ec832?workflow=comment&commentId=679d2ddb5196117ad04d1ff8&pageId=679826b3b20b045e176bc4bc @@ -134,6 +135,7 @@ service: siteId: 679826b3b20b045e176bc4b5 pageId: 679826b3b20b045e176bc4bc localeId: 67993753d910db250db64b3e + itemId: 580e64008c9a982ac9b8b754 breakpoint: main url: >- https://webflow.com/design/site-slug-4ec832?workflow=comment&commentId=679d2ddb5196117ad04d1ff8&pageId=679826b3b20b045e176bc4bc diff --git a/.mock/definition/sites/scripts.yml b/.mock/definition/sites/scripts.yml index ed57238c..5128cef5 100644 --- a/.mock/definition/sites/scripts.yml +++ b/.mock/definition/sites/scripts.yml @@ -216,6 +216,7 @@ service: body: blocks: - siteId: 6258612d1ee792848f805dcf + pageId: pageId type: site scripts: - id: chartjs diff --git a/.mock/definition/webhooks.yml b/.mock/definition/webhooks.yml index 7fbd0795..46bbb023 100644 --- a/.mock/definition/webhooks.yml +++ b/.mock/definition/webhooks.yml @@ -117,6 +117,8 @@ service: url: https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f workspaceId: 4f4e46fd476ea8c507000001 siteId: 562ac0395358780a1f5e6fbd + filter: + name: My Form lastTriggered: '2023-02-08T23:59:28Z' createdOn: '2022-11-08T23:59:28Z' get: @@ -153,6 +155,8 @@ service: url: https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f workspaceId: 4f4e46fd476ea8c507000001 siteId: 562ac0395358780a1f5e6fbd + filter: + name: My Form lastTriggered: '2023-02-08T23:59:28Z' createdOn: '2022-11-08T23:59:28Z' delete: diff --git a/.mock/fern.config.json b/.mock/fern.config.json index a155416e..74f92a24 100644 --- a/.mock/fern.config.json +++ b/.mock/fern.config.json @@ -1,4 +1,4 @@ { "organization" : "webflow", - "version" : "0.101.3" + "version" : "0.108.0" } \ No newline at end of file diff --git a/package.json b/package.json index 59324ee6..46626bee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webflow-api", - "version": "3.2.1", + "version": "3.2.2", "private": false, "repository": "https://github.com/webflow/js-webflow-api", "main": "./index.js", @@ -35,7 +35,7 @@ "@types/jest": "^29.5.14", "ts-jest": "^29.3.4", "jest-environment-jsdom": "^29.7.0", - "msw": "2.11.2", + "msw": "^2.8.4", "@types/node": "^18.19.70", "prettier": "^3.4.2", "typescript": "~5.7.2", diff --git a/reference.md b/reference.md index d6d078e7..b4698ec3 100644 --- a/reference.md +++ b/reference.md @@ -3438,6 +3438,317 @@ await client.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", { +
client.forms.listSubmissionsByFormAndSite(siteId, formId, { ...params }) -> Webflow.FormSubmissionList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List form submissions for a given form within a specific site. + +Required scope | `forms:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.forms.listSubmissionsByFormAndSite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { + offset: 1.1, + limit: 1.1, +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**formId:** `string` — Unique identifier for a Form + +
+
+ +
+
+ +**request:** `Webflow.FormsListSubmissionsByFormAndSiteRequest` + +
+
+ +
+
+ +**requestOptions:** `Forms.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.forms.getSubmissionBySite(siteId, formSubmissionId) -> Webflow.FormSubmission +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get information about a form submission within a specific site. + +Required scope | `forms:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.forms.getSubmissionBySite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**formSubmissionId:** `string` — Unique identifier for a Form Submission + +
+
+ +
+
+ +**requestOptions:** `Forms.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.forms.deleteSubmissionBySite(siteId, formSubmissionId) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a form submission within a specific site. + +Required scope | `forms:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.forms.deleteSubmissionBySite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**formSubmissionId:** `string` — Unique identifier for a Form Submission + +
+
+ +
+
+ +**requestOptions:** `Forms.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.forms.updateSubmissionBySite(siteId, formSubmissionId, { ...params }) -> Webflow.FormSubmission +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update hidden fields on a form submission within a specific site. + +Required scope | `forms:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.forms.updateSubmissionBySite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**formSubmissionId:** `string` — Unique identifier for a Form Submission + +
+
+ +
+
+ +**request:** `Webflow.FormsUpdateSubmissionBySiteRequest` + +
+
+ +
+
+ +**requestOptions:** `Forms.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Users
client.users.list(siteId, { ...params }) -> Webflow.UserList diff --git a/src/Client.ts b/src/Client.ts index ca5e992f..a06fbc3e 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -70,8 +70,8 @@ export class WebflowClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.2.1", - "User-Agent": "webflow-api/3.2.1", + "X-Fern-SDK-Version": "3.2.2", + "User-Agent": "webflow-api/3.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/forms/client/Client.ts b/src/api/resources/forms/client/Client.ts index cfd483ac..bb744b6a 100644 --- a/src/api/resources/forms/client/Client.ts +++ b/src/api/resources/forms/client/Client.ts @@ -1067,6 +1067,598 @@ export class Forms { } } + /** + * List form submissions for a given form within a specific site. + * + * Required scope | `forms:read` + * + * @param {string} siteId - Unique identifier for a Site + * @param {string} formId - Unique identifier for a Form + * @param {Webflow.FormsListSubmissionsByFormAndSiteRequest} request + * @param {Forms.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.ForbiddenError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.forms.listSubmissionsByFormAndSite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { + * offset: 1.1, + * limit: 1.1 + * }) + */ + public listSubmissionsByFormAndSite( + siteId: string, + formId: string, + request: Webflow.FormsListSubmissionsByFormAndSiteRequest = {}, + requestOptions?: Forms.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__listSubmissionsByFormAndSite(siteId, formId, request, requestOptions), + ); + } + + private async __listSubmissionsByFormAndSite( + siteId: string, + formId: string, + request: Webflow.FormsListSubmissionsByFormAndSiteRequest = {}, + requestOptions?: Forms.RequestOptions, + ): Promise> { + const { offset, limit } = request; + const _queryParams: Record = {}; + if (offset != null) { + _queryParams["offset"] = offset.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.baseUrl)) ?? + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) + .base, + `sites/${encodeURIComponent(siteId)}/forms/${encodeURIComponent(formId)}/submissions`, + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.FormSubmissionList.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Webflow.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/forms/{form_id}/submissions.", + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Get information about a form submission within a specific site. + * + * Required scope | `forms:read` + * + * @param {string} siteId - Unique identifier for a Site + * @param {string} formSubmissionId - Unique identifier for a Form Submission + * @param {Forms.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.ForbiddenError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.forms.getSubmissionBySite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741") + */ + public getSubmissionBySite( + siteId: string, + formSubmissionId: string, + requestOptions?: Forms.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__getSubmissionBySite(siteId, formSubmissionId, requestOptions), + ); + } + + private async __getSubmissionBySite( + siteId: string, + formSubmissionId: string, + requestOptions?: Forms.RequestOptions, + ): Promise> { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.baseUrl)) ?? + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) + .base, + `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.FormSubmission.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Webflow.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/form_submissions/{form_submission_id}.", + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Delete a form submission within a specific site. + * + * Required scope | `forms:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {string} formSubmissionId - Unique identifier for a Form Submission + * @param {Forms.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.ForbiddenError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.ConflictError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.forms.deleteSubmissionBySite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741") + */ + public deleteSubmissionBySite( + siteId: string, + formSubmissionId: string, + requestOptions?: Forms.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__deleteSubmissionBySite(siteId, formSubmissionId, requestOptions), + ); + } + + private async __deleteSubmissionBySite( + siteId: string, + formSubmissionId: string, + requestOptions?: Forms.RequestOptions, + ): Promise> { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.baseUrl)) ?? + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) + .base, + `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, + ), + method: "DELETE", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Webflow.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 409: + throw new Webflow.ConflictError(_response.error.body, _response.rawResponse); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /sites/{site_id}/form_submissions/{form_submission_id}.", + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Update hidden fields on a form submission within a specific site. + * + * Required scope | `forms:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {string} formSubmissionId - Unique identifier for a Form Submission + * @param {Webflow.FormsUpdateSubmissionBySiteRequest} request + * @param {Forms.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.ForbiddenError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.ConflictError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.forms.updateSubmissionBySite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741") + */ + public updateSubmissionBySite( + siteId: string, + formSubmissionId: string, + request: Webflow.FormsUpdateSubmissionBySiteRequest = {}, + requestOptions?: Forms.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__updateSubmissionBySite(siteId, formSubmissionId, request, requestOptions), + ); + } + + private async __updateSubmissionBySite( + siteId: string, + formSubmissionId: string, + request: Webflow.FormsUpdateSubmissionBySiteRequest = {}, + requestOptions?: Forms.RequestOptions, + ): Promise> { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.baseUrl)) ?? + ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) + .base, + `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, + ), + method: "PATCH", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.FormsUpdateSubmissionBySiteRequest.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 { + data: serializers.FormSubmission.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Webflow.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 409: + throw new Webflow.ConflictError(_response.error.body, _response.rawResponse); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /sites/{site_id}/form_submissions/{form_submission_id}.", + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + protected async _getAuthorizationHeader(): Promise { const bearer = await core.Supplier.get(this._options.accessToken); if (bearer != null) { diff --git a/src/api/resources/forms/client/requests/FormsListSubmissionsByFormAndSiteRequest.ts b/src/api/resources/forms/client/requests/FormsListSubmissionsByFormAndSiteRequest.ts new file mode 100644 index 00000000..a411a145 --- /dev/null +++ b/src/api/resources/forms/client/requests/FormsListSubmissionsByFormAndSiteRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * offset: 1.1, + * limit: 1.1 + * } + */ +export interface FormsListSubmissionsByFormAndSiteRequest { + /** + * 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; +} diff --git a/src/api/resources/forms/client/requests/FormsUpdateSubmissionBySiteRequest.ts b/src/api/resources/forms/client/requests/FormsUpdateSubmissionBySiteRequest.ts new file mode 100644 index 00000000..eae5bfb0 --- /dev/null +++ b/src/api/resources/forms/client/requests/FormsUpdateSubmissionBySiteRequest.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface FormsUpdateSubmissionBySiteRequest { + /** An existing **hidden field** defined on the form schema, and the corresponding value to set */ + formSubmissionData?: Record; +} diff --git a/src/api/resources/forms/client/requests/index.ts b/src/api/resources/forms/client/requests/index.ts index 44ba90b9..00ff96b6 100644 --- a/src/api/resources/forms/client/requests/index.ts +++ b/src/api/resources/forms/client/requests/index.ts @@ -2,3 +2,5 @@ export { type FormsListRequest } from "./FormsListRequest"; export { type FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; export { type FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; export { type FormsListSubmissionsBySiteRequest } from "./FormsListSubmissionsBySiteRequest"; +export { type FormsListSubmissionsByFormAndSiteRequest } from "./FormsListSubmissionsByFormAndSiteRequest"; +export { type FormsUpdateSubmissionBySiteRequest } from "./FormsUpdateSubmissionBySiteRequest"; diff --git a/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionBySiteRequest.ts b/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionBySiteRequest.ts new file mode 100644 index 00000000..8c66a2b8 --- /dev/null +++ b/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionBySiteRequest.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 FormsUpdateSubmissionBySiteRequest: core.serialization.Schema< + serializers.FormsUpdateSubmissionBySiteRequest.Raw, + Webflow.FormsUpdateSubmissionBySiteRequest +> = core.serialization.object({ + formSubmissionData: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace FormsUpdateSubmissionBySiteRequest { + export interface Raw { + formSubmissionData?: Record | null; + } +} diff --git a/src/serialization/resources/forms/client/requests/index.ts b/src/serialization/resources/forms/client/requests/index.ts index 71e69650..67dc6e66 100644 --- a/src/serialization/resources/forms/client/requests/index.ts +++ b/src/serialization/resources/forms/client/requests/index.ts @@ -1 +1,2 @@ export { FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; +export { FormsUpdateSubmissionBySiteRequest } from "./FormsUpdateSubmissionBySiteRequest"; diff --git a/src/version.ts b/src/version.ts index 926e51f1..7d5c832f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.2.1"; +export const SDK_VERSION = "3.2.2"; diff --git a/tests/wire/assets.test.ts b/tests/wire/assets.test.ts index bdcc5980..09550c88 100644 --- a/tests/wire/assets.test.ts +++ b/tests/wire/assets.test.ts @@ -249,6 +249,7 @@ describe("Assets", () => { width: 500, height: 900, quality: 100, + error: "error", }, ], altText: "A single candy wrapper", @@ -283,6 +284,7 @@ describe("Assets", () => { width: 500, height: 900, quality: 100, + error: "error", }, ], altText: "A single candy wrapper", @@ -330,6 +332,7 @@ describe("Assets", () => { width: 500, height: 900, quality: 100, + error: "error", }, ], altText: "A single candy wrapper", @@ -365,6 +368,7 @@ describe("Assets", () => { width: 500, height: 900, quality: 100, + error: "error", }, ], altText: "A single candy wrapper", @@ -383,6 +387,7 @@ describe("Assets", () => { { id: "6390c49774a71f0e3c1a08ee", displayName: "emoji icons", + parentFolder: "6390c49774a71f99f21a08eb", assets: ["63e5889e7fe4eafa7384cea4", "659595234426a9fcbad57043"], siteId: "6390c49674a71f84b51a08d8", createdOn: "2018-10-14T21:55:49Z", @@ -405,6 +410,7 @@ describe("Assets", () => { { id: "6390c49774a71f0e3c1a08ee", displayName: "emoji icons", + parentFolder: "6390c49774a71f99f21a08eb", assets: ["63e5889e7fe4eafa7384cea4", "659595234426a9fcbad57043"], siteId: "6390c49674a71f84b51a08d8", createdOn: new Date("2018-10-14T21:55:49.000Z"), diff --git a/tests/wire/collections.test.ts b/tests/wire/collections.test.ts index e5f88e65..20c4f5ab 100644 --- a/tests/wire/collections.test.ts +++ b/tests/wire/collections.test.ts @@ -368,6 +368,7 @@ describe("Collections", () => { type: "File", slug: "guide-file", displayName: "Guide File", + helpText: "helpText", }, { id: "7f8e9d0c1b2a3f4e5d6c8b9e", @@ -376,6 +377,7 @@ describe("Collections", () => { type: "Email", slug: "contributor-email", displayName: "Contributor Email", + helpText: "helpText", }, { id: "3a4f5e6d7c8b9a0e1d2c4b5f", @@ -384,6 +386,7 @@ describe("Collections", () => { type: "Phone", slug: "emergency-contact", displayName: "Emergency Contact", + helpText: "helpText", }, ], }; @@ -537,6 +540,7 @@ describe("Collections", () => { type: "File", slug: "guide-file", displayName: "Guide File", + helpText: "helpText", }, { id: "7f8e9d0c1b2a3f4e5d6c8b9e", @@ -545,6 +549,7 @@ describe("Collections", () => { type: "Email", slug: "contributor-email", displayName: "Contributor Email", + helpText: "helpText", }, { id: "3a4f5e6d7c8b9a0e1d2c4b5f", @@ -553,6 +558,7 @@ describe("Collections", () => { type: "Phone", slug: "emergency-contact", displayName: "Emergency Contact", + helpText: "helpText", }, ], }); diff --git a/tests/wire/components.test.ts b/tests/wire/components.test.ts index 91326143..8a669b4e 100644 --- a/tests/wire/components.test.ts +++ b/tests/wire/components.test.ts @@ -29,8 +29,20 @@ describe("Components", () => { description: "A secondary button component that can be used across the site", readonly: true, }, - { id: "6258612d1ee792848f805dcf", name: "Card", readonly: true }, - { id: "68a2b1d1ee792848f805dcf", name: "Nav", readonly: true }, + { + id: "6258612d1ee792848f805dcf", + name: "Card", + group: "Buttons", + description: "A button component that can be used across the site", + readonly: true, + }, + { + id: "68a2b1d1ee792848f805dcf", + name: "Nav", + group: "Buttons", + description: "A button component that can be used across the site", + readonly: true, + }, ], pagination: { limit: 20, offset: 0, total: 4 }, }; @@ -66,11 +78,15 @@ describe("Components", () => { { id: "6258612d1ee792848f805dcf", name: "Card", + group: "Buttons", + description: "A button component that can be used across the site", readonly: true, }, { id: "68a2b1d1ee792848f805dcf", name: "Nav", + group: "Buttons", + description: "A button component that can be used across the site", readonly: true, }, ], diff --git a/tests/wire/forms.test.ts b/tests/wire/forms.test.ts index cb203a6d..1a6021f7 100644 --- a/tests/wire/forms.test.ts +++ b/tests/wire/forms.test.ts @@ -20,12 +20,13 @@ describe("Forms", () => { createdOn: "2016-10-24T19:41:29Z", lastUpdated: "2016-10-24T19:43:17Z", fields: { - "0": { displayName: "Email", userVisible: true }, - "1": { displayName: "Email", userVisible: true }, + "0": { displayName: "Email", placeholder: "Enter your email", userVisible: true }, + "1": { displayName: "Email", placeholder: "Enter your email", userVisible: true }, }, responseSettings: { redirectUrl: "https://example.com", redirectMethod: "GET", + redirectAction: "POST https://example.com", sendEmailConfirmation: true, }, id: "589a331aa51e760df7ccb89e", @@ -40,10 +41,11 @@ describe("Forms", () => { displayName: "Name Form", createdOn: "2016-10-24T19:41:29Z", lastUpdated: "2016-10-24T19:43:17Z", - fields: { "0": { displayName: "Email", userVisible: true } }, + fields: { "0": { displayName: "Email", placeholder: "Enter your email", userVisible: true } }, responseSettings: { redirectUrl: "https://example.com", redirectMethod: "GET", + redirectAction: "POST https://example.com", sendEmailConfirmation: false, }, id: "580ff8d7ba3e45ba9fe588e9", @@ -78,16 +80,19 @@ describe("Forms", () => { fields: { "0": { displayName: "Email", + placeholder: "Enter your email", userVisible: true, }, "1": { displayName: "Email", + placeholder: "Enter your email", userVisible: true, }, }, responseSettings: { redirectUrl: "https://example.com", redirectMethod: "GET", + redirectAction: "POST https://example.com", sendEmailConfirmation: true, }, id: "589a331aa51e760df7ccb89e", @@ -105,12 +110,14 @@ describe("Forms", () => { fields: { "0": { displayName: "Email", + placeholder: "Enter your email", userVisible: true, }, }, responseSettings: { redirectUrl: "https://example.com", redirectMethod: "GET", + redirectAction: "POST https://example.com", sendEmailConfirmation: false, }, id: "580ff8d7ba3e45ba9fe588e9", @@ -142,7 +149,12 @@ describe("Forms", () => { createdOn: "2016-10-24T19:41:29Z", lastUpdated: "2016-10-24T19:43:17Z", fields: { - "660d5bcc9c0772150459dfb1": { displayName: "Name", type: "Plain", userVisible: true }, + "660d5bcc9c0772150459dfb1": { + displayName: "Name", + type: "Plain", + placeholder: "Enter your email", + userVisible: true, + }, "589a331aa51e760df7ccb89d": { displayName: "Email", type: "Email", @@ -153,6 +165,7 @@ describe("Forms", () => { responseSettings: { redirectUrl: "https://example.com", redirectMethod: "GET", + redirectAction: "POST https://example.com", sendEmailConfirmation: true, }, id: "589a331aa51e760df7ccb89e", @@ -180,6 +193,7 @@ describe("Forms", () => { "660d5bcc9c0772150459dfb1": { displayName: "Name", type: "Plain", + placeholder: "Enter your email", userVisible: true, }, "589a331aa51e760df7ccb89d": { @@ -192,6 +206,7 @@ describe("Forms", () => { responseSettings: { redirectUrl: "https://example.com", redirectMethod: "GET", + redirectAction: "POST https://example.com", sendEmailConfirmation: true, }, id: "589a331aa51e760df7ccb89e", @@ -443,4 +458,180 @@ describe("Forms", () => { }, }); }); + + test("list-submissions-by-form-and-site", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { + formSubmissions: [ + { + id: "6321ca84df3949bfc6752327", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: "2022-09-14T12:35:16Z", + formResponse: { "First Name": "Arthur", "Last Name": "Dent" }, + }, + { + id: "660d64fabf6e0a0d4edab981", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: "2022-09-14T12:35:16Z", + formResponse: { "First Name": "Ford", "Last Name": "Prefect" }, + }, + ], + pagination: { limit: 25, offset: 0, total: 2 }, + }; + server + .mockEndpoint() + .get("/sites/580e63e98c9a982ac9b8b741/forms/580e63e98c9a982ac9b8b741/submissions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.forms.listSubmissionsByFormAndSite( + "580e63e98c9a982ac9b8b741", + "580e63e98c9a982ac9b8b741", + { + offset: 1.1, + limit: 1.1, + }, + ); + expect(response).toEqual({ + formSubmissions: [ + { + id: "6321ca84df3949bfc6752327", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: new Date("2022-09-14T12:35:16.000Z"), + formResponse: { + "First Name": "Arthur", + "Last Name": "Dent", + }, + }, + { + id: "660d64fabf6e0a0d4edab981", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: new Date("2022-09-14T12:35:16.000Z"), + formResponse: { + "First Name": "Ford", + "Last Name": "Prefect", + }, + }, + ], + pagination: { + limit: 25, + offset: 0, + total: 2, + }, + }); + }); + + test("get-submission-by-site", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { + id: "6321ca84df3949bfc6752327", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: "2022-09-14T12:35:16Z", + formResponse: { "First Name": "Arthur", "Last Name": "Dent" }, + }; + server + .mockEndpoint() + .get("/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.forms.getSubmissionBySite("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); + expect(response).toEqual({ + id: "6321ca84df3949bfc6752327", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: new Date("2022-09-14T12:35:16.000Z"), + formResponse: { + "First Name": "Arthur", + "Last Name": "Dent", + }, + }); + }); + + test("delete-submission-by-site", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.forms.deleteSubmissionBySite( + "580e63e98c9a982ac9b8b741", + "580e63e98c9a982ac9b8b741", + ); + expect(response).toEqual(undefined); + }); + + test("update-submission-by-site", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { + id: "6321ca84df3949bfc6752327", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: "2022-09-14T12:35:16Z", + formResponse: { "First Name": "Arthur", "Last Name": "Dent" }, + }; + server + .mockEndpoint() + .patch("/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.forms.updateSubmissionBySite( + "580e63e98c9a982ac9b8b741", + "580e63e98c9a982ac9b8b741", + ); + expect(response).toEqual({ + id: "6321ca84df3949bfc6752327", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: new Date("2022-09-14T12:35:16.000Z"), + formResponse: { + "First Name": "Arthur", + "Last Name": "Dent", + }, + }); + }); }); diff --git a/tests/wire/orders.test.ts b/tests/wire/orders.test.ts index e21f8ddc..419d2e51 100644 --- a/tests/wire/orders.test.ts +++ b/tests/wire/orders.test.ts @@ -22,6 +22,11 @@ describe("Orders", () => { "Customer requested gift wrapping and a personalized note saying: Happy Birthday, Ford! 🎉 Please ensure the item is packed with extra bubble wrap for safe transit.", orderComment: 'Please gift wrap with a personal note saying "Happy Birthday, Ford! 🎉', acceptedOn: "2024-04-10T13:16:21Z", + fulfilledOn: "2018-12-03T22:06:15Z", + refundedOn: "2018-12-03T22:06:15Z", + disputedOn: "2018-12-03T22:06:15Z", + disputeUpdatedOn: "2018-12-03T22:06:15Z", + disputeLastStatus: "warning_needs_response", customerPaid: { unit: "USD", value: "5892", string: "$ 211.55 USD" }, netAmount: { unit: "USD", value: "5892", string: "$ 200.89 USD" }, applicationFee: { unit: "USD", value: "5892", string: "$ 4.23 USD" }, @@ -106,6 +111,7 @@ describe("Orders", () => { url: "https://dev-assets.website-files.com/66072f39417a2a35b2589cc7/66072fb51b89448912e26729_image16.jpeg", }, variantPrice: { unit: "USD", value: "5892", string: "$ 83.09 USD" }, + weight: 5, width: 19, height: 72, length: 18, @@ -113,10 +119,12 @@ describe("Orders", () => { ], purchasedItemsCount: 3, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1P410gJYFi4lcbXWbeKghqjK", paymentIntentId: "pi_3P410iJYFi4lcbXW0EKKgcVg", customerId: "cus_Ptod8KJBiiPgnH", chargeId: "ch_3P410iJYFi4lcbXW0DxUkzCH", + refundReason: "requested_by_customer", }, stripeCard: { last4: "4242", @@ -124,6 +132,14 @@ describe("Orders", () => { ownerName: "Arthur Dent", expires: { year: 2025, month: 4 }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [{ key: "value" }], metadata: { isBuyNow: false }, isCustomerDeleted: false, @@ -154,7 +170,11 @@ describe("Orders", () => { comment: "Example comment to myself", orderComment: "", acceptedOn: "2024-03-29T21:29:21Z", + fulfilledOn: "2018-12-03T22:06:15Z", refundedOn: "2024-04-08T18:25:04Z", + disputedOn: "2018-12-03T22:06:15Z", + disputeUpdatedOn: "2018-12-03T22:06:15Z", + disputeLastStatus: "warning_needs_response", customerPaid: { unit: "USD", value: "5892", string: "$ 118.73 USD" }, netAmount: { unit: "USD", value: "5892", string: "$ 112.62 USD" }, applicationFee: { unit: "USD", value: "5892", string: "$ 2.37 USD" }, @@ -246,6 +266,7 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", @@ -259,6 +280,14 @@ describe("Orders", () => { ownerName: "Arthur Dent", expires: { year: 2024, month: 4 }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [{ key: "value" }], metadata: { isBuyNow: false }, isCustomerDeleted: false, @@ -322,6 +351,11 @@ describe("Orders", () => { "Customer requested gift wrapping and a personalized note saying: Happy Birthday, Ford! \uD83C\uDF89 Please ensure the item is packed with extra bubble wrap for safe transit.", orderComment: 'Please gift wrap with a personal note saying "Happy Birthday, Ford! \uD83C\uDF89', acceptedOn: new Date("2024-04-10T13:16:21.000Z"), + fulfilledOn: new Date("2018-12-03T22:06:15.000Z"), + refundedOn: new Date("2018-12-03T22:06:15.000Z"), + disputedOn: new Date("2018-12-03T22:06:15.000Z"), + disputeUpdatedOn: new Date("2018-12-03T22:06:15.000Z"), + disputeLastStatus: "warning_needs_response", customerPaid: { unit: "USD", value: "5892", @@ -437,6 +471,7 @@ describe("Orders", () => { value: "5892", string: "$ 83.09 USD", }, + weight: 5, width: 19, height: 72, length: 18, @@ -444,10 +479,12 @@ describe("Orders", () => { ], purchasedItemsCount: 3, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1P410gJYFi4lcbXWbeKghqjK", paymentIntentId: "pi_3P410iJYFi4lcbXW0EKKgcVg", customerId: "cus_Ptod8KJBiiPgnH", chargeId: "ch_3P410iJYFi4lcbXW0DxUkzCH", + refundReason: "requested_by_customer", }, stripeCard: { last4: "4242", @@ -458,6 +495,14 @@ describe("Orders", () => { month: 4, }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [ { key: "value", @@ -498,7 +543,11 @@ describe("Orders", () => { comment: "Example comment to myself", orderComment: "", acceptedOn: new Date("2024-03-29T21:29:21.000Z"), + fulfilledOn: new Date("2018-12-03T22:06:15.000Z"), refundedOn: new Date("2024-04-08T18:25:04.000Z"), + disputedOn: new Date("2018-12-03T22:06:15.000Z"), + disputeUpdatedOn: new Date("2018-12-03T22:06:15.000Z"), + disputeLastStatus: "warning_needs_response", customerPaid: { unit: "USD", value: "5892", @@ -621,6 +670,7 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", @@ -637,6 +687,14 @@ describe("Orders", () => { month: 4, }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [ { key: "value", @@ -824,14 +882,24 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, stripeCard: { last4: "4242", brand: "Visa", ownerName: "Arthur Dent", expires: { year: 2024, month: 4 } }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [{ key: "value" }], metadata: { isBuyNow: false }, isCustomerDeleted: false, @@ -1017,10 +1085,12 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, @@ -1033,6 +1103,14 @@ describe("Orders", () => { month: 4, }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [ { key: "value", @@ -1213,14 +1291,24 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, stripeCard: { last4: "4242", brand: "Visa", ownerName: "Arthur Dent", expires: { year: 2024, month: 4 } }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [{ key: "value" }], metadata: { isBuyNow: false }, isCustomerDeleted: false, @@ -1407,10 +1495,12 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, @@ -1423,6 +1513,14 @@ describe("Orders", () => { month: 4, }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [ { key: "value", @@ -1603,14 +1701,24 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, stripeCard: { last4: "4242", brand: "Visa", ownerName: "Arthur Dent", expires: { year: 2024, month: 4 } }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [{ key: "value" }], metadata: { isBuyNow: false }, isCustomerDeleted: false, @@ -1797,10 +1905,12 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, @@ -1813,6 +1923,14 @@ describe("Orders", () => { month: 4, }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [ { key: "value", @@ -1993,14 +2111,24 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, stripeCard: { last4: "4242", brand: "Visa", ownerName: "Arthur Dent", expires: { year: 2024, month: 4 } }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [{ key: "value" }], metadata: { isBuyNow: false }, isCustomerDeleted: false, @@ -2186,10 +2314,12 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, @@ -2202,6 +2332,14 @@ describe("Orders", () => { month: 4, }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [ { key: "value", @@ -2382,14 +2520,24 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, stripeCard: { last4: "4242", brand: "Visa", ownerName: "Arthur Dent", expires: { year: 2024, month: 4 } }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [{ key: "value" }], metadata: { isBuyNow: false }, isCustomerDeleted: false, @@ -2576,10 +2724,12 @@ describe("Orders", () => { ], purchasedItemsCount: 2, stripeDetails: { + subscriptionId: "sub_1J6xwG2eZvKYlo2CXu9Zt0Tn", paymentMethod: "pm_1OzmzBJYFi4lcbXWHKNdXU7j", paymentIntentId: "pi_3OzmzDJYFi4lcbXW1hTBW6ft", customerId: "cus_PpRsNHwWdUoRKR", chargeId: "ch_3OzmzDJYFi4lcbXW1ndkkrH2", + disputeId: "disputeId", refundId: "re_3OzmzDJYFi4lcbXW1kFAmlBk", refundReason: "fraudulent", }, @@ -2592,6 +2742,14 @@ describe("Orders", () => { month: 4, }, }, + paypalDetails: { + orderId: "1a2b3c4d5e6f7g8h9i0j", + payerId: "9k8j7i6h5g4f3e2d1c0b", + captureId: "qwe123rty456uio789p", + refundId: "abcde12345fghij67890", + refundReason: "Customer requested refund", + disputeId: "zxcvbnm987poiuytrewq", + }, customData: [ { key: "value", diff --git a/tests/wire/pages.test.ts b/tests/wire/pages.test.ts index 738c298c..17499f50 100644 --- a/tests/wire/pages.test.ts +++ b/tests/wire/pages.test.ts @@ -20,6 +20,8 @@ describe("Pages", () => { siteId: "6258612d1ee792848f805dcf", title: "Guide to the Galaxy", slug: "guide-to-the-galaxy", + parentId: "6419db964a9c435aa3af6251", + collectionId: "6390c49774a71f12831a08e3", createdOn: "2024-03-11T10:42:00Z", lastUpdated: "2024-03-11T10:42:42Z", archived: false, @@ -47,12 +49,15 @@ describe("Pages", () => { siteId: "6258612d1ee792848f805dcf", title: "Towel Day Celebrations", slug: "towel-day", + parentId: "6419db964a9c435aa3af6251", + collectionId: "6390c49774a71f12831a08e3", createdOn: "2024-05-25T09:00:00Z", lastUpdated: "2024-05-25T09:42:00Z", archived: false, draft: false, canBranch: true, isBranch: false, + branchId: "68026fa68ef6dc744c75b833", seo: { title: "Celebrate Towel Day - The Hitchhiker's Guide to the Galaxy", description: @@ -91,6 +96,8 @@ describe("Pages", () => { siteId: "6258612d1ee792848f805dcf", title: "Guide to the Galaxy", slug: "guide-to-the-galaxy", + parentId: "6419db964a9c435aa3af6251", + collectionId: "6390c49774a71f12831a08e3", createdOn: new Date("2024-03-11T10:42:00.000Z"), lastUpdated: new Date("2024-03-11T10:42:42.000Z"), archived: false, @@ -118,12 +125,15 @@ describe("Pages", () => { siteId: "6258612d1ee792848f805dcf", title: "Towel Day Celebrations", slug: "towel-day", + parentId: "6419db964a9c435aa3af6251", + collectionId: "6390c49774a71f12831a08e3", createdOn: new Date("2024-05-25T09:00:00.000Z"), lastUpdated: new Date("2024-05-25T09:42:00.000Z"), archived: false, draft: false, canBranch: true, isBranch: false, + branchId: "68026fa68ef6dc744c75b833", seo: { title: "Celebrate Towel Day - The Hitchhiker's Guide to the Galaxy", description: @@ -160,6 +170,8 @@ describe("Pages", () => { siteId: "6258612d1ee792848f805dcf", title: "Guide to the Galaxy", slug: "guide-to-the-galaxy", + parentId: "6419db964a9c435aa3af6251", + collectionId: "6390c49774a71f12831a08e3", createdOn: "2024-03-11T10:42:00Z", lastUpdated: "2024-03-11T10:42:42Z", archived: false, @@ -197,6 +209,8 @@ describe("Pages", () => { siteId: "6258612d1ee792848f805dcf", title: "Guide to the Galaxy", slug: "guide-to-the-galaxy", + parentId: "6419db964a9c435aa3af6251", + collectionId: "6390c49774a71f12831a08e3", createdOn: new Date("2024-03-11T10:42:00.000Z"), lastUpdated: new Date("2024-03-11T10:42:42.000Z"), archived: false, @@ -246,6 +260,8 @@ describe("Pages", () => { siteId: "6258612d1ee792848f805dcf", title: "Guide to the Galaxy", slug: "guide-to-the-galaxy", + parentId: "6419db964a9c435aa3af6251", + collectionId: "6390c49774a71f12831a08e3", createdOn: "2024-03-11T10:42:00Z", lastUpdated: "2024-03-11T10:42:42Z", archived: false, @@ -297,6 +313,8 @@ describe("Pages", () => { siteId: "6258612d1ee792848f805dcf", title: "Guide to the Galaxy", slug: "guide-to-the-galaxy", + parentId: "6419db964a9c435aa3af6251", + collectionId: "6390c49774a71f12831a08e3", createdOn: new Date("2024-03-11T10:42:00.000Z"), lastUpdated: new Date("2024-03-11T10:42:42.000Z"), archived: false, diff --git a/tests/wire/scripts.test.ts b/tests/wire/scripts.test.ts index fc13f7c0..3404b169 100644 --- a/tests/wire/scripts.test.ts +++ b/tests/wire/scripts.test.ts @@ -20,6 +20,7 @@ describe("Scripts", () => { canCopy: false, displayName: "Alert", hostedLocation: "https://cdn.webflow.io/.../alert-0.0.1.js", + integrityHash: "integrityHash", createdOn: "2022-10-26T00:28:54.191Z", lastUpdated: "lastUpdated", version: "0.0.1", @@ -29,6 +30,7 @@ describe("Scripts", () => { canCopy: false, displayName: "Alert", hostedLocation: "https://cdn.webflow.io/.../alert-0.0.2.js", + integrityHash: "integrityHash", createdOn: "2022-10-26T00:28:54.191Z", lastUpdated: "lastUpdated", version: "0.0.2", @@ -62,6 +64,7 @@ describe("Scripts", () => { canCopy: false, displayName: "Alert", hostedLocation: "https://cdn.webflow.io/.../alert-0.0.1.js", + integrityHash: "integrityHash", createdOn: "2022-10-26T00:28:54.191Z", lastUpdated: "lastUpdated", version: "0.0.1", @@ -71,6 +74,7 @@ describe("Scripts", () => { canCopy: false, displayName: "Alert", hostedLocation: "https://cdn.webflow.io/.../alert-0.0.2.js", + integrityHash: "integrityHash", createdOn: "2022-10-26T00:28:54.191Z", lastUpdated: "lastUpdated", version: "0.0.2", @@ -156,6 +160,7 @@ describe("Scripts", () => { displayName: "Alert", hostedLocation: "https://uploads-ssl.webflow.com/6258612d1ee792848f805dcf%2F64b6c769ff52ba6c3d904a91%2F660d6e15b3d1696f2d2b1447%2Falert-0.0.1.js", + integrityHash: "integrityHash", createdOn: "2022-10-26T00:28:54.191Z", lastUpdated: "lastUpdated", version: "0.0.1", @@ -180,6 +185,7 @@ describe("Scripts", () => { displayName: "Alert", hostedLocation: "https://uploads-ssl.webflow.com/6258612d1ee792848f805dcf%2F64b6c769ff52ba6c3d904a91%2F660d6e15b3d1696f2d2b1447%2Falert-0.0.1.js", + integrityHash: "integrityHash", createdOn: "2022-10-26T00:28:54.191Z", lastUpdated: "lastUpdated", version: "0.0.1", diff --git a/tests/wire/sites.test.ts b/tests/wire/sites.test.ts index 77cf6956..b1d3e6aa 100644 --- a/tests/wire/sites.test.ts +++ b/tests/wire/sites.test.ts @@ -19,11 +19,37 @@ describe("Sites", () => { createdOn: "2024-10-15T20:24:38Z", displayName: "The Hitchiker's Guide", shortName: "hitchikers-guide", + lastPublished: "2016-10-24T19:43:17Z", lastUpdated: "2024-10-15T20:24:38Z", + previewUrl: "https://dev-assets.website-files.com/580e63e98c9a982ac9b8b741/201610241243.png", + timeZone: "America/Los_Angeles", parentFolderId: "670ece123598db72d9648be1", customDomains: [ { id: "589a331aa51e760df7ccb89d", url: "test-api-domain.com", lastPublished: "2022-12-07T16:51:37Z" }, ], + locales: { + primary: { + id: "653fd9af6a07fc9cfd7a5e57", + cmsLocaleId: "653ad57de882f528b32e810e", + enabled: false, + displayName: "English (United States)", + displayImageId: "displayImageId", + redirect: true, + subdirectory: "", + tag: "en-US", + }, + secondary: [ + { + id: "653fd9af6a07fc9cfd7a5e57", + cmsLocaleId: "653ad57de882f528b32e810e", + enabled: false, + displayName: "English (United States)", + redirect: true, + subdirectory: "", + tag: "en-US", + }, + ], + }, dataCollectionEnabled: true, dataCollectionType: "always", }; @@ -45,7 +71,10 @@ describe("Sites", () => { createdOn: new Date("2024-10-15T20:24:38.000Z"), displayName: "The Hitchiker's Guide", shortName: "hitchikers-guide", + lastPublished: new Date("2016-10-24T19:43:17.000Z"), lastUpdated: new Date("2024-10-15T20:24:38.000Z"), + previewUrl: "https://dev-assets.website-files.com/580e63e98c9a982ac9b8b741/201610241243.png", + timeZone: "America/Los_Angeles", parentFolderId: "670ece123598db72d9648be1", customDomains: [ { @@ -54,6 +83,29 @@ describe("Sites", () => { lastPublished: new Date("2022-12-07T16:51:37.000Z"), }, ], + locales: { + primary: { + id: "653fd9af6a07fc9cfd7a5e57", + cmsLocaleId: "653ad57de882f528b32e810e", + enabled: false, + displayName: "English (United States)", + displayImageId: "displayImageId", + redirect: true, + subdirectory: "", + tag: "en-US", + }, + secondary: [ + { + id: "653fd9af6a07fc9cfd7a5e57", + cmsLocaleId: "653ad57de882f528b32e810e", + enabled: false, + displayName: "English (United States)", + redirect: true, + subdirectory: "", + tag: "en-US", + }, + ], + }, dataCollectionEnabled: true, dataCollectionType: "always", }); @@ -130,6 +182,7 @@ describe("Sites", () => { lastUpdated: "2016-10-24T19:43:17Z", previewUrl: "https://dev-assets.website-files.com/42e63e98c9a982ac9b8b742/198110121200.png", timeZone: "DeepSpace/Depression", + parentFolderId: "1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6", customDomains: [ { id: "589a331aa51e760df7ccb89f", url: "marvin.blog", lastPublished: "2022-12-07T16:51:37Z" }, ], @@ -168,6 +221,7 @@ describe("Sites", () => { lastUpdated: "2016-10-24T19:43:17Z", previewUrl: "https://dev-assets.website-files.com/42e63e98c9a982ac9b8b743/198210121200.png", timeZone: "Vogsphere/PoetryHall", + parentFolderId: "1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6", customDomains: [ { id: "589a331aa51e760df7ccb8a0", @@ -269,6 +323,7 @@ describe("Sites", () => { lastUpdated: new Date("2016-10-24T19:43:17.000Z"), previewUrl: "https://dev-assets.website-files.com/42e63e98c9a982ac9b8b742/198110121200.png", timeZone: "DeepSpace/Depression", + parentFolderId: "1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6", customDomains: [ { id: "589a331aa51e760df7ccb89f", @@ -311,6 +366,7 @@ describe("Sites", () => { lastUpdated: new Date("2016-10-24T19:43:17.000Z"), previewUrl: "https://dev-assets.website-files.com/42e63e98c9a982ac9b8b743/198210121200.png", timeZone: "Vogsphere/PoetryHall", + parentFolderId: "1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6", customDomains: [ { id: "589a331aa51e760df7ccb8a0", diff --git a/tests/wire/sites/activityLogs.test.ts b/tests/wire/sites/activityLogs.test.ts index ac7ef3cf..7a521fc1 100644 --- a/tests/wire/sites/activityLogs.test.ts +++ b/tests/wire/sites/activityLogs.test.ts @@ -24,6 +24,9 @@ describe("ActivityLogs", () => { user: { id: "6509cd56e90eec668b009712", displayName: "John Doe" }, resourceId: "654c16c7b229e56bcf26870c", resourceName: "foo-bar", + newValue: "newValue", + previousValue: "previousValue", + payload: { key: "value" }, }, ], pagination: { limit: 25, offset: 0, total: 1 }, @@ -54,6 +57,11 @@ describe("ActivityLogs", () => { }, resourceId: "654c16c7b229e56bcf26870c", resourceName: "foo-bar", + newValue: "newValue", + previousValue: "previousValue", + payload: { + key: "value", + }, }, ], pagination: { diff --git a/tests/wire/sites/comments.test.ts b/tests/wire/sites/comments.test.ts index dc8f3bdb..bdff914d 100644 --- a/tests/wire/sites/comments.test.ts +++ b/tests/wire/sites/comments.test.ts @@ -20,6 +20,7 @@ describe("Comments", () => { 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]] ", @@ -44,6 +45,7 @@ describe("Comments", () => { 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]] ", @@ -88,6 +90,7 @@ describe("Comments", () => { 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]] ", @@ -112,6 +115,7 @@ describe("Comments", () => { 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]] ", diff --git a/tests/wire/sites/scripts.test.ts b/tests/wire/sites/scripts.test.ts index 9abcff7e..9612b3d5 100644 --- a/tests/wire/sites/scripts.test.ts +++ b/tests/wire/sites/scripts.test.ts @@ -168,6 +168,7 @@ describe("Scripts", () => { blocks: [ { siteId: "6258612d1ee792848f805dcf", + pageId: "pageId", type: "site", scripts: [{ id: "chartjs", location: "header", version: "4.4.2", attributes: { key: "value" } }], createdOn: "2024-04-03T16:49:15Z", @@ -200,6 +201,7 @@ describe("Scripts", () => { blocks: [ { siteId: "6258612d1ee792848f805dcf", + pageId: "pageId", type: "site", scripts: [ { diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts index 4f8066df..a2bf9815 100644 --- a/tests/wire/webhooks.test.ts +++ b/tests/wire/webhooks.test.ts @@ -125,6 +125,7 @@ describe("Webhooks", () => { url: "https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f", workspaceId: "4f4e46fd476ea8c507000001", siteId: "562ac0395358780a1f5e6fbd", + filter: { name: "My Form" }, lastTriggered: "2023-02-08T23:59:28Z", createdOn: "2022-11-08T23:59:28Z", }; @@ -152,6 +153,9 @@ describe("Webhooks", () => { url: "https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f", workspaceId: "4f4e46fd476ea8c507000001", siteId: "562ac0395358780a1f5e6fbd", + filter: { + name: "My Form", + }, lastTriggered: new Date("2023-02-08T23:59:28.000Z"), createdOn: new Date("2022-11-08T23:59:28.000Z"), }); @@ -170,6 +174,7 @@ describe("Webhooks", () => { url: "https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f", workspaceId: "4f4e46fd476ea8c507000001", siteId: "562ac0395358780a1f5e6fbd", + filter: { name: "My Form" }, lastTriggered: "2023-02-08T23:59:28Z", createdOn: "2022-11-08T23:59:28Z", }; @@ -188,6 +193,9 @@ describe("Webhooks", () => { url: "https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f", workspaceId: "4f4e46fd476ea8c507000001", siteId: "562ac0395358780a1f5e6fbd", + filter: { + name: "My Form", + }, lastTriggered: new Date("2023-02-08T23:59:28.000Z"), createdOn: new Date("2022-11-08T23:59:28.000Z"), }); diff --git a/yarn.lock b/yarn.lock index 36d476f3..b34706de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -270,20 +270,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@bundled-es-modules/cookie@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz#b41376af6a06b3e32a15241d927b840a9b4de507" - integrity sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw== - dependencies: - cookie "^0.7.2" - -"@bundled-es-modules/statuses@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz#761d10f44e51a94902c4da48675b71a76cc98872" - integrity sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg== - dependencies: - statuses "^2.0.1" - "@inquirer/ansi@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@inquirer/ansi/-/ansi-1.0.1.tgz#994f7dd16a00c547a7b110e04bf4f4eca1857929" @@ -571,10 +557,10 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@mswjs/interceptors@^0.39.1": - version "0.39.8" - resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.39.8.tgz#0a2cf4cf26a731214ca4156273121f67dff7ebf8" - integrity sha512-2+BzZbjRO7Ct61k8fMNHEtoKjeWI9pIlHFTqBwZ5icHpqszIgEZbjb1MW5Z0+bITTCTl3gk4PDBxs9tA/csXvA== +"@mswjs/interceptors@^0.40.0": + version "0.40.0" + resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.40.0.tgz#1b45f215ba8c2983ed133763ca03af92896083d6" + integrity sha512-EFd6cVbHsgLa6wa4RljGj6Wk75qoHxUSyc5asLyyPSyuhIcdS2Q3Phw6ImS1q+CkALthJRShiYfKANcQMuMqsQ== dependencies: "@open-draft/deferred-promise" "^2.2.0" "@open-draft/logger" "^0.3.0" @@ -596,7 +582,7 @@ is-node-process "^1.2.0" outvariant "^1.4.0" -"@open-draft/until@^2.0.0", "@open-draft/until@^2.1.0": +"@open-draft/until@^2.0.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-2.1.0.tgz#0acf32f470af2ceaf47f095cdecd40d68666efda" integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg== @@ -658,11 +644,6 @@ dependencies: "@babel/types" "^7.20.7" -"@types/cookie@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" - integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== - "@types/eslint-scope@^3.7.7": version "3.7.7" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" @@ -1131,9 +1112,9 @@ base64-js@^1.3.1: integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== baseline-browser-mapping@^2.8.19: - version "2.8.23" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.23.tgz#cd43e17eff5cbfb67c92153e7fe856cf6d426421" - integrity sha512-616V5YX4bepJFzNyOfce5Fa8fDJMfoxzOIzDCZwaGL8MKVpFrXqfNUoIpRn9YMI5pXf/VKgzjB4htFMsFKKdiQ== + version "2.8.25" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.25.tgz#947dc6f81778e0fa0424a2ab9ea09a3033e71109" + integrity sha512-2NovHVesVF5TXefsGX1yzx1xgr7+m9JQenvz6FQY3qd+YXkKkYiv+vTCc7OriP9mcDZpTC5mAOYN4ocd29+erA== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: version "4.12.2" @@ -1305,9 +1286,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001751: - version "1.0.30001753" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001753.tgz#419f8fc9bab6f1a1d10d9574d0b3374f823c5b00" - integrity sha512-Bj5H35MD/ebaOV4iDLqPEtiliTN29qkGtEHCwawWn4cYm+bPJM2NsaP30vtZcnERClMzp52J4+aw2UNbK4o+zw== + version "1.0.30001754" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001754.tgz#7758299d9a72cce4e6b038788a15b12b44002759" + integrity sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1404,10 +1385,10 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -cookie@^0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" - integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== +cookie@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-1.0.2.tgz#27360701532116bd3f1f9416929d176afe1e4610" + integrity sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA== core-util-is@~1.0.0: version "1.0.3" @@ -1598,9 +1579,9 @@ dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.238: - version "1.5.244" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.244.tgz#b9b61e3d24ef4203489951468614f2a360763820" - integrity sha512-OszpBN7xZX4vWMPJwB9illkN/znA8M36GQqQxi6MNy9axWxhOfJyZZJtSLQCpEFLHP2xK33BiWx9aIuIEXVCcw== + version "1.5.245" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.245.tgz#81aea81adf1e06b6f703b4b35ac6d543421d0fd9" + integrity sha512-rdmGfW47ZhL/oWEJAY4qxRtdly2B98ooTJ0pdEI4jhVLZ6tNf8fPtov2wS1IRKwFJT92le3x4Knxiwzl7cPPpQ== elliptic@^6.5.3, elliptic@^6.6.1: version "6.6.1" @@ -2806,19 +2787,16 @@ ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -msw@2.11.2: - version "2.11.2" - resolved "https://registry.yarnpkg.com/msw/-/msw-2.11.2.tgz#622d83855f456a5f93b1528f6eb6f4c0114623c3" - integrity sha512-MI54hLCsrMwiflkcqlgYYNJJddY5/+S0SnONvhv1owOplvqohKSQyGejpNdUGyCwgs4IH7PqaNbPw/sKOEze9Q== +msw@^2.8.4: + version "2.12.0" + resolved "https://registry.yarnpkg.com/msw/-/msw-2.12.0.tgz#92b62b42e2b81aa843151129c513e8c94b13c165" + integrity sha512-jzf2eVnd8+iWXN74dccLrHUw3i3hFVvNVQRWS4vBl2KxaUt7Tdur0Eyda/DODGFkZDu2P5MXaeLe/9Qx8PZkrg== dependencies: - "@bundled-es-modules/cookie" "^2.0.1" - "@bundled-es-modules/statuses" "^1.0.1" "@inquirer/confirm" "^5.0.0" - "@mswjs/interceptors" "^0.39.1" + "@mswjs/interceptors" "^0.40.0" "@open-draft/deferred-promise" "^2.2.0" - "@open-draft/until" "^2.1.0" - "@types/cookie" "^0.6.0" "@types/statuses" "^2.0.4" + cookie "^1.0.2" graphql "^16.8.1" headers-polyfill "^4.0.2" is-node-process "^1.2.0" @@ -2826,9 +2804,11 @@ msw@2.11.2: path-to-regexp "^6.3.0" picocolors "^1.1.1" rettime "^0.7.0" + statuses "^2.0.2" strict-event-emitter "^0.5.1" tough-cookie "^6.0.0" type-fest "^4.26.1" + until-async "^3.0.2" yargs "^17.7.2" mute-stream@^2.0.0: @@ -3378,7 +3358,7 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -statuses@^2.0.1: +statuses@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382" integrity sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw== @@ -3482,9 +3462,9 @@ terser-webpack-plugin@^5.3.11: terser "^5.31.1" terser@^5.31.1: - version "5.44.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.0.tgz#ebefb8e5b8579d93111bfdfc39d2cf63879f4a82" - integrity sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w== + version "5.44.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.1.tgz#e391e92175c299b8c284ad6ded609e37303b0a9c" + integrity sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3637,6 +3617,11 @@ universalify@^0.2.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== +until-async@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/until-async/-/until-async-3.0.2.tgz#447f1531fdd7bb2b4c7a98869bdb1a4c2a23865f" + integrity sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw== + update-browserslist-db@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz#7802aa2ae91477f255b86e0e46dbc787a206ad4a"