diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml new file mode 100644 index 00000000..8568cdf2 --- /dev/null +++ b/.mock/definition/__package__.yml @@ -0,0 +1,2495 @@ +errors: + UnauthorizedError: + status-code: 401 + type: Error + docs: >- + Provided access token is invalid or does not have access to requested + resource + examples: + - value: + code: not_authorized + message: Request not authorized + ForbiddenError: + status-code: 403 + type: unknown + docs: Provided access token is valid, but is missing the required scopes. + examples: + - value: + code: missing_scopes + message: >- + OAuthForbidden: You are missing the following scopes - + components:write + - value: + code: forbidden + message: User is not authorized to perform this action + - value: + key: value + NotFoundError: + status-code: 404 + type: Error + docs: Requested resource not found + examples: + - value: + code: resource_not_found + message: 'Requested resource not found: The site cannot be found' + TooManyRequestsError: + status-code: 429 + type: Error + docs: >- + The rate limit of the provided access_token has been reached. Please have + your application respect the X-RateLimit-Remaining header we include on + API responses. + examples: + - value: + code: too_many_requests + message: Too many requests + BadRequestError: + status-code: 400 + type: unknown + docs: Request body was incorrectly formatted. + examples: + - value: + code: bad_request + message: 'Bad Request: Request is malformed' + - value: + key: value + - value: + code: validation_error + message: 'Validation Error: Provided ID is invalid' + InternalServerError: + status-code: 500 + type: Error + docs: We had a problem with our server. Try again later. + examples: + - value: + code: internal_error + message: An Internal Error occurred + ConflictError: + status-code: 409 + type: unknown + docs: Site is published to multiple domains at different times + examples: + - value: + message: '''Site is published to multiple domains at different times' + - value: + code: forms_require_republish + message: To access this feature, the site needs to be republished. + - value: + key: value + - value: + code: ecommerce_not_enabled + message: Ecommerce is not yet initialized +types: + BadRequestErrorBody: + discriminated: false + union: + - InvalidDomain + - NoDomains + source: + openapi: ../../../referenced-specs/v2.yml + ForbiddenErrorBody: + discriminated: false + union: + - InvalidScopes + - UsersNotEnabled + source: + openapi: ../../../referenced-specs/v2.yml + ConflictErrorBody: + discriminated: false + union: + - DuplicateUserEmail + - UserLimitReached + source: + openapi: ../../../referenced-specs/v2.yml + AuthorizedUser: + properties: + id: + type: optional + docs: The unique ID of the user + email: + type: optional + docs: The user's email address + validation: + format: email + firstName: + type: optional + docs: The user's first name + lastName: + type: optional + docs: The user's last name + source: + openapi: ../../../referenced-specs/v2.yml + ErrorCode: + enum: + - bad_request + - collection_not_found + - conflict + - duplicate_collection + - duplicate_user_email + - ecommerce_not_enabled + - forbidden + - forms_require_republish + - incompatible_webhook_filter + - internal_error + - invalid_auth_version + - invalid_credentials + - invalid_domain + - invalid_user_email + - item_not_found + - missing_scopes + - no_domains + - not_authorized + - not_enterprise_plan_site + - not_enterprise_plan_workspace + - order_not_found + - resource_not_found + - too_many_requests + - unsupported_version + - unsupported_webhook_trigger_type + - user_limit_reached + - user_not_found + - users_not_enabled + - validation_error + docs: Error code + source: + openapi: ../../../referenced-specs/v2.yml + ErrorDetailsItem: + discriminated: false + union: + - string + - map + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + Error: + properties: + code: + type: optional + docs: Error code + message: + type: optional + docs: Error message + externalReference: + type: optional + docs: Link to more information + details: + type: optional> + docs: Array of errors + source: + openapi: ../../../referenced-specs/v2.yml + Application: unknown + AuthorizationAuthorizationAuthorizedTo: + properties: + siteIds: + type: optional> + docs: Array of Sites this app is authorized to + workspaceIds: + type: optional> + docs: Array of Workspaces this app is authorized to + userIds: + type: optional> + docs: Array of Users this app is authorized to + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + AuthorizationAuthorization: + docs: The Authorization object + properties: + id: + type: optional + docs: The unique ID of the Authorization instance + createdOn: + type: optional + docs: The date the Authorization was created + lastUsed: + type: optional + docs: The date the Authorization was last used + grantType: + type: optional + docs: The grant type of the Authorization + rateLimit: + type: optional + docs: The default rate limit for the Authorization (requests/min) + scope: + type: optional + docs: Comma separted list of OAuth scopes corresponding to the Authorization + authorizedTo: optional + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + Authorization: + properties: + authorization: + type: optional + docs: The Authorization object + application: optional + source: + openapi: ../../../referenced-specs/v2.yml + Domain: + properties: + id: + type: string + docs: Unique identifier for the Domain + url: + type: optional + docs: The registered Domain name + source: + openapi: ../../../referenced-specs/v2.yml + Locale: + properties: + id: + type: optional + docs: The unique identifier for the locale. + cmsLocaleId: + type: optional + docs: A CMS-specific identifier for the locale. + enabled: + type: optional + docs: Indicates if the locale is enabled. + displayName: + type: optional + docs: The display name of the locale, typically in English. + displayImageId: + type: optional + docs: An optional ID for an image associated with the locale, nullable. + redirect: + type: optional + docs: Determines if requests should redirect to the locale's subdirectory. + subdirectory: + type: optional + docs: The subdirectory path for the locale, used in URLs. + tag: + type: optional + docs: >- + A tag or code representing the locale, often following a standard + format like 'en-US'. + source: + openapi: ../../../referenced-specs/v2.yml + Locales: + properties: + primary: + type: optional + docs: The primary locale for the site or application. + secondary: + type: optional> + docs: A list of secondary locales available for the site or application. + source: + openapi: ../../../referenced-specs/v2.yml + SiteDataCollectionType: + enum: + - always + - optOut + - disabled + docs: The type of data collection enabled for the site. + source: + openapi: ../../../referenced-specs/v2.yml + Site: + properties: + id: + type: string + docs: Unique identifier for the Site + workspaceId: + type: optional + docs: Unique identifier for the Workspace + createdOn: + type: optional + docs: Date the Site was created + displayName: + type: optional + docs: Name given to Site + shortName: + type: optional + docs: Slugified version of name + lastPublished: + type: optional + docs: Date the Site was last published + lastUpdated: + type: optional + docs: Date the Site was last updated + previewUrl: + type: optional + docs: URL of a generated image for the given Site + validation: + format: uri + timeZone: + type: optional + docs: Site timezone set under Site Settings + parentFolderId: + type: optional + docs: The ID of the parent folder the Site exists in + customDomains: optional> + locales: optional + dataCollectionEnabled: + type: optional + docs: Indicates if data collection is enabled for the site. + dataCollectionType: + type: optional + docs: The type of data collection enabled for the site. + source: + openapi: ../../../referenced-specs/v2.yml + Sites: + properties: + sites: optional> + source: + openapi: ../../../referenced-specs/v2.yml + Domains: + properties: + customDomains: optional> + source: + openapi: ../../../referenced-specs/v2.yml + InvalidDomain: unknown + NoDomains: unknown + SiteActivityLogItemEvent: + enum: + - styles_modified + - site_published + - ix2_modified_on_page + - page_dom_modified + - cms_item + - backup_created + - page_custom_code_modified + - symbols_modified + - variable_modified + - variables_modified + - cms_collection + - page_settings_modified + - page_settings_custom_code_modified + - ix2_modified_on_component + - ix2_modified_on_class + - site_custom_code_modified + - page_duplicated + - secondary_locale_page_content_modified + - page_renamed + - page_created + - page_deleted + - site_unpublished + - backup_restored + - locale_added + - branch_created + - locale_display_name_updated + - locale_subdirectory_updated + - branch_merged + - locale_tag_updated + - branch_deleted + - locale_enabled + - locale_removed + - locale_disabled + - library_shared + - library_unshared + - library_installed + - library_uninstalled + - library_update_shared + - library_update_accepted + - branch_review_created + - branch_review_approved + - branch_review_canceled + source: + openapi: ../../../referenced-specs/v2.yml + SiteActivityLogItemResourceOperation: + enum: + - CREATED + - MODIFIED + - PUBLISHED + - UNPUBLISHED + - DELETED + - GROUP_REORDERED + - GROUP_CREATED + - GROUP_DELETED + - REORDERED + source: + openapi: ../../../referenced-specs/v2.yml + SiteActivityLogItemUser: + properties: + id: optional + displayName: optional + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + SiteActivityLogItem: + properties: + id: optional + createdOn: optional + lastUpdated: optional + event: optional + resourceOperation: optional + user: optional + resourceId: optional + resourceName: optional + newValue: optional + previousValue: optional + payload: optional> + source: + openapi: ../../../referenced-specs/v2.yml + Pagination: + docs: Pagination object + properties: + limit: + type: optional + docs: The limit used for pagination + offset: + type: optional + docs: The offset used for pagination + total: + type: optional + docs: The total number of records + source: + openapi: ../../../referenced-specs/v2.yml + SiteActivityLogResponse: + properties: + items: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + InvalidScopes: unknown + NotEnterprisePlanSite: unknown + CollectionListArrayItem: + docs: A collection object + properties: + id: + type: string + docs: Unique identifier for a Collection + displayName: + type: optional + docs: Name given to the Collection + singularName: + type: optional + docs: >- + The name of one Item in Collection (e.g. ”Blog Post” if the Collection + is called “Blog Posts”) + slug: + type: optional + docs: Slug of Collection in Site URL structure + createdOn: + type: optional + docs: The date the collection was created + lastUpdated: + type: optional + docs: The date the collection was last updated + source: + openapi: ../../../referenced-specs/v2.yml + CollectionList: + properties: + collections: + type: optional> + docs: An array of Collections + source: + openapi: ../../../referenced-specs/v2.yml + FieldType: + enum: + - PlainText + - RichText + - Image + - MultiImage + - Video + - Link + - Email + - Phone + - Number + - DateTime + - Switch + - Color + - ExtFileRef + docs: Choose these appropriate field type for your collection data + source: + openapi: ../../../referenced-specs/v2.yml + Field: + docs: The details of a field in a collection + properties: + id: + type: string + docs: Unique identifier for a Field + isRequired: + type: boolean + docs: define whether a field is required in a collection + isEditable: + type: optional + docs: Define whether the field is editable + type: + type: FieldType + docs: Choose these appropriate field type for your collection data + slug: + type: optional + docs: >- + Slug of Field in Site URL structure. Slugs should be all lowercase + with no spaces. Any spaces will be converted to "-." + displayName: + type: string + docs: The name of a field + helpText: + type: optional + docs: Additional text to help anyone filling out this field + source: + openapi: ../../../referenced-specs/v2.yml + Collection: + docs: A collection object + properties: + id: + type: string + docs: Unique identifier for a Collection + displayName: + type: optional + docs: Name given to the Collection + singularName: + type: optional + docs: >- + The name of one Item in Collection (e.g. ”Blog Post” if the Collection + is called “Blog Posts”) + slug: + type: optional + docs: Slug of Collection in Site URL structure + createdOn: + type: optional + docs: The date the collection was created + lastUpdated: + type: optional + docs: The date the collection was last updated + fields: + docs: The list of fields in the Collection + type: list + source: + openapi: ../../../referenced-specs/v2.yml + CollectionItemFieldData: + properties: + name: + type: optional + docs: Name of the Item + slug: + type: optional + docs: >- + URL structure of the Item in your site. Note: Updates to an item slug + will break all links referencing the old slug. + extra-properties: true + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + CollectionItem: + docs: > + The fields that define the schema for a given Item are based on the + Collection that Item belongs to. Beyond the user defined fields, there are + a handful of additional fields that are automatically created for all + items + properties: + id: + type: string + docs: Unique identifier for the Item + cmsLocaleId: + type: optional + docs: Identifier for the locale of the CMS item + lastPublished: + type: optional + docs: The date the item was last published + lastUpdated: + type: optional + docs: The date the item was last updated + createdOn: + type: optional + docs: The date the item was created + isArchived: + type: optional + docs: Boolean determining if the Item is set to archived + default: false + isDraft: + type: optional + docs: Boolean determining if the Item is set to draft + default: false + fieldData: optional + source: + openapi: ../../../referenced-specs/v2.yml + CollectionItemListPagination: + properties: + limit: + type: optional + docs: The limit specified in the request + default: 100 + offset: + type: optional + docs: The offset specified for pagination + default: 0 + total: + type: optional + docs: Total number of items in the collection + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + CollectionItemList: + docs: Results from collection items list + properties: + items: + type: optional> + docs: List of Items within the collection + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + CollectionItemWithIdInputFieldData: + properties: + name: + type: optional + docs: Name of the Item + slug: + type: optional + docs: >- + URL structure of the Item in your site. Note: Updates to an item slug + will break all links referencing the old slug. + extra-properties: true + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + CollectionItemWithIdInput: + docs: > + The fields that define the schema for a given Item are based on the + Collection that Item belongs to. Beyond the user defined fields, there are + a handful of additional fields that are automatically created for all + items + properties: + id: + type: string + docs: Unique identifier for the Item + cmsLocaleId: + type: optional + docs: Identifier for the locale of the CMS item + lastPublished: + type: optional + docs: The date the item was last published + lastUpdated: + type: optional + docs: The date the item was last updated + createdOn: + type: optional + docs: The date the item was created + isArchived: + type: optional + docs: Boolean determining if the Item is set to archived + default: false + isDraft: + type: optional + docs: Boolean determining if the Item is set to draft + default: false + fieldData: optional + source: + openapi: ../../../referenced-specs/v2.yml + CollectionItemListNoPagination: + docs: Results from collection items list + properties: + items: + type: optional> + docs: List of Items within the collection + source: + openapi: ../../../referenced-specs/v2.yml + BulkCollectionItemFieldData: + properties: + name: + type: optional + docs: Name of the Item + slug: + type: optional + docs: >- + URL structure of the Item in your site. Note: Updates to an item slug + will break all links referencing the old slug. + extra-properties: true + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + BulkCollectionItem: + docs: > + The fields that define the schema for a given Item are based on the + Collection that Item belongs to. Beyond the user defined fields, there are + a handful of additional fields that are automatically created for all + items + properties: + id: + type: string + docs: Unique identifier for the Item + cmsLocaleIds: + type: optional> + docs: Array of identifiers for the locales where the item will be created + lastPublished: + type: optional + docs: The date the item was last published + lastUpdated: + type: optional + docs: The date the item was last updated + createdOn: + type: optional + docs: The date the item was created + isArchived: + type: optional + docs: Boolean determining if the Item is set to archived + default: false + isDraft: + type: optional + docs: Boolean determining if the Item is set to draft + default: false + fieldData: optional + source: + openapi: ../../../referenced-specs/v2.yml + PageSeo: + docs: SEO-related fields for the Page + properties: + title: + type: optional + docs: The Page title shown in search engine results + description: + type: optional + docs: The Page description shown in search engine results + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + PageOpenGraph: + docs: Open Graph fields for the Page + properties: + title: + type: optional + docs: The title supplied to Open Graph annotations + titleCopied: + type: optional + docs: Indicates the Open Graph title was copied from the SEO title + default: true + description: + type: optional + docs: The description supplied to Open Graph annotations + descriptionCopied: + type: optional + docs: >- + Indicates the Open Graph description was copied from the SEO + description + default: true + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + Page: + docs: The Page object + properties: + id: + type: string + docs: Unique identifier for the Page + siteId: + type: optional + docs: Unique identifier for the Site + title: + type: optional + docs: Title of the Page + slug: + type: optional + docs: slug of the Page (derived from title) + parentId: + type: optional + docs: Identifier of the parent folder + collectionId: + type: optional + docs: >- + Unique identifier for a linked Collection, value will be null if the + Page is not part of a Collection. + createdOn: + type: optional + docs: The date the Page was created + lastUpdated: + type: optional + docs: The date the Page was most recently updated + archived: + type: optional + docs: Whether the Page has been archived + default: false + draft: + type: optional + docs: Whether the Page is a draft + default: false + canBranch: + type: optional + docs: >- + Indicates whether the Page supports [Page + Branching](https://university.webflow.com/lesson/page-branching) + default: false + isBranch: + type: optional + docs: >- + Indicates whether the Page is a Branch of another Page [Page + Branching](https://university.webflow.com/lesson/page-branching) + default: false + isMembersOnly: + type: optional + docs: >- + Indicates whether the Page is restricted by [Memberships + Controls](https://university.webflow.com/lesson/webflow-memberships-overview#how-to-manage-page-restrictions) + default: false + seo: + type: optional + docs: SEO-related fields for the Page + openGraph: + type: optional + docs: Open Graph fields for the Page + localeId: + type: optional + docs: Unique ID of the page locale + publishedPath: + type: optional + docs: Relative path of the published page URL + source: + openapi: ../../../referenced-specs/v2.yml + PageList: + docs: The Page object + properties: + pages: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + TextNode: + docs: > + Represents textual content within the DOM. It contains both the raw text + and its HTML representation, allowing for flexibility in rendering and + processing. Additional attributes can be associated with the text for + styling or other purposes. + properties: + html: optional + text: optional + source: + openapi: ../../../referenced-specs/v2.yml + ImageNode: + docs: > + Represents an image within the DOM. It contains details about the image, + such as its alternative text (alt) for accessibility and an asset + identifier for fetching the actual image resource. Additional attributes + can be associated with the image for styling or other purposes. + properties: + alt: optional + assetId: optional + source: + openapi: ../../../referenced-specs/v2.yml + NodeType: + enum: + - text + - image + source: + openapi: ../../../referenced-specs/v2.yml + Node: + docs: > + A generic representation of a content element within the Document Object + Model (DOM). Each node has a unique identifier and a specific type that + determines its content structure and attributes. + properties: + id: + type: optional + docs: Node UUID + type: optional + text: optional + image: optional + attributes: + type: optional> + docs: The custom attributes of the node + source: + openapi: ../../../referenced-specs/v2.yml + Dom: + docs: > + The DOM (Document Object Model) schema represents the content structure of + a web page. It captures various content nodes, such as text and images, + along with their associated attributes. Each node has a unique identifier + and can be of different types like text or image. The schema also provides + pagination details for scenarios where the content nodes are too many to + be fetched in a single request. + properties: + pageId: + type: optional + docs: Page ID + nodes: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + ScriptApplyLocation: + enum: + - header + - footer + docs: >- + Location of the script, either in the header or footer of the published + site + default: header + source: + openapi: ../../../referenced-specs/v2.yml + ScriptApply: + properties: + id: + type: string + docs: ID of the registered custom code script + location: + type: ScriptApplyLocation + docs: >- + Location of the script, either in the header or footer of the + published site + default: header + version: + type: string + docs: Semantic Version String for the registered script *e.g. 0.0.1* + attributes: + type: optional> + docs: >- + Developer-specified key/value pairs to be applied as attributes to the + script + source: + openapi: ../../../referenced-specs/v2.yml + ScriptApplyList: + properties: + scripts: + type: optional> + docs: A list of scripts applied to a Site or a Page + lastUpdated: + type: optional + docs: Date when the Site's scripts were last updated + createdOn: + type: optional + docs: Date when the Site's scripts were created + source: + openapi: ../../../referenced-specs/v2.yml + CustomCodeHostedResponse: + docs: Registered custom code for application + properties: + id: + type: optional + docs: Human readable id, derived from the user-specified display name + canCopy: + type: optional + docs: >- + Define whether the script can be copied on site duplication and + transfer + default: false + displayName: + type: optional + docs: >- + User-facing name for the script. Must be between 1 and 50 alphanumeric + characters + hostedLocation: + type: optional + docs: URI for an externally hosted script location + integrityHash: + type: optional + docs: >- + Sub-Resource Integrity Hash. Only required for externally hosted + scripts (passed via hostedLocation) + createdOn: + type: optional + docs: Timestamp when the script version was created + lastUpdated: + type: optional + docs: Timestamp when the script version was last updated + version: + type: optional + docs: A Semantic Version (SemVer) string, denoting the version of the script + source: + openapi: ../../../referenced-specs/v2.yml + RegisteredScriptList: + docs: A list of scripts registered to the site + properties: + registeredScripts: optional> + source: + openapi: ../../../referenced-specs/v2.yml + CustomCodeInlineResponse: + docs: Registered custom code for application + properties: + id: + type: optional + docs: Human readable id, derived from the user-specified display name + canCopy: + type: optional + docs: >- + Define whether the script can be copied on site duplication and + transfer + default: false + displayName: + type: optional + docs: >- + User-facing name for the script. Must be between 1 and 50 alphanumeric + characters + hostedLocation: + type: optional + docs: URI for an externally hosted script location + integrityHash: + type: optional + docs: >- + Sub-Resource Integrity Hash. Only required for externally hosted + scripts (passed via hostedLocation) + createdOn: + type: optional + docs: Timestamp when the script version was created + lastUpdated: + type: optional + docs: Timestamp when the script version was last updated + version: + type: optional + docs: A Semantic Version (SemVer) string, denoting the version of the script + source: + openapi: ../../../referenced-specs/v2.yml + Scripts: + docs: A list of scripts applied to a Site or a Page + type: list + CustomCodeBlockType: + enum: + - page + - site + docs: Whether the Custom Code script is applied at the Site-level or Page-level + source: + openapi: ../../../referenced-specs/v2.yml + CustomCodeBlock: + docs: A specific instance of Custom Code applied to a Site or Page + properties: + siteId: + type: optional + docs: The Site ID where the custom code was applied + pageId: + type: optional + docs: The Page ID (if applied at Page-level) + type: + type: optional + docs: >- + Whether the Custom Code script is applied at the Site-level or + Page-level + scripts: optional + createdOn: + type: optional + docs: The date the Block was created + lastUpdated: + type: optional + docs: The date the Block was most recently updated + source: + openapi: ../../../referenced-specs/v2.yml + ListCustomCodeBlocks: + docs: Custom Code Blocks corresponding to where scripts were applied + properties: + blocks: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + AssetVariant: + properties: + hostedUrl: + type: optional + docs: URL of where the asset variant is hosted + validation: + format: uri + originalFileName: + type: optional + docs: Original file name of the variant + displayName: + type: optional + docs: Display name of the variant + format: + type: optional + docs: format of the variant + width: + type: optional + docs: Width in pixels + height: + type: optional + docs: Height in pixels + quality: + type: optional + docs: Value between 0 and 100 representing the image quality + error: + type: optional + docs: Any associated validation errors + source: + openapi: ../../../referenced-specs/v2.yml + Asset: + properties: + id: + type: optional + docs: Unique identifier for this asset + contentType: + type: optional + docs: File format type + size: + type: optional + docs: size in bytes + siteId: + type: optional + docs: Unique identifier for the site that hosts this asset + hostedUrl: + type: optional + docs: Link to the asset + validation: + format: uri + originalFileName: + type: optional + docs: Original file name at the time of upload + displayName: + type: optional + docs: Display name of the asset + lastUpdated: + type: optional + docs: Date the asset metadata was last updated + createdOn: + type: optional + docs: Date the asset metadata was created + variants: optional> + altText: + type: optional + docs: The visual description of the asset + source: + openapi: ../../../referenced-specs/v2.yml + Assets: + docs: A list of assets + properties: + assets: optional> + source: + openapi: ../../../referenced-specs/v2.yml + AssetUploadUploadDetails: + docs: Metadata for uploading the asset binary + properties: + acl: optional + bucket: optional + X-Amz-Algorithm: optional + X-Amz-Credential: optional + X-Amz-Date: optional + key: optional + Policy: optional + X-Amz-Signature: optional + success_action_status: optional + content-type: optional + Cache-Control: optional + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + AssetUpload: + properties: + uploadDetails: + type: optional + docs: Metadata for uploading the asset binary + contentType: optional + id: optional + parentFolder: + type: optional + docs: Parent folder for the asset + uploadUrl: + type: optional + validation: + format: uri + assetUrl: + type: optional + docs: S3 link to the asset + validation: + format: uri + hostedUrl: + type: optional + docs: Represents the link to the asset + validation: + format: uri + originalFileName: + type: optional + docs: >- + Original file name when uploaded. If not specified at time of upload, + it may be extracted from the raw file name + createdOn: + type: optional + docs: Date the asset metadata was created + lastUpdated: + type: optional + docs: Date the asset metadata was last updated + source: + openapi: ../../../referenced-specs/v2.yml + AssetFolder: + docs: Asset Folder details + properties: + id: + type: optional + docs: Unique identifier for the Asset Folder + displayName: + type: optional + docs: User visible name for the Asset Folder + parentFolder: + type: optional + docs: Pointer to parent Asset Folder (or null if root) + assets: + type: optional> + docs: Array of Asset instances in the folder + siteId: + type: optional + docs: The unique ID of the site the Asset Folder belongs to + createdOn: + type: optional + docs: Date that the Asset Folder was created on + lastUpdated: + type: optional + docs: Date that the Asset Folder was last updated on + source: + openapi: ../../../referenced-specs/v2.yml + AssetFolderList: + docs: The Asset Folders object + properties: + assetFolders: + type: optional> + docs: A list of Asset folders + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + TriggerType: + enum: + - form_submission + - site_publish + - page_created + - page_metadata_updated + - page_deleted + - ecomm_new_order + - ecomm_order_changed + - ecomm_inventory_changed + - user_account_added + - user_account_updated + - user_account_deleted + - collection_item_created + - collection_item_changed + - collection_item_deleted + - collection_item_unpublished + docs: > + * `form_submission` - Sends the [form_submission](#form_submission) event + + * `site_publish` - Sends a [site_publish](#site_publish) event + + * `page_created` - Send the [page_created](#page_created) event + + * `page_metadata_updated` - Sends the + [page_metadata_updated](#page_metadata_updated) event + + * `page_deleted` - Sends the [page_deleted](#page_deleted) event + + * `ecomm_new_order` - Sends the new [ecomm_new_order](#ecomm_new_order) + event + + * `ecomm_order_changed` - Sends the + [ecomm_order_changed](#ecomm_order_changed) event + + * `ecomm_inventory_changed` - Sends the + [ecomm_inventory_changed](#ecomm_inventory_changed) event + + * `user_account_added` - Sends the + [user_account_added](#user_account_added) event + + * `user_account_updated` - Sends the + [user_account_updated](#user_account_updated) event + + * `user_account_deleted` - Sends the + [user_account_deleted](#user_account_deleted) event + + * `collection_item_created` - Sends the + [collection_item_created](#collection_item_created) event + + * `collection_item_changed` - Sends the + [collection_item_changed](#collection_item_changed) event + + * `collection_item_deleted` - Sends the + [collection_item_deleted](#collection_item_deleted) event + + * `collection_item_unpublished` - Sends the + [collection_item_unpublished](#collection_item_unpublished) event + source: + openapi: ../../../referenced-specs/v2.yml + WebhookFilter: + docs: >- + Only supported for the `form_submission` trigger type. Filter for the form + you want Webhooks to be sent for. + properties: + name: + type: optional + docs: The name of the form you'd like to recieve notifications for. + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + Webhook: + properties: + id: + type: optional + docs: Unique identifier for the Webhook registration + triggerType: optional + url: + type: optional + docs: URL to send the Webhook payload to + workspaceId: + type: optional + docs: Unique identifier for the Workspace the Webhook is registered in + siteId: + type: optional + docs: Unique identifier for the Site the Webhook is registered in + filter: + type: optional + docs: >- + Only supported for the `form_submission` trigger type. Filter for the + form you want Webhooks to be sent for. + lastTriggered: + type: optional + docs: Date the Webhook instance was last triggered + createdOn: + type: optional + docs: Date the Webhook registration was created + source: + openapi: ../../../referenced-specs/v2.yml + WebhookList: + properties: + pagination: optional + webhooks: optional> + source: + openapi: ../../../referenced-specs/v2.yml + FormFieldValueType: + enum: + - Plain + - Email + - Password + - Phone + - Number + docs: The field type + source: + openapi: ../../../referenced-specs/v2.yml + FormFieldValue: + docs: An object containing field info for a specific fieldID. + properties: + displayName: + type: optional + docs: The field name displayed on the site + type: + type: optional + docs: The field type + placeholder: + type: optional + docs: The placeholder text for the field + userVisible: + type: optional + docs: Whether the field is visible to the user + source: + openapi: ../../../referenced-specs/v2.yml + FormField: + type: map + docs: A collection of form fields with additional properties. + FormResponseSettings: + docs: Settings for form responses + properties: + redirectUrl: + type: optional + docs: The url or path to redirect the user to after form submission + redirectMethod: + type: optional + docs: The HTTP request method to use for the redirectUrl (eg. POST or GET) + redirectAction: + type: optional + docs: The action to take after form submission + sendEmailConfirmation: + type: optional + docs: Whether to send an email confirmation to the user + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + Form: + docs: A Webflow form + properties: + displayName: + type: optional + docs: The Form name displayed on the site + createdOn: + type: optional + docs: Date that the Form was created on + lastUpdated: + type: optional + docs: Date that the Form was last updated on + fields: + type: optional + docs: A collection of form field objects + responseSettings: + type: optional + docs: Settings for form responses + id: + type: optional + docs: The unique ID for the Form + siteId: + type: optional + docs: The unique ID of the Site the Form belongs to + siteDomainId: + type: optional + docs: The unique ID corresponding to the site's Domain name + pageId: + type: optional + docs: The unique ID for the Page on which the Form is placed + pageName: + type: optional + docs: The user-visible name of the Page where the Form is placed + formElementId: + type: optional + docs: The unique ID of the Form element + workspaceId: + type: optional + docs: The unique ID of the Workspace the Site belongs to + source: + openapi: ../../../referenced-specs/v2.yml + FormList: + properties: + forms: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + FormSubmission: + properties: + id: + type: optional + docs: The unique ID of the Form submission + displayName: + type: optional + docs: The Form name displayed on the site + siteId: + type: optional + docs: The unique ID of the Site the Form belongs to + workspaceId: + type: optional + docs: The unique ID of the Workspace the Site belongs to + dateSubmitted: + type: optional + docs: Date that the Form was submitted on + formResponse: + type: optional> + docs: The data submitted in the Form + source: + openapi: ../../../referenced-specs/v2.yml + FormSubmissionList: + properties: + formSubmissions: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + UserDataData: + properties: + name: + type: optional + docs: | + The name of the user + email: + type: optional + docs: | + The email address of the user + accept-privacy: + type: optional + docs: | + Boolean indicating if the user has accepted the privacy policy + accept-communications: + type: optional + docs: | + Boolean indicating if the user has accepted to receive communications + additionalProperties: + type: optional + docs: Custom user attributes + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + UserData: + docs: An object containing the User's basic info and custom fields + properties: + data: optional + source: + openapi: ../../../referenced-specs/v2.yml + UserStatus: + enum: + - invited + - verified + - unverified + docs: The status of the user + source: + openapi: ../../../referenced-specs/v2.yml + UserAccessGroupsItemType: + enum: + - admin + - ecommerce + docs: | + The type of access group based on how it was assigned to the user. + * `admin` - Assigned to the user via API or in the designer + * `ecommerce` - Assigned to the user via an ecommerce purchase + source: + openapi: ../../../referenced-specs/v2.yml + UserAccessGroupsItem: + docs: Access group slugs and types + properties: + slug: + type: optional + docs: Access group identifier for APIs + type: + type: optional + docs: | + The type of access group based on how it was assigned to the user. + * `admin` - Assigned to the user via API or in the designer + * `ecommerce` - Assigned to the user via an ecommerce purchase + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + User: + docs: > + The fields that define the schema for a given Item are based on the + Collection that Item belongs to. Beyond the user defined fields, there are + a handful of additional fields that are automatically created for all + items + properties: + id: + type: optional + docs: Unique identifier for the User + isEmailVerified: + type: optional + docs: Shows whether the user has verified their email address + lastUpdated: + type: optional + docs: The timestamp the user was updated + invitedOn: + type: optional + docs: The timestamp the user was invited + createdOn: + type: optional + docs: The timestamp the user was created + lastLogin: + type: optional + docs: The timestamp the user was logged in + status: + type: optional + docs: The status of the user + accessGroups: + type: optional> + docs: Access groups the user belongs to + data: optional + source: + openapi: ../../../referenced-specs/v2.yml + UserList: + docs: The list users results + properties: + count: + type: optional + docs: Number of users returned + limit: + type: optional + docs: The limit specified in the request + default: 10 + offset: + type: optional + docs: The offset specified for pagination + default: 0 + total: + type: optional + docs: Total number of users in the collection + users: + type: optional> + docs: List of Users for a Site + source: + openapi: ../../../referenced-specs/v2.yml + UsersNotEnabled: unknown + DuplicateUserEmail: unknown + UserLimitReached: unknown + AccessGroup: + properties: + id: + type: optional + docs: Unique identifier for the Access Group + name: + type: optional + docs: Name of the the Access Group + shortId: + type: optional + docs: >- + Shortened unique identifier based on name, optimized for its use in + the user’s JWT + slug: + type: optional + docs: >- + Shortened unique identifier based on name, optimized for human + readability and public API use + createdOn: + type: optional + docs: The date the Access Group was created + source: + openapi: ../../../referenced-specs/v2.yml + AccessGroupList: + docs: The list access groups results + properties: + count: + type: optional + docs: Number of access groups returned + limit: + type: optional + docs: The limit specified in the request + default: 10 + offset: + type: optional + docs: The offset specified for pagination + default: 0 + total: + type: optional + docs: Total number of access groups in the collection + accessGroups: + type: optional> + docs: List of Site Access Groups + source: + openapi: ../../../referenced-specs/v2.yml + SkuPropertyListEnumItem: + docs: Enumerated Product variants/Options for the SKU + properties: + id: + type: string + docs: Unique identifier for a Product variant/Option + name: + type: string + docs: Name of the Product variant/Option + slug: + type: string + docs: Slug for the Product variant/Option in the Site URL structure + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + SkuPropertyList: + docs: A variant/option type for a SKU + properties: + id: + type: string + docs: Unique identifier for a collection of Product Variants + name: + type: string + docs: Name of the collection of Product Variants + enum: + docs: >- + The individual Product variants that are contained within the + collection + type: list + source: + openapi: ../../../referenced-specs/v2.yml + ProductFieldDataTaxCategory: + enum: + - value: standard-taxable + name: StandardTaxable + - value: standard-exempt + name: StandardExempt + - value: books-religious + name: BooksReligious + - value: books-textbook + name: BooksTextbook + - clothing + - value: clothing-swimwear + name: ClothingSwimwear + - value: digital-goods + name: DigitalGoods + - value: digital-service + name: DigitalService + - value: drugs-non-prescription + name: DrugsNonPrescription + - value: drugs-prescription + name: DrugsPrescription + - value: food-bottled-water + name: FoodBottledWater + - value: food-candy + name: FoodCandy + - value: food-groceries + name: FoodGroceries + - value: food-prepared + name: FoodPrepared + - value: food-soda + name: FoodSoda + - value: food-supplements + name: FoodSupplements + - value: magazine-individual + name: MagazineIndividual + - value: magazine-subscription + name: MagazineSubscription + - value: service-admission + name: ServiceAdmission + - value: service-advertising + name: ServiceAdvertising + - value: service-dry-cleaning + name: ServiceDryCleaning + - value: service-hairdressing + name: ServiceHairdressing + - value: service-installation + name: ServiceInstallation + - value: service-miscellaneous + name: ServiceMiscellaneous + - value: service-parking + name: ServiceParking + - value: service-printing + name: ServicePrinting + - value: service-professional + name: ServiceProfessional + - value: service-repair + name: ServiceRepair + - value: service-training + name: ServiceTraining + docs: Product tax class + source: + openapi: ../../../referenced-specs/v2.yml + ProductFieldDataEcProductType: + enum: + - ff42fee0113744f693a764e3431a9cc2 + - f22027db68002190aef89a4a2b7ac8a1 + - c599e43b1a1c34d5a323aedf75d3adf6 + - b6ccc1830db4b1babeb06a9ac5f6dd76 + docs: >- + Product + types. Enums reflect the following values in order: Physical, Digital, + Service, Advanced" + source: + openapi: ../../../referenced-specs/v2.yml + ProductFieldData: + docs: >- + Contains content-specific details for a product, covering both standard + (e.g., title, description) and custom fields tailored to the product + setup. + properties: + name: + type: optional + docs: Name of the Product + slug: + type: optional + docs: URL structure of the Product in your site. + description: + type: optional + docs: A description of your product + shippable: + type: optional + docs: Boolean determining if the Product is shippable + sku-properties: + type: optional> + docs: Variant types to include in SKUs + categories: + type: optional> + docs: The categories your product belongs to. + tax-category: + type: optional + docs: Product tax class + default-sku: + type: optional + docs: The default SKU associated with this product. + ec-product-type: + type: optional + docs: >- + Product + types. Enums reflect the following values in order: Physical, + Digital, Service, Advanced" + source: + openapi: ../../../referenced-specs/v2.yml + Product: + docs: The Product object + properties: + id: + type: optional + docs: Unique identifier for the Product + cmsLocaleId: + type: optional + docs: Identifier for the locale of the CMS item + lastPublished: + type: optional + docs: The date the Product was last published + lastUpdated: + type: optional + docs: The date the Product was last updated + createdOn: + type: optional + docs: The date the Product was created + isArchived: + type: optional + docs: Boolean determining if the Product is set to archived + default: false + isDraft: + type: optional + docs: Boolean determining if the Product is set to draft + default: false + fieldData: optional + source: + openapi: ../../../referenced-specs/v2.yml + SkuValueList: + type: map + docs: > + A dictionary that maps a SKU property to a SKU value. The key of the + dictionary is the SKU property ID, and the value is the SKU value ID. + SkuFieldDataPrice: + docs: price of SKU + properties: + value: + type: optional + docs: Price of SKU + unit: + type: optional + docs: Currency of Item + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + SkuFieldDataCompareAtPrice: + docs: comparison price of SKU + properties: + value: + type: optional + docs: Price of SKU + unit: + type: optional + docs: Currency of Item + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + SkuFieldDataEcSkuBillingMethod: + enum: + - value: one-time + name: OneTime + - subscription + source: + openapi: ../../../referenced-specs/v2.yml + SkuFieldDataEcSkuSubscriptionPlanInterval: + enum: + - day + - week + - month + - year + docs: Interval of subscription renewal + source: + openapi: ../../../referenced-specs/v2.yml + SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus: + enum: + - active + - inactive + - canceled + docs: The status of the plan + source: + openapi: ../../../referenced-specs/v2.yml + SkuFieldDataEcSkuSubscriptionPlanPlansItem: + properties: + platform: + type: optional> + docs: The platform of the subscription plan + id: + type: optional + docs: The unique identifier of the plan + status: + type: optional + docs: The status of the plan + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + SkuFieldDataEcSkuSubscriptionPlan: + properties: + interval: + type: optional + docs: Interval of subscription renewal + frequency: + type: optional + docs: Frequncy of billing within interval + trial: + type: optional + docs: Number of days of a trial + plans: optional> + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + SkuFieldData: + docs: Standard and Custom fields for a SKU + properties: + sku-values: optional + name: + type: string + docs: Name of the Product + slug: + type: string + docs: URL structure of the Product in your site. + price: + type: SkuFieldDataPrice + docs: price of SKU + compare-at-price: + type: optional + docs: comparison price of SKU + ec-sku-billing-method: optional + ec-sku-subscription-plan: optional + track-inventory: + type: optional + docs: >- + A boolean indicating whether inventory for this product should be + tracked. + default: false + quantity: + type: optional + docs: Quantity of SKU that will be tracked as items are ordered. + source: + openapi: ../../../referenced-specs/v2.yml + Sku: + docs: The SKU object + properties: + id: + type: optional + docs: Unique identifier for the Product + cmsLocaleId: + type: optional + docs: Identifier for the locale of the CMS item + lastPublished: + type: optional + docs: The date the Product was last published + lastUpdated: + type: optional + docs: The date the Product was last updated + createdOn: + type: optional + docs: The date the Product was created + fieldData: optional + source: + openapi: ../../../referenced-specs/v2.yml + ProductAndSkUs: + docs: A product and its SKUs. + properties: + product: optional + skus: + type: optional> + docs: A list of SKU Objects + source: + openapi: ../../../referenced-specs/v2.yml + ProductAndSkUsList: + docs: Results from product list + properties: + items: + type: optional> + docs: >- + List of Item objects within the Collection. Contains product and skus + keys for each Item + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + PublishStatus: + enum: + - staging + - live + docs: Indicate whether your Product should be set as "staging" or "live" + default: staging + source: + openapi: ../../../referenced-specs/v2.yml + OrderPrice: + properties: + unit: + type: optional + docs: The three-letter ISO currency code + value: + type: optional + docs: The numeric value in the base unit of the currency + string: + type: optional + docs: The user-facing string representation of the amount + source: + openapi: ../../../referenced-specs/v2.yml + OrderAddressType: + enum: + - shipping + - billing + docs: The type of the order address (billing or shipping) + source: + openapi: ../../../referenced-specs/v2.yml + OrderAddressJapanType: + enum: + - kana + - kanji + docs: >- + Represents a Japan-only address format. This field will only appear on + orders placed from Japan. + source: + openapi: ../../../referenced-specs/v2.yml + OrderAddress: + docs: A customer address + properties: + type: + type: optional + docs: The type of the order address (billing or shipping) + japanType: + type: optional + docs: >- + Represents a Japan-only address format. This field will only appear on + orders placed from Japan. + addressee: + type: optional + docs: Display name on the address + line1: + type: optional + docs: The first line of the address + line2: + type: optional + docs: The second line of the address + city: + type: optional + docs: The city of the address. + state: + type: optional + docs: The state or province of the address + country: + type: optional + docs: The country of the address + postalCode: + type: optional + docs: The postal code of the address + source: + openapi: ../../../referenced-specs/v2.yml + OrderPurchasedItemVariantImageFileVariantsItem: + properties: + url: + type: optional + docs: The hosted location for the Variant's image + validation: + format: uri + originalFileName: optional + size: + type: optional + docs: The image size in bytes + width: + type: optional + docs: The image width in pixels + height: + type: optional + docs: The image height in pixels + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + OrderPurchasedItemVariantImageFile: + properties: + size: + type: optional + docs: The image size in bytes + originalFileName: + type: optional + docs: the original name of the image + createdOn: + type: optional + docs: The creation timestamp of the image + contentType: + type: optional + docs: The MIME type of the image + width: + type: optional + docs: The image width in pixels + height: + type: optional + docs: The image height in pixels + variants: + type: optional> + docs: Variants of the supplied image + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + OrderPurchasedItemVariantImage: + properties: + url: + type: optional + docs: The hosted location for the Variant's image + validation: + format: uri + file: optional + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + OrderPurchasedItem: + docs: An Item that was purchased + properties: + count: + type: optional + docs: Number of Item purchased. + rowTotal: + type: optional + docs: The total for the row + productId: + type: optional + docs: The unique identifier for the Product + productName: + type: optional + docs: User-facing name of the Product + productSlug: + type: optional + docs: Slug for the Product + variantId: + type: optional + docs: Identifier for the Product Variant (SKU) + variantName: + type: optional + docs: User-facing name of the Product Variant (SKU) + variantSlug: + type: optional + docs: Slug for the Product Variant (SKU) + variantSKU: + type: optional + docs: The user-defined custom SKU of the Product Variant (SKU) + variantImage: optional + variantPrice: + type: optional + docs: The price corresponding to the variant + weight: + type: optional + docs: The physical weight of the variant if provided, or null + width: + type: optional + docs: The physical width of the variant if provided, or null + height: + type: optional + docs: The physical height of the variant if provided, or null + length: + type: optional + docs: The physical length of the variant if provided, or null + source: + openapi: ../../../referenced-specs/v2.yml + StripeDetails: + docs: >- + An object with various Stripe IDs, useful for linking into the stripe + dashboard. + properties: + subscriptionId: + type: optional + docs: Stripe-generated identifier for the Subscription + paymentMethod: + type: optional + docs: Stripe-generated identifier for the PaymentMethod used + paymentIntentId: + type: optional + docs: Stripe-generated identifier for the PaymentIntent, or null + customerId: + type: optional + docs: Stripe-generated customer identifier, or null + chargeId: + type: optional + docs: Stripe-generated charge identifier, or null + disputeId: + type: optional + docs: Stripe-generated dispute identifier, or null + refundId: + type: optional + docs: Stripe-generated refund identifier, or null + refundReason: + type: optional + docs: Stripe-generated refund reason, or null + source: + openapi: ../../../referenced-specs/v2.yml + StripeCardBrand: + enum: + - Visa + - value: American Express + name: AmericanExpress + - MasterCard + - Discover + - JCB + - value: Diners Club + name: DinersClub + - Unknown + docs: The card's brand (ie. credit card network) + source: + openapi: ../../../referenced-specs/v2.yml + StripeCardExpires: + docs: The card's expiration date. + properties: + year: + type: optional + docs: Year that the card expires + month: + type: optional + docs: Month that the card expires + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + StripeCard: + docs: > + Details on the card used to fulfill this order, if this order was + finalized with Stripe. + properties: + last4: + type: optional + docs: The last 4 digits on the card as a string + brand: + type: optional + docs: The card's brand (ie. credit card network) + ownerName: + type: optional + docs: The name on the card. + expires: + type: optional + docs: The card's expiration date. + source: + openapi: ../../../referenced-specs/v2.yml + PaypalDetails: + properties: + orderId: + type: optional + docs: PayPal order identifier + payerId: + type: optional + docs: PayPal payer identifier + captureId: + type: optional + docs: PayPal capture identifier + refundId: + type: optional + docs: PayPal refund identifier + refundReason: + type: optional + docs: PayPal-issued reason for the refund + disputeId: + type: optional + docs: PayPal dispute identifier + source: + openapi: ../../../referenced-specs/v2.yml + OrderStatus: + enum: + - pending + - unfulfilled + - fulfilled + - disputed + - value: dispute-lost + name: DisputeLost + - refunded + docs: | + The status of the Order + source: + openapi: ../../../referenced-specs/v2.yml + OrderDisputeLastStatus: + enum: + - warning_needs_response + - warning_under_review + - warning_closed + - needs_response + - under_review + - charge_refunded + - won + - lost + docs: > + If an order was disputed by the customer, then this key will be set with + the [dispute's status](https://stripe.com/docs/api#dispute_object-status). + source: + openapi: ../../../referenced-specs/v2.yml + OrderCustomerInfo: + docs: An object with the keys `fullName` and `email`. + properties: + fullName: + type: optional + docs: The full name of the Customer + email: + type: optional + docs: The Customer's email address + validation: + format: email + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + OrderMetadata: + properties: + isBuyNow: optional + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + OrderTotalsExtrasItemType: + enum: + - discount + - value: discount-shipping + name: DiscountShipping + - shipping + - tax + docs: The type of extra item this is. + source: + openapi: ../../../referenced-specs/v2.yml + OrderTotalsExtrasItem: + docs: Extra order items, includes discounts, shipping, and taxes. + properties: + type: + type: optional + docs: The type of extra item this is. + name: + type: optional + docs: A human-readable (but English) name for this extra charge. + description: + type: optional + docs: A human-readable (but English) description of this extra charge. + price: + type: optional + docs: The price for the item + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + OrderTotals: + docs: An object describing various pricing totals + properties: + subtotal: + type: optional + docs: The subtotal price + extras: + type: optional> + docs: An array of extra items, includes discounts, shipping, and taxes. + total: + type: optional + docs: The total price + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + OrderDownloadFilesItem: + properties: + id: + type: optional + docs: The unique identifier for the downloadable file + name: + type: optional + docs: The user-facing name for the downloadable file + url: + type: optional + docs: The hosted location for the downloadable file + validation: + format: uri + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + Order: + properties: + orderId: + type: optional + docs: | + The order ID. Will usually be 6 hex characters, but can also be 9 + hex characters if the site has a very large number of Orders. + Randomly assigned. + status: + type: optional + docs: | + The status of the Order + comment: + type: optional + docs: >- + A comment string for this Order, which is editable by API user (not + used by Webflow). + orderComment: + type: optional + docs: A comment that the customer left when making their Order + acceptedOn: + type: optional + docs: The ISO8601 timestamp that an Order was placed. + fulfilledOn: + type: optional + docs: > + When an Order is marked as 'fulfilled', this field represents the + timestamp of the fulfillment in ISO8601 format. Otherwise, it is null. + refundedOn: + type: optional + docs: >- + When an Order is marked as 'refunded', this field represents the + timestamp of the fulfillment in ISO8601 format. Otherwise, it is null. + disputedOn: + type: optional + docs: > + When an Order is marked as 'disputed', this field represents the + timestamp of the fulfillment in ISO8601 format. Otherwise, it is null. + disputeUpdatedOn: + type: optional + docs: > + If an Order has been disputed by the customer, this key will be set to + the ISO8601 timestamp of the last update received. If the Order is not + disputed, the key will be null. + disputeLastStatus: + type: optional + docs: > + If an order was disputed by the customer, then this key will be set + with the [dispute's + status](https://stripe.com/docs/api#dispute_object-status). + customerPaid: + type: optional + docs: The total paid by the customer + netAmount: + type: optional + docs: The net amount after application fees + applicationFee: + type: optional + docs: The application fee assessed by the platform + allAddresses: + type: optional> + docs: All addresses provided by the customer during the ordering flow. + shippingAddress: + type: optional + docs: The shipping address + billingAddress: + type: optional + docs: The billing address + shippingProvider: + type: optional + docs: > + A string editable by the API user to note the shipping provider used + (not used by Webflow). + shippingTracking: + type: optional + docs: > + A string editable by the API user to note the shipping tracking number + for the order (not used by Webflow). + shippingTrackingURL: + type: optional + validation: + format: uri + customerInfo: + type: optional + docs: An object with the keys `fullName` and `email`. + purchasedItems: + type: optional> + docs: An array of all things that the Customer purchased. + purchasedItemsCount: + type: optional + docs: The sum of all 'count' fields in 'purchasedItems'. + stripeDetails: optional + stripeCard: optional + paypalDetails: optional + customData: + type: optional>> + docs: > + An array of additional inputs for custom order data gathering. Each + object in the array represents an input with a name, and a textInput, + textArea, or checkbox value. + metadata: optional + isCustomerDeleted: + type: optional + docs: > + A boolean indicating whether the customer has been deleted from the + site. + isShippingRequired: + type: optional + docs: > + A boolean indicating whether the order contains one or more purchased + items that require shipping. + hasDownloads: + type: optional + docs: > + A boolean indicating whether the order contains one or more purchased + items that are downloadable. + paymentProcessor: + type: optional + docs: | + A string indicating the payment processor used for this order. + totals: + type: optional + docs: An object describing various pricing totals + downloadFiles: + type: optional> + docs: An array of downloadable file objects. + source: + openapi: ../../../referenced-specs/v2.yml + OrderList: + docs: Results from order list + properties: + orders: + type: optional> + docs: List of orders + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + InventoryItemInventoryType: + enum: + - infinite + - finite + docs: infinite or finite + source: + openapi: ../../../referenced-specs/v2.yml + InventoryItem: + docs: The availabile inventory for an item + properties: + id: + type: optional + docs: Unique identifier for a SKU item + quantity: + type: optional + docs: >- + Total quantity of items remaining in inventory (if inventoryType is + finite) + inventoryType: + type: optional + docs: infinite or finite + source: + openapi: ../../../referenced-specs/v2.yml + EcommerceSettings: + docs: Ecommerce settings for a Webflow Site + properties: + siteId: + type: optional + docs: The identifier of the Site + createdOn: + type: optional + docs: Date that the Site was created on + defaultCurrency: + type: optional + docs: The three-letter ISO currency code for the Site + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/accessGroups.yml b/.mock/definition/accessGroups.yml new file mode 100644 index 00000000..662d2ed2 --- /dev/null +++ b/.mock/definition/accessGroups.yml @@ -0,0 +1,80 @@ +types: + AccessGroupsListRequestSort: + enum: + - value: CreatedOn + name: CreatedOnAscending + docs: Sorts users in ascending order based on their created date + - value: '-CreatedOn' + name: CreatedOnDescending + docs: Sorts users in descending order based on their created date + source: + openapi: ../../../referenced-specs/v2.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/accessgroups + method: GET + auth: true + docs: | + Get a list of access groups for a site + + Required scope | `users:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Access Groups + request: + name: AccessGroupsListRequest + 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)' + sort: + type: optional + docs: | + Sort string to use when ordering access groups + Can be prefixed with a `-` to reverse the sort (ex. `-CreatedOn`) + response: + docs: Request was successful + type: root.AccessGroupList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + count: 1 + limit: 10 + offset: 0 + total: 1 + accessGroups: + - id: 62be58d404be8a6cc900c081 + name: Research Team + shortId: rt + slug: hitchhikers-guide-research-team + createdOn: '2022-08-01T19:41:48Z' + - id: 65a96161991e77bbb4a6c573 + name: Admin + shortId: ad + slug: admin + createdOn: '2022-08-01T19:41:48Z' + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml new file mode 100644 index 00000000..aee9acdf --- /dev/null +++ b/.mock/definition/api.yml @@ -0,0 +1,13 @@ +name: api +error-discrimination: + strategy: status-code +display-name: Data API +environments: + Default: https://api.webflow.com/v2 +default-environment: Default +auth-schemes: + BearerToken: + scheme: bearer + token: + name: accessToken +auth: BearerToken diff --git a/.mock/definition/assets.yml b/.mock/definition/assets.yml new file mode 100644 index 00000000..432eb7f0 --- /dev/null +++ b/.mock/definition/assets.yml @@ -0,0 +1,412 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/assets + method: GET + auth: true + docs: | + List assets for a given site + + Required scope | `assets:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Assets + response: + docs: Request was successful + type: root.Assets + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + assets: + - id: 63e5889e7fe4eafa7384cea4 + contentType: image/png + size: 2212772 + siteId: 63938b302ea6b0aa6f3d8745 + hostedUrl: >- + https://s3.amazonaws.com/webflow-prod-assets/63938b302ea6b0aa6f3d8745/63e5889e7fe4eafa7384cea4_Vectors-Wrapper.svg + originalFileName: Candy-Wrapper.svg + displayName: 63e5889e7fe4eafa7384cea4_Candy-Wrapper.png + lastUpdated: '2023-03-01T23:42:57Z' + createdOn: '2023-02-09T23:58:22Z' + variants: + - hostedUrl: >- + https://s3.amazonaws.com/webflow-prod-assets/6258612d1ee792848f805dcf/660d83ce30f3a599ddb0bdb3_Screenshot%202024-03-20%20at%209.03.24%E2%80%AFPM-p-500.png + originalFileName: >- + Screenshot%202024-03-20%20at%209.03.24%E2%80%AFPM-p-500.png + displayName: >- + 660d83ce30f3a599ddb0bdb3_Screenshot%202024-03-20%20at%209.03.24%E2%80%AFPM-p-500.png + format: png + width: 500 + quality: 100 + altText: A red chair + create: + path: /sites/{site_id}/assets + method: POST + auth: true + docs: > + Create a new asset entry. + + + + This endpoint generates a response with the following information: + `uploadUrl` and `uploadDetails`. + + You can use these two properties to [upload the file to Amazon s3 by + making a + POST](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) + + request to the `uploadUrl` with the `uploadDetails` object as your + header information in the request. + + + Required scope | `assets:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Create Asset Metadata + request: + name: AssetsCreateRequest + body: + properties: + fileName: + type: string + docs: >- + File name including file extension. File names must be less than + 100 characters. + fileHash: + type: string + docs: MD5 hash of the file + parentFolder: + type: optional + docs: ID of the Asset folder (optional) + content-type: application/json + response: + docs: Request was successful + type: root.AssetUpload + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + fileName: file.png + fileHash: 3c7d87c9575702bc3b1e991f4d3c638e + response: + body: + uploadDetails: + acl: public-read + bucket: webflow-bucket-name + X-Amz-Algorithm: AWS4-HMAC-SHA256 + X-Amz-Credential: ///s3/aws4_request + X-Amz-Date: + key: /_ + Policy: + X-Amz-Signature: + success_action_status: '201' + content-type: image/png + Cache-Control: max-age=31536000, must-revalidate + contentType: image/png + id: 64358b9544249dc43d37d2b7 + parentFolder: 6436b1ce5281cace05b65aea + uploadUrl: >- + https://s3.amazonaws.com/webflow-dev-assets/643021114e290e0d3a0602b2/64358b9544249dc43d37d2b7_Screenshot%202023-04-11%20at%209.50.42%20AM.png + assetUrl: >- + https://s3.amazonaws.com/webflow-prod-assets/6258612d1ee792848f805dcf/660d907ab9e91e3e9f56385e_paranoidAndroid-2024.png + hostedUrl: >- + https://d1otoma47x30pg.cloudfront.net/643021114e290e0d3a0602b2/64358b9544249dc43d37d2b7_Screenshot%202023-04-11%20at%209.50.42%20AM.png + originalFileName: file.png + createdOn: '2023-04-11T16:32:21Z' + lastUpdated: '2023-04-12T20:31:03Z' + get: + path: /assets/{asset_id} + method: GET + auth: true + docs: | + Get an Asset + + Required scope | `assets:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + asset_id: + type: string + docs: Unique identifier for an Asset on a site + display-name: Get Asset + response: + docs: Request was successful + type: root.Asset + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + asset_id: 580e63fc8c9a982ac9b8b745 + response: + body: + id: 55131cd036c09f7d07883dfc + contentType: image/png + size: 1500 + siteId: 62749158efef318abc8d5a0f + hostedUrl: example.com/hostedimage.png + originalFileName: image.png + displayName: example-image-123.png + lastUpdated: '2016-09-06T21:12:22Z' + createdOn: '2016-09-02T23:26:22Z' + variants: + - hostedUrl: example.com/hostedimage.png + originalFileName: image.png + displayName: A brown dog + format: format + width: 1500 + height: 900 + quality: 1 + error: error + altText: A red chair + delete: + path: /assets/{asset_id} + method: DELETE + auth: true + docs: | + Delete an Asset + + Required Scope: `assets: write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + asset_id: + type: string + docs: Unique identifier for an Asset on a site + display-name: Delete Asset + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + asset_id: 580e63fc8c9a982ac9b8b745 + update: + path: /assets/{asset_id} + method: PATCH + auth: true + docs: | + Update an Asset + + Required scope | `assets:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + asset_id: + type: string + docs: Unique identifier for an Asset on a site + display-name: Update Asset + request: + name: AssetsUpdateRequest + body: + properties: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + displayName: + type: optional + docs: A human readable name for the asset + content-type: application/json + response: + docs: Request was successful + type: root.Asset + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + asset_id: 580e63fc8c9a982ac9b8b745 + request: {} + response: + body: + id: 55131cd036c09f7d07883dfc + contentType: image/png + size: 1500 + siteId: 62749158efef318abc8d5a0f + hostedUrl: example.com/hostedimage.png + originalFileName: image.png + displayName: example-image-123.png + lastUpdated: '2016-09-06T21:12:22Z' + createdOn: '2016-09-02T23:26:22Z' + variants: + - hostedUrl: example.com/hostedimage.png + originalFileName: image.png + displayName: A brown dog + format: format + width: 1500 + height: 900 + quality: 1 + error: error + altText: A red chair + list-folders: + path: /sites/{site_id}/asset_folders + method: GET + auth: true + docs: | + List Asset Folders within a given site + + Required scope | `assets:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Asset Folders + response: + docs: Request was successful + type: root.AssetFolderList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + assetFolders: + - id: 6390c49774a71f0e3c1a08ee + displayName: emoji icons + assets: + - 63e5889e7fe4eafa7384cea4 + - 659595234426a9fcbad57043 + siteId: 6390c49674a71f84b51a08d8 + createdOn: '2018-10-14T21:55:49Z' + lastUpdated: '2022-12-07T16:51:37Z' + pagination: + limit: 1 + offset: 0 + total: 1 + create-folder: + path: /sites/{site_id}/asset_folders + method: POST + auth: true + docs: | + Create an Asset Folder within a given site + + Required scope | `assets:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Create Asset Folder + request: + name: AssetsCreateFolderRequest + body: + properties: + displayName: + type: string + docs: A human readable name for the Asset Folder + parentFolder: + type: optional + docs: >- + An (optional) pointer to a parent Asset Folder (or null for + root) + content-type: application/json + response: + docs: Request was successful + type: root.AssetFolder + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + displayName: my asset folder + response: + body: + id: 6390c49774a71f0e3c1a08ee + displayName: emoji icons + parentFolder: 6390c49774a71f99f21a08eb + assets: + - 63e5889e7fe4eafa7384cea4 + - 659595234426a9fcbad57043 + siteId: 6390c49674a71f84b51a08d8 + createdOn: '2018-10-14T21:55:49Z' + lastUpdated: '2022-12-07T16:51:37Z' + get-folder: + path: /asset_folders/{asset_folder_id} + method: GET + auth: true + docs: | + Get details about a specific Asset Folder + + Required scope | `assets:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + asset_folder_id: + type: string + docs: Unique identifier for an Asset Folder + display-name: Get Asset Folder + response: + docs: Request was successful + type: root.AssetFolder + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + asset_folder_id: 6390c49774a71f0e3c1a08ee + response: + body: + id: 6390c49774a71f0e3c1a08ee + displayName: emoji icons + parentFolder: 6390c49774a71f99f21a08eb + assets: + - 63e5889e7fe4eafa7384cea4 + - 659595234426a9fcbad57043 + siteId: 6390c49674a71f84b51a08d8 + createdOn: '2018-10-14T21:55:49Z' + lastUpdated: '2022-12-07T16:51:37Z' + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Assets diff --git a/.mock/definition/collections.yml b/.mock/definition/collections.yml new file mode 100644 index 00000000..b1abc2e3 --- /dev/null +++ b/.mock/definition/collections.yml @@ -0,0 +1,183 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/collections + method: GET + auth: true + docs: | + List of all Collections within a Site. + + Required scope | `cms:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Collections + response: + docs: Request was successful + type: root.CollectionList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + collections: + - id: 63692ab61fb2852f582ba8f5 + displayName: Products + singularName: Product + slug: product + createdOn: '2019-06-12T13:35:14Z' + lastUpdated: '2022-11-17T15:08:50Z' + - id: 63692ab61fb2856e6a2ba8f6 + displayName: Categories + singularName: Category + slug: category + createdOn: '2019-06-12T13:35:14Z' + lastUpdated: '2022-11-17T15:08:50Z' + - id: 63692ab61fb285a8562ba8f4 + displayName: SKUs + singularName: SKU + slug: sku + createdOn: '2019-06-12T13:35:14Z' + lastUpdated: '2022-11-17T15:08:50Z' + create: + path: /sites/{site_id}/collections + method: POST + auth: true + docs: | + Create a Collection for a site. + + Required scope | `cms:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Create Collection + request: + name: CollectionsCreateRequest + body: + properties: + displayName: + type: string + docs: Name of the collection. Each collection name must be distinct. + singularName: + type: string + docs: Singular name of each item. + slug: + type: optional + docs: Part of a URL that identifier + content-type: application/json + response: + docs: Request was successful + type: root.Collection + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + displayName: Blog Posts + singularName: Blog Post + slug: posts + response: + body: + id: 580e63fc8c9a982ac9b8b745 + displayName: Blog Posts + singularName: Blog Post + slug: post + createdOn: '2016-10-24T19:41:48Z' + lastUpdated: '2016-10-24T19:42:38Z' + fields: + - id: 23cc2d952d4e4631ffd4345d2743db4e + isRequired: true + isEditable: true + type: PlainText + slug: name + displayName: Name + get: + path: /collections/{collection_id} + method: GET + auth: true + docs: | + Get the full details of a collection from its ID. + + Required scope | `cms:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Get Collection Details + response: + docs: Request was successful + type: root.Collection + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + response: + body: + id: 580e63fc8c9a982ac9b8b745 + displayName: Blog Posts + singularName: Blog Post + slug: post + createdOn: '2016-10-24T19:41:48Z' + lastUpdated: '2016-10-24T19:42:38Z' + fields: + - id: 23cc2d952d4e4631ffd4345d2743db4e + isRequired: true + isEditable: true + type: PlainText + slug: name + displayName: Name + delete: + path: /collections/{collection_id} + method: DELETE + auth: true + docs: | + Delete a collection using its ID. + + Required scope | `cms:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Delete Collection + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Collections diff --git a/.mock/definition/collections/fields.yml b/.mock/definition/collections/fields.yml new file mode 100644 index 00000000..210ebcc6 --- /dev/null +++ b/.mock/definition/collections/fields.yml @@ -0,0 +1,187 @@ +types: + FieldCreateType: + enum: + - PlainText + - RichText + - Image + - MultiImage + - Video + - Link + - Email + - Phone + - Number + - DateTime + - Switch + - Color + - File + docs: Choose these appropriate field type for your collection data + source: + openapi: ../../../referenced-specs/v2.yml +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /collections/{collection_id}/fields + method: POST + auth: true + docs: > + Create a custom field in a collection. + + + Slugs must be all lowercase letters without spaces. + + If you pass a string with uppercase letters and/or spaces to the "Slug" + property, Webflow will + + convert the slug to lowercase and replace spaces with "-." + + + Only some field types can be created through the API. + + This endpoint does not currently support bulk creation. + + + Required scope | `cms:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Create Collection Field + request: + name: FieldCreate + body: + properties: + isRequired: + type: optional + docs: define whether a field is required in a collection + type: + type: FieldCreateType + docs: Choose these appropriate field type for your collection data + displayName: + type: string + docs: The name of a field + helpText: + type: optional + docs: Additional text to help anyone filling out this field + content-type: application/json + response: + docs: Request was successful + type: root.Field + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + isRequired: false + type: RichText + displayName: Post Body + helpText: Add the body of your post here + response: + body: + id: 75821f618da60c18383330bcc0ca488b + isRequired: false + isEditable: true + type: RichText + slug: post-body + displayName: Post Body + helpText: Add the body of your post here + delete: + path: /collections/{collection_id}/fields/{field_id} + method: DELETE + auth: true + docs: > + Delete a custom field in a collection. This endpoint does not currently + support bulk deletion. + + + Required scope | `cms:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + field_id: + type: string + docs: Unique identifier for a Field in a collection + display-name: Delete Collection Field + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + field_id: 580e63fc8c9a982ac9b8b745 + update: + path: /collections/{collection_id}/fields/{field_id} + method: PATCH + auth: true + docs: | + Update a custom field in a collection. + + Required scope | `cms:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + field_id: + type: string + docs: Unique identifier for a Field in a collection + display-name: Update Collection Field + request: + name: FieldUpdate + body: + properties: + isRequired: + type: optional + docs: Define whether a field is required in a collection + displayName: + type: optional + docs: The name of a field + helpText: + type: optional + docs: Additional text to help anyone filling out this field + content-type: application/json + response: + docs: Request was successful + type: root.Field + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + field_id: 580e63fc8c9a982ac9b8b745 + request: + isRequired: false + displayName: Post Body + helpText: Add the body of your post here + response: + body: + id: 75821f618da60c18383330bcc0ca488b + isRequired: false + isEditable: true + type: RichText + slug: post-body + displayName: Post Body + helpText: Add the body of your post here + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/collections/items.yml b/.mock/definition/collections/items.yml new file mode 100644 index 00000000..2db7fdaf --- /dev/null +++ b/.mock/definition/collections/items.yml @@ -0,0 +1,1505 @@ +types: + ItemsListItemsRequestSortBy: + enum: + - lastPublished + - name + - slug + source: + openapi: ../../../referenced-specs/v2.yml + ItemsListItemsRequestSortOrder: + enum: + - asc + - desc + source: + openapi: ../../../referenced-specs/v2.yml + ItemsCreateItemRequestItems: + properties: + items: + type: optional> + docs: An array of items to create + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + ItemsCreateItemRequest: + discriminated: false + union: + - root.CollectionItem + - ItemsCreateItemRequestItems + source: + openapi: ../../../referenced-specs/v2.yml + ItemsDeleteItemsRequestItemsItem: + properties: + id: + type: string + docs: Unique identifier for the Item + cmsLocaleIds: + type: optional> + docs: Array of identifiers for the locales where the item will be created + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + ItemsListItemsLiveRequestSortBy: + enum: + - lastPublished + - name + - slug + source: + openapi: ../../../referenced-specs/v2.yml + ItemsListItemsLiveRequestSortOrder: + enum: + - asc + - desc + source: + openapi: ../../../referenced-specs/v2.yml + ItemsCreateItemLiveRequestItems: + properties: + items: + type: optional> + docs: List of collection items to create + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + ItemsCreateItemLiveRequest: + discriminated: false + union: + - root.CollectionItem + - ItemsCreateItemLiveRequestItems + source: + openapi: ../../../referenced-specs/v2.yml + ItemsDeleteItemsLiveRequestItemsItem: + properties: + itemId: + type: string + docs: Unique identifier for the Item + cmsLocaleIds: + type: optional> + docs: Array of identifiers for the locales where the item will be created + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + CreateBulkCollectionItemRequestBodyFieldDataName: + properties: + name: + type: string + docs: The name of the item. + slug: + type: string + docs: >- + URL slug for the item in your site. + + Note: Updating the item slug will break all links referencing the old + slug. + extra-properties: true + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + CreateBulkCollectionItemRequestBodyFieldDataItem: + properties: + name: + type: string + docs: The name of the item. + slug: + type: string + docs: >- + URL slug for the item in your site. + + Note: Updating the item slug will break all links referencing the old + slug. + extra-properties: true + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + CreateBulkCollectionItemRequestBodyFieldData: + discriminated: false + union: + - CreateBulkCollectionItemRequestBodyFieldDataName + - list + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + ItemsPublishItemResponse: + properties: + publishedItemIds: optional> + errors: optional> + source: + openapi: ../../../referenced-specs/v2.yml +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list-items: + path: /collections/{collection_id}/items + method: GET + auth: true + docs: | + List of all Items within a Collection. + + Required scope | `CMS:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: List Collection Items + request: + name: ItemsListItemsRequest + query-parameters: + cmsLocaleId: + type: optional + docs: >- + Unique identifier for a CMS Locale. This UID is different from the + Site locale identifier and is listed as `cmsLocaleId` in the Sites + response. To query multiple locales, input a comma separated + string. + 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)' + name: + type: optional + docs: The name of the item(s) + slug: + type: optional + docs: The slug of the item + sortBy: + type: optional + docs: Sort results by the provided value + sortOrder: + type: optional + docs: Sorts the results by asc or desc + response: + docs: Request was successful + type: root.CollectionItemList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + response: + body: + items: + - id: 62b720ef280c7a7a3be8cabe + cmsLocaleId: 66f6e966c9e1dc700a857ca3 + lastPublished: '2022-06-30T13:35:20.878Z' + lastUpdated: '2022-06-25T14:51:27.809Z' + createdOn: '2022-06-25T14:51:27.809Z' + isArchived: false + isDraft: false + fieldData: + name: Senior Data Analyst + slug: senior-data-analyst + - id: 62c880ef281c7b7b4cf9dabc + cmsLocaleId: 66f6e966c9e1dc700a857ca3 + lastPublished: '2023-04-15T10:25:18.123Z' + lastUpdated: '2023-04-10T11:45:30.567Z' + createdOn: '2023-04-10T11:45:30.567Z' + isArchived: false + isDraft: false + fieldData: + name: Product Manager + slug: product-manager + pagination: + limit: 25 + offset: 0 + total: 2 + create-item: + path: /collections/{collection_id}/items + method: POST + auth: true + docs: > + Create Item(s) in a Collection. + + + + To create items across multiple locales, please use [this + endpoint.](/data/v2.0.0/reference/cms/collection-items/bulk-items/create-items) + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Create Collection Item(s) + request: + body: ItemsCreateItemRequest + content-type: application/json + response: + docs: Request was successful + type: root.CollectionItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - name: SingleItem + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + response: + body: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + - name: MultipleItems + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Senior Data Analyst + slug: senior-data-analyst + - id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Product Manager + slug: product-manager + response: + body: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + delete-items: + path: /collections/{collection_id}/items + method: DELETE + auth: true + docs: > + Delete Items from a Collection. + + + **Note:** If the `cmsLocaleId` parameter is undefined or empty and the + items are localized, items will be deleted only in the primary locale. + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Delete Collection Items + request: + name: ItemsDeleteItemsRequest + body: + properties: + items: optional> + content-type: application/json + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: {} + update-items: + path: /collections/{collection_id}/items + method: PATCH + auth: true + docs: > + Update a single item or multiple items (up to 100) in a Collection. + + + **Note:** If the `cmsLocaleId` parameter is undefined or empty and the + items are localized, items will be updated only in the primary locale. + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Update Collection Items + request: + name: ItemsUpdateItemsRequest + body: + properties: + items: optional> + content-type: application/json + response: + docs: Request was successful + type: root.CollectionItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - name: LocalizedItems + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + response: + body: + id: 580e64008c9a982ac9b8b754 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + createdOn: '2023-03-17T18:47:35.560Z' + isArchived: true + isDraft: true + fieldData: + name: My new item + slug: my-new-item + - name: MultipleItems + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Senior Data Analyst + slug: senior-data-analyst + - id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Product Manager + slug: product-manager + response: + body: + id: 580e64008c9a982ac9b8b754 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + createdOn: '2023-03-17T18:47:35.560Z' + isArchived: true + isDraft: true + fieldData: + name: My new item + slug: my-new-item + - name: Multiple items updated across multiple locales + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + response: + body: + id: 580e64008c9a982ac9b8b754 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + createdOn: '2023-03-17T18:47:35.560Z' + isArchived: true + isDraft: true + fieldData: + name: My new item + slug: my-new-item + - name: Mulitple items updated in a single locale + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + response: + body: + id: 580e64008c9a982ac9b8b754 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + createdOn: '2023-03-17T18:47:35.560Z' + isArchived: true + isDraft: true + fieldData: + name: My new item + slug: my-new-item + list-items-live: + path: /collections/{collection_id}/items/live + method: GET + auth: true + docs: | + List of all live Items within a Collection. + + Required scope | `CMS:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: List Live Collection Items + request: + name: ItemsListItemsLiveRequest + query-parameters: + cmsLocaleId: + type: optional + docs: >- + Unique identifier for a CMS Locale. This UID is different from the + Site locale identifier and is listed as `cmsLocaleId` in the Sites + response. To query multiple locales, input a comma separated + string. + 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)' + name: + type: optional + docs: The name of the item(s) + slug: + type: optional + docs: The slug of the item + sortBy: + type: optional + docs: Sort results by the provided value + sortOrder: + type: optional + docs: Sorts the results by asc or desc + response: + docs: Request was successful + type: root.CollectionItemList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + response: + body: + items: + - id: 62b720ef280c7a7a3be8cabe + cmsLocaleId: 66f6e966c9e1dc700a857ca3 + lastPublished: '2022-06-30T13:35:20.878Z' + lastUpdated: '2022-06-25T14:51:27.809Z' + createdOn: '2022-06-25T14:51:27.809Z' + isArchived: false + isDraft: false + fieldData: + name: Senior Data Analyst + slug: senior-data-analyst + - id: 62c880ef281c7b7b4cf9dabc + cmsLocaleId: 66f6e966c9e1dc700a857ca3 + lastPublished: '2023-04-15T10:25:18.123Z' + lastUpdated: '2023-04-10T11:45:30.567Z' + createdOn: '2023-04-10T11:45:30.567Z' + isArchived: false + isDraft: false + fieldData: + name: Product Manager + slug: product-manager + pagination: + limit: 25 + offset: 0 + total: 2 + create-item-live: + path: /collections/{collection_id}/items/live + method: POST + auth: true + docs: > + Create live Item(s) in a Collection. The Item(s) will be published to + the live site. + + + + To create items across multiple locales, [please use this + endpoint.](/v2.0.0/data/reference/cms/collection-items/bulk-items/create-items) + + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Create Live Collection Item(s) + request: + body: ItemsCreateItemLiveRequest + content-type: application/json + response: + docs: Request was successful + type: root.CollectionItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - name: SingleItem + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + response: + body: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + - name: MultipleItems + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Senior Data Analyst + slug: senior-data-analyst + - id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Product Manager + slug: product-manager + response: + body: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + delete-items-live: + path: /collections/{collection_id}/items/live + method: DELETE + auth: true + docs: > + Remove an item or multiple items (up to 100 items) from the live site. + Deleting published items will unpublish the items from the live site and + set them to draft. + + + **Note:** If the `cmsLocaleId` parameter is undefined or empty and the + items are localized, items will be unpublished only in the primary + locale. + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Delete Live Collection Items + request: + name: ItemsDeleteItemsLiveRequest + body: + properties: + items: optional> + content-type: application/json + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: {} + update-items-live: + path: /collections/{collection_id}/items/live + method: PATCH + auth: true + docs: > + Update a single live item or multiple live items (up to 100) in a + Collection + + + **Note:** If the `cmsLocaleId` parameter is undefined or empty and the + items are localized, items will be updated only in the primary locale. + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Update Live Collection Items + request: + name: ItemsUpdateItemsLiveRequest + body: + properties: + items: optional> + content-type: application/json + response: + docs: Request was successful + type: root.CollectionItemListNoPagination + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - name: LocalizedItems + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + response: + body: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + - name: MultipleItems + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Senior Data Analyst + slug: senior-data-analyst + - id: 580e64008c9a982ac9b8b754 + isArchived: false + isDraft: false + fieldData: + name: Product Manager + slug: product-manager + response: + body: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + - name: Multiple items updated across multiple locales + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + response: + body: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + lastUpdated: '2024-09-27T17:38:29.066Z' + createdOn: '2024-09-27T17:38:29.066Z' + isArchived: true + isDraft: true + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + - name: Mulitple items updated in a single locale + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + items: + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Ne Paniquez Pas + slug: ne-paniquez-pas + - id: 66f6ed9576ddacf3149d5ea6 + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: No Entrar en Pánico + slug: no-entrar-en-panico + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca5 + fieldData: + name: Au Revoir et Merci pour Tous les Poissons + slug: au-revoir-et-merci + - id: 66f6ed9576ddacf3149d5eaa + cmsLocaleId: 66f6e966c9e1dc700a857ca4 + fieldData: + name: Hasta Luego y Gracias por Todo el Pescado + slug: hasta-luego-y-gracias + response: + body: + items: + - id: 62b720ef280c7a7a3be8cabe + cmsLocaleId: 66f6e966c9e1dc700a857ca3 + lastPublished: '2022-06-30T13:35:20.878Z' + lastUpdated: '2022-06-25T14:51:27.809Z' + createdOn: '2022-06-25T14:51:27.809Z' + isArchived: false + isDraft: false + fieldData: + name: Senior Data Analyst + slug: senior-data-analyst + - id: 62c880ef281c7b7b4cf9dabc + cmsLocaleId: 66f6e966c9e1dc700a857ca3 + lastPublished: '2023-04-15T10:25:18.123Z' + lastUpdated: '2023-04-10T11:45:30.567Z' + createdOn: '2023-04-10T11:45:30.567Z' + isArchived: false + isDraft: false + fieldData: + name: Product Manager + slug: product-manager + create-items: + path: /collections/{collection_id}/items/bulk + method: POST + auth: true + docs: > + Create an item or multiple items in a CMS Collection across multiple + corresponding locales. + + + **Notes:** + - This endpoint can create up to 100 items in a request. + - If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale. + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Create Collection Items + request: + name: CreateBulkCollectionItemRequestBody + body: + properties: + cmsLocaleIds: + type: optional> + docs: >- + Array of identifiers for the locales where the item will be + created + isArchived: + type: optional + docs: Indicates whether the item is archived. + default: false + isDraft: + type: optional + docs: Indicates whether the item is in draft state. + default: false + fieldData: optional + content-type: application/json + response: + docs: Request was successful + type: root.BulkCollectionItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - name: Create a single item across multiple locales + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + cmsLocaleIds: + - 66f6e966c9e1dc700a857ca3 + - 66f6e966c9e1dc700a857ca4 + - 66f6e966c9e1dc700a857ca5 + isArchived: false + isDraft: false + fieldData: + name: Don’t Panic + slug: dont-panic + response: + body: + id: 580e64008c9a982ac9b8b754 + cmsLocaleIds: + - 653ad57de882f528b32e810e + - 6514390aea353fc691d69827 + - 65143930ea353fc691d69cd8 + lastPublished: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + createdOn: '2023-03-17T18:47:35.560Z' + isArchived: true + isDraft: true + fieldData: + name: My new item + slug: my-new-item + - name: Create multiple items across multipel locales + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + cmsLocaleIds: + - 66f6e966c9e1dc700a857ca3 + - 66f6e966c9e1dc700a857ca4 + isArchived: false + isDraft: false + fieldData: + - name: Don’t Panic + slug: dont-panic + - name: So Long and Thanks for All the Fish + slug: so-long-and-thanks + response: + body: + id: 580e64008c9a982ac9b8b754 + cmsLocaleIds: + - 653ad57de882f528b32e810e + - 6514390aea353fc691d69827 + - 65143930ea353fc691d69cd8 + lastPublished: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + createdOn: '2023-03-17T18:47:35.560Z' + isArchived: true + isDraft: true + fieldData: + name: My new item + slug: my-new-item + - name: Single item created across multiple locales + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + cmsLocaleIds: + - 66f6e966c9e1dc700a857ca3 + - 66f6e966c9e1dc700a857ca4 + - 66f6e966c9e1dc700a857ca5 + isArchived: false + isDraft: false + fieldData: + name: Don’t Panic + slug: dont-panic + response: + body: + id: 580e64008c9a982ac9b8b754 + cmsLocaleIds: + - 653ad57de882f528b32e810e + - 6514390aea353fc691d69827 + - 65143930ea353fc691d69cd8 + lastPublished: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + createdOn: '2023-03-17T18:47:35.560Z' + isArchived: true + isDraft: true + fieldData: + name: My new item + slug: my-new-item + - name: Multiple items created across multiple locales + path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + cmsLocaleIds: + - 66f6e966c9e1dc700a857ca3 + - 66f6e966c9e1dc700a857ca4 + - 66f6e966c9e1dc700a857ca5 + isArchived: false + isDraft: false + fieldData: + name: Don’t Panic + slug: dont-panic + response: + body: + id: 580e64008c9a982ac9b8b754 + cmsLocaleIds: + - 653ad57de882f528b32e810e + - 6514390aea353fc691d69827 + - 65143930ea353fc691d69cd8 + lastPublished: '2023-03-17T18:47:35.560Z' + lastUpdated: '2023-03-17T18:47:35.560Z' + createdOn: '2023-03-17T18:47:35.560Z' + isArchived: true + isDraft: true + fieldData: + name: My new item + slug: my-new-item + get-item: + path: /collections/{collection_id}/items/{item_id} + method: GET + auth: true + docs: | + Get details of a selected Collection Item. + + Required scope | `CMS:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + item_id: + type: string + docs: Unique identifier for an Item + display-name: Get Collection Item + request: + name: ItemsGetItemRequest + query-parameters: + cmsLocaleId: + type: optional + docs: >- + Unique identifier for a CMS Locale. This UID is different from the + Site locale identifier and is listed as `cmsLocaleId` in the Sites + response. To query multiple locales, input a comma separated + string. + response: + docs: Request was successful + type: root.CollectionItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + item_id: 580e64008c9a982ac9b8b754 + response: + body: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + delete-item: + path: /collections/{collection_id}/items/{item_id} + method: DELETE + auth: true + docs: > + Delete an Item from a Collection. This endpoint does not currently + support bulk deletion. + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + item_id: + type: string + docs: Unique identifier for an Item + display-name: Delete Collection Item + request: + name: ItemsDeleteItemRequest + query-parameters: + cmsLocaleId: + type: optional + docs: >- + Unique identifier for a CMS Locale. This UID is different from the + Site locale identifier and is listed as `cmsLocaleId` in the Sites + response. To query multiple locales, input a comma separated + string. + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + item_id: 580e64008c9a982ac9b8b754 + update-item: + path: /collections/{collection_id}/items/{item_id} + method: PATCH + auth: true + docs: | + Update a selected Item in a Collection. + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + item_id: + type: string + docs: Unique identifier for an Item + display-name: Update Collection Item + request: + body: root.CollectionItem + content-type: application/json + response: + docs: Request was successful + type: root.CollectionItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + item_id: 580e64008c9a982ac9b8b754 + request: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + response: + body: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + get-item-live: + path: /collections/{collection_id}/items/{item_id}/live + method: GET + auth: true + docs: | + Get details of a selected Collection live Item. + + Required scope | `CMS:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + item_id: + type: string + docs: Unique identifier for an Item + display-name: Get Live Collection Item + request: + name: ItemsGetItemLiveRequest + query-parameters: + cmsLocaleId: + type: optional + docs: >- + Unique identifier for a CMS Locale. This UID is different from the + Site locale identifier and is listed as `cmsLocaleId` in the Sites + response. To query multiple locales, input a comma separated + string. + response: + docs: Request was successful + type: root.CollectionItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + item_id: 580e64008c9a982ac9b8b754 + response: + body: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + delete-item-live: + path: /collections/{collection_id}/items/{item_id}/live + method: DELETE + auth: true + docs: > + Remove a live item from the site. Removing a published item will + unpublish the item from the live site and set it to draft. + + + This endpoint does not currently support bulk deletion. + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + item_id: + type: string + docs: Unique identifier for an Item + display-name: Delete Live Collection Item + request: + name: ItemsDeleteItemLiveRequest + query-parameters: + cmsLocaleId: + type: optional + docs: >- + Unique identifier for a CMS Locale. This UID is different from the + Site locale identifier and is listed as `cmsLocaleId` in the Sites + response. To query multiple locales, input a comma separated + string. + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + item_id: 580e64008c9a982ac9b8b754 + update-item-live: + path: /collections/{collection_id}/items/{item_id}/live + method: PATCH + auth: true + docs: > + Update a selected live Item in a Collection. The updates for this Item + will be published to the live site. + + + Required scope | `CMS:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + item_id: + type: string + docs: Unique identifier for an Item + display-name: Update Live Collection Item + request: + body: root.CollectionItem + content-type: application/json + response: + docs: Request was successful + type: root.CollectionItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + item_id: 580e64008c9a982ac9b8b754 + request: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + response: + body: + id: 42b720ef280c7a7a3be8cabe + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2022-11-29T16:22:43.159Z' + lastUpdated: '2022-11-17T17:19:43.282Z' + createdOn: '2022-11-17T17:11:57.148Z' + isArchived: false + isDraft: false + fieldData: + name: Pan Galactic Gargle Blaster Recipe + slug: pan-galactic-gargle-blaster + publish-item: + path: /collections/{collection_id}/items/publish + method: POST + auth: true + docs: | + Publish an item or multiple items. + + Required scope | `cms:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + display-name: Publish Collection Item + request: + name: ItemsPublishItemRequest + body: + properties: + itemIds: list + content-type: application/json + response: + docs: Request was successful + type: ItemsPublishItemResponse + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + request: + itemIds: + - itemIds + response: + body: + publishedItemIds: + - 643fd856d66b6528195ee2ca + - 643fd856d66b6528195ee2cb + errors: + - Staging item ID 643fd856d66b6528195ee2cf not found. + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/ecommerce.yml b/.mock/definition/ecommerce.yml new file mode 100644 index 00000000..29529a25 --- /dev/null +++ b/.mock/definition/ecommerce.yml @@ -0,0 +1,42 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + get-settings: + path: /sites/{site_id}/ecommerce/settings + method: GET + auth: true + docs: | + Retrieve ecommerce settings for a site. + + Required scope | `ecommerce:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Get Ecommerce Settings + response: + docs: Request was successful + type: root.EcommerceSettings + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + siteId: 5eb0b5583bf24e2d3a488969 + createdOn: '2018-10-04T15:21:02Z' + defaultCurrency: USD + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/forms.yml b/.mock/definition/forms.yml new file mode 100644 index 00000000..9ff8f53f --- /dev/null +++ b/.mock/definition/forms.yml @@ -0,0 +1,299 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/forms + method: GET + auth: true + docs: | + List forms for a given site. + + Required scope | `forms:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Forms + request: + name: FormsListRequest + query-parameters: + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + response: + docs: Request was successful + type: root.FormList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + forms: + - displayName: Email Form + createdOn: '2016-10-24T19:41:29Z' + lastUpdated: '2016-10-24T19:43:17Z' + fields: + '0': + displayName: Email + userVisible: true + '1': + displayName: Email + userVisible: true + responseSettings: + redirectUrl: https://example.com + redirectMethod: GET + sendEmailConfirmation: true + id: 589a331aa51e760df7ccb89e + siteId: 580e63e98c9a982ac9b8b741 + siteDomainId: 6419db964a9c436a4baf6248 + pageId: 6419db964a9c43f6a3af6348 + pageName: Home + formElementId: 4e038d2c-6a1e-4953-7be9-a59a2b453177 + workspaceId: 580e63fc8c9a982ac9b8b744 + - displayName: Name Form + createdOn: '2016-10-24T19:41:29Z' + lastUpdated: '2016-10-24T19:43:17Z' + fields: + '0': + displayName: Email + userVisible: true + responseSettings: + redirectUrl: https://example.com + redirectMethod: GET + sendEmailConfirmation: false + id: 580ff8d7ba3e45ba9fe588e9 + siteId: 580e63e98c9a982ac9b8b741 + siteDomainId: 6419db964a9c436a4baf6248 + pageId: 6419db964a9c43f6a3af6348 + pageName: Home + formElementId: 4e038d2c-6a1e-4953-7be9-a59a2b453177 + workspaceId: 580e63fc8c9a982ac9b8b744 + pagination: + limit: 25 + offset: 0 + total: 2 + get: + path: /forms/{form_id} + method: GET + auth: true + docs: | + Get information about a given form. + + Required scope | `forms:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + form_id: + type: string + docs: Unique identifier for a Form + display-name: Get Form Schema + response: + docs: Request was successful + type: root.Form + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + form_id: 580e63e98c9a982ac9b8b741 + response: + body: + displayName: Email Form + createdOn: '2016-10-24T19:41:29Z' + lastUpdated: '2016-10-24T19:43:17Z' + fields: + 660d5bcc9c0772150459dfb1: + displayName: Name + type: Plain + userVisible: true + 589a331aa51e760df7ccb89d: + displayName: Email + type: Email + placeholder: Enter your email + userVisible: true + responseSettings: + redirectUrl: https://example.com + redirectMethod: GET + sendEmailConfirmation: true + id: 589a331aa51e760df7ccb89e + siteId: 580e63e98c9a982ac9b8b741 + siteDomainId: 6419db964a9c436a4baf6248 + pageId: 6419db964a9c43f6a3af6348 + pageName: Home + formElementId: 4e038d2c-6a1e-4953-7be9-a59a2b453177 + workspaceId: 580e63fc8c9a982ac9b8b744 + list-submissions: + path: /forms/{form_id}/submissions + method: GET + auth: true + docs: | + List form submissions for a given form + + Required scope | `forms:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + form_id: + type: string + docs: Unique identifier for a Form + display-name: List Form Submissions + request: + name: FormsListSubmissionsRequest + 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 + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + form_id: 580e63e98c9a982ac9b8b741 + 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: + path: /form_submissions/{form_submission_id} + method: GET + auth: true + docs: | + Get information about a given form submissio. + + Required scope | `forms:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + form_submission_id: + type: string + docs: Unique identifier for a Form Submission + display-name: Get Form Submission + response: + docs: Request was successful + type: root.FormSubmission + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + 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 + update-submission: + path: /form_submissions/{form_submission_id} + method: PATCH + auth: true + docs: | + Update hidden fields on a form submission + + Required scope | `forms:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + form_submission_id: + type: string + docs: Unique identifier for a Form Submission + display-name: Modify Form Submission + request: + name: FormsUpdateSubmissionRequest + 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 + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + 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: ../../../referenced-specs/v2.yml + display-name: Forms diff --git a/.mock/definition/inventory.yml b/.mock/definition/inventory.yml new file mode 100644 index 00000000..c1892c7e --- /dev/null +++ b/.mock/definition/inventory.yml @@ -0,0 +1,120 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /collections/{collection_id}/items/{item_id}/inventory + method: GET + auth: true + docs: | + List the current inventory levels for a particular SKU item. + + Required scope | `ecommerce:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + item_id: + type: string + docs: Unique identifier for an Item + display-name: List Inventory + response: + docs: Request was successful + type: root.InventoryItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + item_id: 580e64008c9a982ac9b8b754 + response: + body: + id: 5bfedb42bab0ad90fa7dad39 + quantity: 100 + inventoryType: infinite + update: + path: /collections/{collection_id}/items/{item_id}/inventory + method: PATCH + auth: true + docs: > + Updates the current inventory levels for a particular SKU item. + + + Updates may be given in one or two methods, absolutely or + incrementally. + + - Absolute updates are done by setting `quantity` directly. + + - Incremental updates are by specifying the inventory delta in + `updateQuantity` which is then added to the `quantity` stored on the + server. + + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + collection_id: + type: string + docs: Unique identifier for a Collection + item_id: + type: string + docs: Unique identifier for an Item + display-name: Update Item Inventory + request: + name: InventoryUpdateRequest + body: + properties: + inventoryType: + type: InventoryUpdateRequestInventoryType + docs: infinite or finite + updateQuantity: + type: optional + docs: Adds this quantity to currently store quantity. Can be negative. + quantity: + type: optional + docs: Immediately sets quantity to this value. + content-type: application/json + response: + docs: Request was successful + type: root.InventoryItem + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + collection_id: 580e63fc8c9a982ac9b8b745 + item_id: 580e64008c9a982ac9b8b754 + request: + inventoryType: infinite + response: + body: + id: 5bfedb42bab0ad90fa7dad39 + quantity: 100 + inventoryType: infinite + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Inventory +types: + InventoryUpdateRequestInventoryType: + enum: + - infinite + - finite + docs: infinite or finite + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/orders.yml b/.mock/definition/orders.yml new file mode 100644 index 00000000..ac0ce37b --- /dev/null +++ b/.mock/definition/orders.yml @@ -0,0 +1,1501 @@ +types: + OrdersListRequestStatus: + enum: + - pending + - refunded + - value: dispute-lost + name: DisputeLost + - fulfilled + - disputed + - unfulfilled + source: + openapi: ../../../referenced-specs/v2.yml + OrdersRefundRequestReason: + enum: + - duplicate + - fraudulent + - requested + docs: The reason for the refund + source: + openapi: ../../../referenced-specs/v2.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/orders + method: GET + auth: true + docs: | + List all orders created for a given site. + + Required scope | `ecommerce:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Orders + request: + name: OrdersListRequest + query-parameters: + status: + type: optional + docs: Filter the orders by status + 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.OrderList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + orders: + - orderId: 7c1-9fd + status: unfulfilled + comment: >- + 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' + 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' + allAddresses: + - type: billing + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + - type: shipping + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingAddress: + type: shipping + japanType: kanji + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + billingAddress: + type: billing + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingProvider: Shipping Company, Co. + shippingTracking: tr00000000002 + shippingTrackingURL: https://www.shippingcompany.com/tracking/tr00000000002 + customerInfo: + fullName: Arthur Dent + email: arthur.dent@example.com + purchasedItems: + - count: 2 + rowTotal: + unit: USD + value: '5892' + string: ' 111.22 USD' + productId: 66072fb61b89448912e26791 + productName: Luxurious Fresh Ball + productSlug: luxurious-fresh-ball + variantId: 66072fb71b89448912e2683f + variantName: 'Luxurious Fresh Ball Generic: Bronze, Practical: Plastic' + variantSlug: luxurious-fresh-ball-generic-bronze-practical-plastic + variantSKU: luxurious-fresh-ball-generic-bronze-practical-plastic + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2672c_image14.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 55.61 USD' + weight: 11 + width: 82 + height: 70 + length: 9 + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 83.09 USD' + productId: 66072fb61b89448912e2678b + productName: Incredible Bronze Towels + productSlug: incredible-bronze-towels + variantId: 66072fb71b89448912e2681e + variantName: >- + Incredible Bronze Towels Sleek: Frozen, Incredible: + Metal + variantSlug: incredible-bronze-towels-sleek-frozen-incredible-metal + variantSKU: incredible-bronze-towels-sleek-frozen-incredible-metal + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e26729_image16.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 83.09 USD' + width: 19 + height: 72 + length: 18 + purchasedItemsCount: 3 + stripeDetails: + paymentMethod: pm_1P410gJYFi4lcbXWbeKghqjK + paymentIntentId: pi_3P410iJYFi4lcbXW0EKKgcVg + customerId: cus_Ptod8KJBiiPgnH + chargeId: ch_3P410iJYFi4lcbXW0DxUkzCH + stripeCard: + last4: '4242' + brand: Visa + ownerName: Arthur Dent + expires: + year: 2025 + month: 4 + customData: + - key: value + metadata: + isBuyNow: false + isCustomerDeleted: false + isShippingRequired: false + hasDownloads: false + paymentProcessor: stripe + totals: + extras: + - type: tax + name: State Taxes + description: CA Taxes (6.25%) + price: + unit: USD + value: '5892' + string: '3.44' + downloadFiles: + - id: 5e9a5eba75e0ac242e1b6f64 + name: The modern web design process - Webflow Ebook.pdf + url: >- + https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa + - orderId: fc7-128 + status: refunded + comment: Example comment to myself + orderComment: '' + acceptedOn: '2024-03-29T21:29:21Z' + refundedOn: '2024-04-08T18:25:04Z' + 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' + allAddresses: + - type: billing + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + - type: shipping + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingAddress: + type: shipping + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + billingAddress: + type: billing + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingProvider: Shipping Company, Co. + shippingTracking: tr00000000001 + shippingTrackingURL: https://www.shippingcompany.com/tracking/tr00000000001 + customerInfo: + fullName: Arthur Dent + email: arthur.dent@example.com + purchasedItems: + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 55.61 USD' + productId: 66072fb61b89448912e26791 + productName: Luxurious Fresh Ball + productSlug: luxurious-fresh-ball + variantId: 66072fb71b89448912e2683f + variantName: 'Luxurious Fresh Ball Generic: Bronze, Practical: Plastic' + variantSlug: luxurious-fresh-ball-generic-bronze-practical-plastic + variantSKU: luxurious-fresh-ball-generic-bronze-practical-plastic + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2672c_image14.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 55.61 USD' + weight: 11 + width: 82 + height: 70 + length: 9 + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 53.44 USD' + productId: 66072fb61b89448912e26799 + productName: Recycled Steel Gloves + productSlug: recycled-steel-gloves + variantId: 66072fb91b89448912e26ab9 + variantName: >- + Recycled Steel Gloves Electronic: Granite, Handcrafted: + grey + variantSlug: >- + recycled-steel-gloves-electronic-granite-handcrafted-grey + variantSKU: >- + recycled-steel-gloves-electronic-granite-handcrafted-grey + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2671e_image2.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 53.44 USD' + weight: 38 + width: 76 + height: 85 + length: 40 + purchasedItemsCount: 2 + stripeDetails: + paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j + paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft + customerId: cus_PpRsNHwWdUoRKR + chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk + refundReason: fraudulent + stripeCard: + last4: '4242' + brand: Visa + ownerName: Arthur Dent + expires: + year: 2024 + month: 4 + customData: + - key: value + metadata: + isBuyNow: false + isCustomerDeleted: false + isShippingRequired: true + hasDownloads: false + paymentProcessor: stripe + totals: + subtotal: + unit: USD + value: '5892' + string: ' 109.05 USD' + extras: + - type: tax + name: State Taxes + description: NY Taxes (4.00%) + price: + unit: USD + value: '5892' + string: ' 4.36 USD' + - type: tax + name: City Taxes + description: NEW YORK Taxes (4.88%) + price: + unit: USD + value: '5892' + string: ' 5.32 USD' + - type: shipping + name: Flat + description: '' + price: + unit: USD + value: '5892' + string: ' 0.00 USD' + total: + unit: USD + value: '5892' + string: ' 118.73 USD' + downloadFiles: + - id: 5e9a5eba75e0ac242e1b6f64 + name: New product guide + url: >- + https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa + pagination: + limit: 100 + offset: 0 + total: 2 + get: + path: /sites/{site_id}/orders/{order_id} + method: GET + auth: true + docs: | + Retrieve a single product by its ID. All of its SKUs will also be + retrieved. + + Required scope | `ecommerce:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + order_id: + type: string + docs: Unique identifier for an Order + display-name: Get Order + response: + docs: Request was successful + type: root.Order + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + order_id: 5e8518516e147040726cc415 + response: + body: + orderId: fc7-128 + status: refunded + comment: >- + 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-03-29T21:29:21Z' + fulfilledOn: '2024-03-29T21:29:21Z' + refundedOn: '2024-04-08T18:25:04Z' + disputedOn: '2024-03-29T21:29:21Z' + disputeUpdatedOn: '2024-03-29T21:29:21Z' + disputeLastStatus: charge_refunded + 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' + allAddresses: + - type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + - type: shipping + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingAddress: + type: shipping + japanType: kanji + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + billingAddress: + type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingProvider: Shipping Company, Co. + shippingTracking: tr00000000001 + shippingTrackingURL: https://www.shippingcompany.com/tracking/tr00000000001 + customerInfo: + fullName: Arthur Dent + email: arthur.dent@example.com + purchasedItems: + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 55.61 USD' + productId: 66072fb61b89448912e26791 + productName: Luxurious Fresh Ball + productSlug: luxurious-fresh-ball + variantId: 66072fb71b89448912e2683f + variantName: 'Luxurious Fresh Ball Generic: Bronze, Practical: Plastic' + variantSlug: luxurious-fresh-ball-generic-bronze-practical-plastic + variantSKU: luxurious-fresh-ball-generic-bronze-practical-plastic + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2672c_image14.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 55.61 USD' + weight: 11 + width: 82 + height: 70 + length: 9 + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 53.44 USD' + productId: 66072fb61b89448912e26799 + productName: Recycled Steel Gloves + productSlug: recycled-steel-gloves + variantId: 66072fb91b89448912e26ab9 + variantName: 'Recycled Steel Gloves Electronic: Granite, Handcrafted: grey' + variantSlug: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantSKU: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2671e_image2.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 53.44 USD' + weight: 38 + width: 76 + height: 85 + length: 40 + purchasedItemsCount: 2 + stripeDetails: + paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j + paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft + customerId: cus_PpRsNHwWdUoRKR + chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk + refundReason: fraudulent + stripeCard: + last4: '4242' + brand: Visa + ownerName: Arthur Dent + expires: + year: 2024 + month: 4 + customData: + - key: value + metadata: + isBuyNow: false + isCustomerDeleted: false + isShippingRequired: true + hasDownloads: false + paymentProcessor: stripe + totals: + subtotal: + unit: USD + value: '5892' + string: ' 109.05 USD' + extras: + - type: tax + name: State Taxes + description: NY Taxes (4.00%) + price: + unit: USD + value: '5892' + string: ' 4.36 USD' + - type: tax + name: City Taxes + description: NEW YORK Taxes (4.88%) + price: + unit: USD + value: '5892' + string: ' 5.32 USD' + - type: shipping + name: Flat + description: '' + price: + unit: USD + value: '5892' + string: ' 0.00 USD' + total: + unit: USD + value: '5892' + string: ' 118.73 USD' + downloadFiles: + - id: 5e9a5eba75e0ac242e1b6f64 + name: New product guide + url: >- + https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa + update: + path: /sites/{site_id}/orders/{order_id} + method: PATCH + auth: true + docs: | + This API lets you update the fields, `comment`, `shippingProvider`, + and/or `shippingTracking` for a given order. All three fields can be + updated simultaneously or independently. + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + order_id: + type: string + docs: Unique identifier for an Order + display-name: Update Order + request: + name: OrdersUpdateRequest + body: + properties: + comment: + type: optional + docs: Arbitrary data for your records + shippingProvider: + type: optional + docs: Company or method used to ship order + shippingTracking: + type: optional + docs: Tracking number for order shipment + shippingTrackingURL: + type: optional + docs: URL to track order shipment + content-type: application/json + response: + docs: Request was successful + type: root.Order + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + order_id: 5e8518516e147040726cc415 + request: {} + response: + body: + orderId: fc7-128 + status: refunded + comment: >- + 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-03-29T21:29:21Z' + fulfilledOn: '2024-03-29T21:29:21Z' + refundedOn: '2024-04-08T18:25:04Z' + disputedOn: '2024-03-29T21:29:21Z' + disputeUpdatedOn: '2024-03-29T21:29:21Z' + disputeLastStatus: charge_refunded + 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' + allAddresses: + - type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + - type: shipping + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingAddress: + type: shipping + japanType: kanji + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + billingAddress: + type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingProvider: Shipping Company, Co. + shippingTracking: tr00000000001 + shippingTrackingURL: https://www.shippingcompany.com/tracking/tr00000000001 + customerInfo: + fullName: Arthur Dent + email: arthur.dent@example.com + purchasedItems: + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 55.61 USD' + productId: 66072fb61b89448912e26791 + productName: Luxurious Fresh Ball + productSlug: luxurious-fresh-ball + variantId: 66072fb71b89448912e2683f + variantName: 'Luxurious Fresh Ball Generic: Bronze, Practical: Plastic' + variantSlug: luxurious-fresh-ball-generic-bronze-practical-plastic + variantSKU: luxurious-fresh-ball-generic-bronze-practical-plastic + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2672c_image14.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 55.61 USD' + weight: 11 + width: 82 + height: 70 + length: 9 + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 53.44 USD' + productId: 66072fb61b89448912e26799 + productName: Recycled Steel Gloves + productSlug: recycled-steel-gloves + variantId: 66072fb91b89448912e26ab9 + variantName: 'Recycled Steel Gloves Electronic: Granite, Handcrafted: grey' + variantSlug: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantSKU: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2671e_image2.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 53.44 USD' + weight: 38 + width: 76 + height: 85 + length: 40 + purchasedItemsCount: 2 + stripeDetails: + paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j + paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft + customerId: cus_PpRsNHwWdUoRKR + chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk + refundReason: fraudulent + stripeCard: + last4: '4242' + brand: Visa + ownerName: Arthur Dent + expires: + year: 2024 + month: 4 + customData: + - key: value + metadata: + isBuyNow: false + isCustomerDeleted: false + isShippingRequired: true + hasDownloads: false + paymentProcessor: stripe + totals: + subtotal: + unit: USD + value: '5892' + string: ' 109.05 USD' + extras: + - type: tax + name: State Taxes + description: NY Taxes (4.00%) + price: + unit: USD + value: '5892' + string: ' 4.36 USD' + - type: tax + name: City Taxes + description: NEW YORK Taxes (4.88%) + price: + unit: USD + value: '5892' + string: ' 5.32 USD' + - type: shipping + name: Flat + description: '' + price: + unit: USD + value: '5892' + string: ' 0.00 USD' + total: + unit: USD + value: '5892' + string: ' 118.73 USD' + downloadFiles: + - id: 5e9a5eba75e0ac242e1b6f64 + name: New product guide + url: >- + https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa + update-fulfill: + path: /sites/{site_id}/orders/{order_id}/fulfill + method: POST + auth: true + docs: | + Updates an order's status to fulfilled + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + order_id: + type: string + docs: Unique identifier for an Order + display-name: Fulfill Order + request: + name: OrdersUpdateFulfillRequest + body: + properties: + sendOrderFulfilledEmail: + type: optional + docs: Whether or not the Order Fulfilled email should be sent + default: false + content-type: application/json + response: + docs: Request was successful + type: root.Order + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + order_id: 5e8518516e147040726cc415 + request: {} + response: + body: + orderId: fc7-128 + status: refunded + comment: >- + 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-03-29T21:29:21Z' + fulfilledOn: '2024-03-29T21:29:21Z' + refundedOn: '2024-04-08T18:25:04Z' + disputedOn: '2024-03-29T21:29:21Z' + disputeUpdatedOn: '2024-03-29T21:29:21Z' + disputeLastStatus: charge_refunded + 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' + allAddresses: + - type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + - type: shipping + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingAddress: + type: shipping + japanType: kanji + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + billingAddress: + type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingProvider: Shipping Company, Co. + shippingTracking: tr00000000001 + shippingTrackingURL: https://www.shippingcompany.com/tracking/tr00000000001 + customerInfo: + fullName: Arthur Dent + email: arthur.dent@example.com + purchasedItems: + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 55.61 USD' + productId: 66072fb61b89448912e26791 + productName: Luxurious Fresh Ball + productSlug: luxurious-fresh-ball + variantId: 66072fb71b89448912e2683f + variantName: 'Luxurious Fresh Ball Generic: Bronze, Practical: Plastic' + variantSlug: luxurious-fresh-ball-generic-bronze-practical-plastic + variantSKU: luxurious-fresh-ball-generic-bronze-practical-plastic + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2672c_image14.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 55.61 USD' + weight: 11 + width: 82 + height: 70 + length: 9 + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 53.44 USD' + productId: 66072fb61b89448912e26799 + productName: Recycled Steel Gloves + productSlug: recycled-steel-gloves + variantId: 66072fb91b89448912e26ab9 + variantName: 'Recycled Steel Gloves Electronic: Granite, Handcrafted: grey' + variantSlug: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantSKU: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2671e_image2.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 53.44 USD' + weight: 38 + width: 76 + height: 85 + length: 40 + purchasedItemsCount: 2 + stripeDetails: + paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j + paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft + customerId: cus_PpRsNHwWdUoRKR + chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk + refundReason: fraudulent + stripeCard: + last4: '4242' + brand: Visa + ownerName: Arthur Dent + expires: + year: 2024 + month: 4 + customData: + - key: value + metadata: + isBuyNow: false + isCustomerDeleted: false + isShippingRequired: true + hasDownloads: false + paymentProcessor: stripe + totals: + subtotal: + unit: USD + value: '5892' + string: ' 109.05 USD' + extras: + - type: tax + name: State Taxes + description: NY Taxes (4.00%) + price: + unit: USD + value: '5892' + string: ' 4.36 USD' + - type: tax + name: City Taxes + description: NEW YORK Taxes (4.88%) + price: + unit: USD + value: '5892' + string: ' 5.32 USD' + - type: shipping + name: Flat + description: '' + price: + unit: USD + value: '5892' + string: ' 0.00 USD' + total: + unit: USD + value: '5892' + string: ' 118.73 USD' + downloadFiles: + - id: 5e9a5eba75e0ac242e1b6f64 + name: New product guide + url: >- + https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa + update-unfulfill: + path: /sites/{site_id}/orders/{order_id}/unfulfill + method: POST + auth: true + docs: | + Updates an order's status to unfulfilled + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + order_id: + type: string + docs: Unique identifier for an Order + display-name: Unfulfill Order + response: + docs: Request was successful + type: root.Order + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + order_id: 5e8518516e147040726cc415 + response: + body: + orderId: fc7-128 + status: refunded + comment: >- + 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-03-29T21:29:21Z' + fulfilledOn: '2024-03-29T21:29:21Z' + refundedOn: '2024-04-08T18:25:04Z' + disputedOn: '2024-03-29T21:29:21Z' + disputeUpdatedOn: '2024-03-29T21:29:21Z' + disputeLastStatus: charge_refunded + 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' + allAddresses: + - type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + - type: shipping + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingAddress: + type: shipping + japanType: kanji + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + billingAddress: + type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingProvider: Shipping Company, Co. + shippingTracking: tr00000000001 + shippingTrackingURL: https://www.shippingcompany.com/tracking/tr00000000001 + customerInfo: + fullName: Arthur Dent + email: arthur.dent@example.com + purchasedItems: + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 55.61 USD' + productId: 66072fb61b89448912e26791 + productName: Luxurious Fresh Ball + productSlug: luxurious-fresh-ball + variantId: 66072fb71b89448912e2683f + variantName: 'Luxurious Fresh Ball Generic: Bronze, Practical: Plastic' + variantSlug: luxurious-fresh-ball-generic-bronze-practical-plastic + variantSKU: luxurious-fresh-ball-generic-bronze-practical-plastic + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2672c_image14.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 55.61 USD' + weight: 11 + width: 82 + height: 70 + length: 9 + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 53.44 USD' + productId: 66072fb61b89448912e26799 + productName: Recycled Steel Gloves + productSlug: recycled-steel-gloves + variantId: 66072fb91b89448912e26ab9 + variantName: 'Recycled Steel Gloves Electronic: Granite, Handcrafted: grey' + variantSlug: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantSKU: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2671e_image2.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 53.44 USD' + weight: 38 + width: 76 + height: 85 + length: 40 + purchasedItemsCount: 2 + stripeDetails: + paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j + paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft + customerId: cus_PpRsNHwWdUoRKR + chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk + refundReason: fraudulent + stripeCard: + last4: '4242' + brand: Visa + ownerName: Arthur Dent + expires: + year: 2024 + month: 4 + customData: + - key: value + metadata: + isBuyNow: false + isCustomerDeleted: false + isShippingRequired: true + hasDownloads: false + paymentProcessor: stripe + totals: + subtotal: + unit: USD + value: '5892' + string: ' 109.05 USD' + extras: + - type: tax + name: State Taxes + description: NY Taxes (4.00%) + price: + unit: USD + value: '5892' + string: ' 4.36 USD' + - type: tax + name: City Taxes + description: NEW YORK Taxes (4.88%) + price: + unit: USD + value: '5892' + string: ' 5.32 USD' + - type: shipping + name: Flat + description: '' + price: + unit: USD + value: '5892' + string: ' 0.00 USD' + total: + unit: USD + value: '5892' + string: ' 118.73 USD' + downloadFiles: + - id: 5e9a5eba75e0ac242e1b6f64 + name: New product guide + url: >- + https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa + refund: + path: /sites/{site_id}/orders/{order_id}/refund + method: POST + auth: true + docs: | + This API will reverse a Stripe charge and refund an order back to a + customer. It will also set the order's status to `refunded`. + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + order_id: + type: string + docs: Unique identifier for an Order + display-name: Refund Order + request: + name: OrdersRefundRequest + body: + properties: + reason: + type: optional + docs: The reason for the refund + content-type: application/json + response: + docs: Request was successful + type: root.Order + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + order_id: 5e8518516e147040726cc415 + request: {} + response: + body: + orderId: fc7-128 + status: refunded + comment: >- + 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-03-29T21:29:21Z' + fulfilledOn: '2024-03-29T21:29:21Z' + refundedOn: '2024-04-08T18:25:04Z' + disputedOn: '2024-03-29T21:29:21Z' + disputeUpdatedOn: '2024-03-29T21:29:21Z' + disputeLastStatus: charge_refunded + 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' + allAddresses: + - type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + - type: shipping + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingAddress: + type: shipping + japanType: kanji + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + billingAddress: + type: billing + japanType: kana + addressee: Arthur Dent + line1: 20 W 34th St + line2: Empire State Building + city: New York + state: New York + country: US + postalCode: '10118' + shippingProvider: Shipping Company, Co. + shippingTracking: tr00000000001 + shippingTrackingURL: https://www.shippingcompany.com/tracking/tr00000000001 + customerInfo: + fullName: Arthur Dent + email: arthur.dent@example.com + purchasedItems: + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 55.61 USD' + productId: 66072fb61b89448912e26791 + productName: Luxurious Fresh Ball + productSlug: luxurious-fresh-ball + variantId: 66072fb71b89448912e2683f + variantName: 'Luxurious Fresh Ball Generic: Bronze, Practical: Plastic' + variantSlug: luxurious-fresh-ball-generic-bronze-practical-plastic + variantSKU: luxurious-fresh-ball-generic-bronze-practical-plastic + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2672c_image14.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 55.61 USD' + weight: 11 + width: 82 + height: 70 + length: 9 + - count: 1 + rowTotal: + unit: USD + value: '5892' + string: ' 53.44 USD' + productId: 66072fb61b89448912e26799 + productName: Recycled Steel Gloves + productSlug: recycled-steel-gloves + variantId: 66072fb91b89448912e26ab9 + variantName: 'Recycled Steel Gloves Electronic: Granite, Handcrafted: grey' + variantSlug: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantSKU: recycled-steel-gloves-electronic-granite-handcrafted-grey + variantImage: + url: >- + https://d1otoma47x30pg.cloudfront.net/66072f39417a2a35b2589cc7/66072fb51b89448912e2671e_image2.jpeg + variantPrice: + unit: USD + value: '5892' + string: ' 53.44 USD' + weight: 38 + width: 76 + height: 85 + length: 40 + purchasedItemsCount: 2 + stripeDetails: + paymentMethod: pm_1OzmzBJYFi4lcbXWHKNdXU7j + paymentIntentId: pi_3OzmzDJYFi4lcbXW1hTBW6ft + customerId: cus_PpRsNHwWdUoRKR + chargeId: ch_3OzmzDJYFi4lcbXW1ndkkrH2 + refundId: re_3OzmzDJYFi4lcbXW1kFAmlBk + refundReason: fraudulent + stripeCard: + last4: '4242' + brand: Visa + ownerName: Arthur Dent + expires: + year: 2024 + month: 4 + customData: + - key: value + metadata: + isBuyNow: false + isCustomerDeleted: false + isShippingRequired: true + hasDownloads: false + paymentProcessor: stripe + totals: + subtotal: + unit: USD + value: '5892' + string: ' 109.05 USD' + extras: + - type: tax + name: State Taxes + description: NY Taxes (4.00%) + price: + unit: USD + value: '5892' + string: ' 4.36 USD' + - type: tax + name: City Taxes + description: NEW YORK Taxes (4.88%) + price: + unit: USD + value: '5892' + string: ' 5.32 USD' + - type: shipping + name: Flat + description: '' + price: + unit: USD + value: '5892' + string: ' 0.00 USD' + total: + unit: USD + value: '5892' + string: ' 118.73 USD' + downloadFiles: + - id: 5e9a5eba75e0ac242e1b6f64 + name: New product guide + url: >- + https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Orders diff --git a/.mock/definition/pages.yml b/.mock/definition/pages.yml new file mode 100644 index 00000000..94a952bb --- /dev/null +++ b/.mock/definition/pages.yml @@ -0,0 +1,435 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/pages + method: GET + auth: true + docs: | + List of all pages for a site. + + Required scope | `pages:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Pages + request: + name: PagesListRequest + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + response: + docs: Request was successful + type: root.PageList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + pages: + - id: 6596da6045e56dee495bcbba + siteId: 6258612d1ee792848f805dcf + title: Guide to the Galaxy + slug: guide-to-the-galaxy + createdOn: '2024-03-11T10:42:00Z' + lastUpdated: '2024-03-11T10:42:42Z' + archived: false + draft: false + canBranch: true + isBranch: false + isMembersOnly: false + seo: + title: The Ultimate Hitchhiker's Guide to the Galaxy + description: >- + Everything you need to know about the galaxy, from + avoiding Vogon poetry to the importance of towels. + openGraph: + title: Explore the Cosmos with The Ultimate Guide + titleCopied: false + description: >- + Dive deep into the mysteries of the universe with your + guide to everything galactic. + descriptionCopied: false + localeId: 653fd9af6a07fc9cfd7a5e57 + publishedPath: /en-us/guide-to-the-galaxy + - id: 6596da6045e56dee495bcbad + siteId: 6258612d1ee792848f805dcf + title: Towel Day Celebrations + slug: towel-day + createdOn: '2024-05-25T09:00:00Z' + lastUpdated: '2024-05-25T09:42:00Z' + archived: false + draft: false + canBranch: true + isBranch: false + isMembersOnly: false + seo: + title: Celebrate Towel Day - The Hitchhiker's Guide to the Galaxy + description: >- + A guide to celebrating Towel Day, in honor of the most + massively useful thing an interstellar hitchhiker can + have. + openGraph: + title: Towel Day - Don't Panic + titleCopied: false + description: >- + Join the galaxy in celebrating Towel Day, the day + dedicated to carrying towels everywhere in memory of + Douglas Adams. + descriptionCopied: false + localeId: 653fd9af6a07fc9cfd7a5e57 + publishedPath: /en-us/towel-day + pagination: + limit: 20 + offset: 0 + total: 2 + get-metadata: + path: /pages/{page_id} + method: GET + auth: true + docs: | + Get metadata information for a single page. + + Required scope | `pages:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + page_id: + type: string + docs: Unique identifier for a Page + display-name: Get Page Metadata + request: + name: PagesGetMetadataRequest + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + response: + docs: Request was successful + type: root.Page + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + page_id: 63c720f9347c2139b248e552 + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + id: 6596da6045e56dee495bcbba + siteId: 6258612d1ee792848f805dcf + title: Guide to the Galaxy + slug: guide-to-the-galaxy + createdOn: '2024-03-11T10:42:00Z' + lastUpdated: '2024-03-11T10:42:42Z' + archived: false + draft: false + canBranch: true + isBranch: false + isMembersOnly: false + seo: + title: The Ultimate Hitchhiker's Guide to the Galaxy + description: >- + Everything you need to know about the galaxy, from avoiding + Vogon poetry to the importance of towels. + openGraph: + title: Explore the Cosmos with The Ultimate Guide + titleCopied: false + description: >- + Dive deep into the mysteries of the universe with your guide + to everything galactic. + descriptionCopied: false + localeId: 653fd9af6a07fc9cfd7a5e57 + publishedPath: /en-us/guide-to-the-galaxy + update-page-settings: + path: /pages/{page_id} + method: PUT + auth: true + docs: | + Update Page-level metadata, including SEO and Open Graph fields. + + Required scope | `pages:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + page_id: + type: string + docs: Unique identifier for a Page + display-name: Update Page Metadata + request: + body: root.Page + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + name: UpdatePageSettingsRequest + content-type: application/json + response: + docs: Request was successful + type: root.Page + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + page_id: 63c720f9347c2139b248e552 + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + request: + id: 6596da6045e56dee495bcbba + siteId: 6258612d1ee792848f805dcf + title: Guide to the Galaxy + slug: guide-to-the-galaxy + createdOn: '2024-03-11T10:42:00Z' + lastUpdated: '2024-03-11T10:42:42Z' + archived: false + draft: false + canBranch: true + isBranch: false + seo: + title: The Ultimate Hitchhiker's Guide to the Galaxy + description: >- + Everything you need to know about the galaxy, from avoiding + Vogon poetry to the importance of towels. + openGraph: + title: Explore the Cosmos with The Ultimate Guide + titleCopied: false + description: >- + Dive deep into the mysteries of the universe with your guide to + everything galactic. + descriptionCopied: false + localeId: 653fd9af6a07fc9cfd7a5e57 + publishedPath: /en-us/guide-to-the-galaxy + response: + body: + id: 6596da6045e56dee495bcbba + siteId: 6258612d1ee792848f805dcf + title: Guide to the Galaxy + slug: guide-to-the-galaxy + createdOn: '2024-03-11T10:42:00Z' + lastUpdated: '2024-03-11T10:42:42Z' + archived: false + draft: false + canBranch: true + isBranch: false + isMembersOnly: false + seo: + title: The Ultimate Hitchhiker's Guide to the Galaxy + description: >- + Everything you need to know about the galaxy, from avoiding + Vogon poetry to the importance of towels. + openGraph: + title: Explore the Cosmos with The Ultimate Guide + titleCopied: false + description: >- + Dive deep into the mysteries of the universe with your guide + to everything galactic. + descriptionCopied: false + localeId: 653fd9af6a07fc9cfd7a5e57 + publishedPath: /en-us/guide-to-the-galaxy + get-content: + path: /pages/{page_id}/dom + method: GET + auth: true + docs: > + Get static content from a static page. + + + If you do not provide a Locale ID in your request, the response will + return any content that can be localized from the Primary locale. + + + Required scope | `pages:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + page_id: + type: string + docs: Unique identifier for a Page + display-name: Get Page Content + request: + name: PagesGetContentRequest + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + response: + docs: Request was successful + type: root.Dom + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + page_id: 63c720f9347c2139b248e552 + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + pageId: 658205daa3e8206a523b5ad4 + nodes: + - id: a245c12d-995b-55ee-5ec7-aa36a6cad623 + type: text + text: + html:

The Hitchhiker's Guide to the Galaxy

+ text: The Hitchhiker's Guide to the Galaxy + attributes: + key: value + - id: a245c12d-995b-55ee-5ec7-aa36a6cad627 + type: text + text: + html: >- +

Don't Panic!

Always know where your towel + is.

+ attributes: + key: value + - id: a245c12d-995b-55ee-5ec7-aa36a6cad629 + type: image + image: + alt: Marvin, the Paranoid Android + assetId: 659595234426a9fcbad57043 + attributes: + key: value + pagination: + limit: 3 + offset: 0 + total: 3 + update-static-content: + path: /pages/{page_id}/dom + method: POST + auth: true + docs: > + This endpoint allows for updating static content on a static page within + a secondary locale. It is designed specifically for localized pages and + can handle up to 1000 nodes per request. + +

Note:This + endpoint is specifically for localized pages. Ensure that the locale + specified is a valid secondary locale for the site.

+ + + Required scope | `pages:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + page_id: + type: string + docs: Unique identifier for a Page + display-name: Update Page Content + request: + name: DomWrite + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + body: + properties: + nodes: list + content-type: application/json + response: + docs: Request was successful + type: UpdateStaticContentResponse + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + page_id: 63c720f9347c2139b248e552 + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + request: + nodes: + - nodeId: a245c12d-995b-55ee-5ec7-aa36a6cad623 + text:

The Hitchhiker’s Guide to the Galaxy

+ - nodeId: a245c12d-995b-55ee-5ec7-aa36a6cad627 + text: >- +

Don’t Panic!

Always know where your towel + is.

+ - nodeId: a245c12d-995b-55ee-5ec7-aa36a6cad629 + text: >- + Marvin, the Paranoid Android + response: + body: + errors: + - errors + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Pages +types: + DomWriteNodesItem: + properties: + nodeId: + type: string + docs: Node UUID + text: + type: string + docs: >- + HTML content of the node, including the HTML tag. The HTML tags must + be the same as what's returned from the Get Content endpoint. + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + UpdateStaticContentResponse: + properties: + errors: + docs: A list of error messages, if any. + type: list + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/pages/scripts.yml b/.mock/definition/pages/scripts.yml new file mode 100644 index 00000000..fc0bbe5e --- /dev/null +++ b/.mock/definition/pages/scripts.yml @@ -0,0 +1,169 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + get-custom-code: + path: /pages/{page_id}/custom_code + method: GET + auth: true + docs: > + Get all registered scripts that have been applied to a specific Page. + + + In order to use the Custom Code APIs for Sites and Pages, Custom Code + Scripts must first be registered + + to a Site via the `registered_scripts` endpoints, and then applied to a + Site or Page using the appropriate + + `custom_code` endpoints. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + page_id: + type: string + docs: Unique identifier for a Page + display-name: Get Custom Code + response: + docs: Request was successful + type: root.ScriptApplyList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + page_id: 63c720f9347c2139b248e552 + response: + body: + scripts: + - id: id + location: header + version: version + attributes: + key: value + lastUpdated: lastUpdated + createdOn: createdOn + upsert-custom-code: + path: /pages/{page_id}/custom_code + method: PUT + auth: true + docs: > + Add a registered script to a Page. + + + In order to use the Custom Code APIs for Sites and Pages, Custom Code + Scripts must first be registered + + to a Site via the `registered_scripts` endpoints, and then applied to a + Site or Page using the appropriate + + `custom_code` endpoints. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + page_id: + type: string + docs: Unique identifier for a Page + display-name: Add/Update Custom Code + request: + body: root.ScriptApplyList + content-type: application/json + response: + docs: Request was successful + type: root.ScriptApplyList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + page_id: 63c720f9347c2139b248e552 + request: + scripts: + - id: cms_slider + location: header + version: 1.0.0 + attributes: + my-attribute: some-value + - id: alert + location: header + version: 0.0.1 + response: + body: + scripts: + - id: cms_slider + location: header + version: 1.0.0 + attributes: + my-attribute: some-value + - id: alert + location: header + version: 0.0.1 + attributes: + key: value + lastUpdated: '2022-10-26T00:28:54.191Z' + createdOn: '2022-10-26T00:28:54.191Z' + delete-custom-code: + path: /pages/{page_id}/custom_code + method: DELETE + auth: true + docs: > + Delete the custom code block that an app has created for a page + + + In order to use the Custom Code APIs for Sites and Pages, Custom Code + Scripts must first be registered + + to a Site via the `registered_scripts` endpoints, and then applied to a + Site or Page using the appropriate + + `custom_code` endpoints. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + page_id: + type: string + docs: Unique identifier for a Page + display-name: Delete Custom Code + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + page_id: 63c720f9347c2139b248e552 + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/products.yml b/.mock/definition/products.yml new file mode 100644 index 00000000..076b222e --- /dev/null +++ b/.mock/definition/products.yml @@ -0,0 +1,500 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/products + method: GET + auth: true + docs: > + Retrieve all products for a site. + + + Use `limit` and `offset` to page through all products with subsequent + requests. All SKUs for each product + + will also be fetched and returned. The `limit`, `offset` and `total` + values represent Products only and do not include any SKUs. + + + Required scope | `ecommerce:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Products & SKUs + request: + name: ProductsListRequest + 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.ProductAndSkUsList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + items: + - product: + id: 660eb7a486d1d6e0412292d7 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2024-04-04T14:24:19Z' + lastUpdated: '2024-04-04T14:30:19Z' + createdOn: '2024-04-04T14:22:28Z' + isArchived: false + isDraft: false + fieldData: + name: T-Shirt + slug: t-shirt + description: A plain cotton t-shirt. + shippable: true + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue + skus: + - id: 580e63fc8c9a982ac9b8b745 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35Z' + lastUpdated: '2023-03-17T18:47:35Z' + createdOn: '2023-03-17T18:47:35Z' + fieldData: + sku-values: + ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 + name: Blue T-shirt + slug: t-shirt-blue + price: + value: 100 + unit: USD + quantity: 10 + pagination: + limit: 100 + offset: 0 + total: 100 + create: + path: /sites/{site_id}/products + method: POST + auth: true + docs: > + Create a new product and SKU. + + + When you create a product, you will always create a SKU, since a Product + Item must have, at minimum, a single SKU. + + + To create a Product with multiple SKUs - for example a T-shirt in sizes + small, medium and large: + - Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). + - A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. + - Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created. + - In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. + - After you've created your product, you can create additional SKUs using the [Create SKU endpoint.](/data/reference/ecommerce/products-sk-us/create-sku) + + Upon creation, the default product type will be `Advanced`, which + ensures all Product and SKU fields will be shown to users in the + Designer. + + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Create Product & SKU + request: + name: ProductSkuCreate + body: + properties: + publishStatus: optional + product: optional + sku: optional + content-type: application/json + response: + docs: Request was successful + type: root.ProductAndSkUs + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: {} + response: + body: + product: + id: 660eb7a486d1d6e0412292d7 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2024-04-04T14:24:19Z' + lastUpdated: '2024-04-04T14:30:19Z' + createdOn: '2024-04-04T14:22:28Z' + isArchived: false + isDraft: false + fieldData: + name: T-Shirt + slug: t-shirt + description: A plain cotton t-shirt. + shippable: true + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue + categories: + - categories + tax-category: standard-taxable + default-sku: default-sku + ec-product-type: ff42fee0113744f693a764e3431a9cc2 + skus: + - id: 580e63fc8c9a982ac9b8b745 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35Z' + lastUpdated: '2023-03-17T18:47:35Z' + createdOn: '2023-03-17T18:47:35Z' + fieldData: + sku-values: + ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 + name: Blue T-shirt + slug: t-shirt-blue + price: + value: 100 + unit: USD + quantity: 10 + get: + path: /sites/{site_id}/products/{product_id} + method: GET + auth: true + docs: | + Retrieve a single product by its ID. All of its SKUs will also be + retrieved. + + Required scope | `ecommerce:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + product_id: + type: string + docs: Unique identifier for a Product + display-name: Get Product and SKUs + response: + docs: Request was successful + type: root.ProductAndSkUs + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + product_id: 580e63fc8c9a982ac9b8b745 + response: + body: + product: + id: 660eb7a486d1d6e0412292d7 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2024-04-04T14:24:19Z' + lastUpdated: '2024-04-04T14:30:19Z' + createdOn: '2024-04-04T14:22:28Z' + isArchived: false + isDraft: false + fieldData: + name: T-Shirt + slug: t-shirt + description: A plain cotton t-shirt. + shippable: true + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue + categories: + - categories + tax-category: standard-taxable + default-sku: default-sku + ec-product-type: ff42fee0113744f693a764e3431a9cc2 + skus: + - id: 580e63fc8c9a982ac9b8b745 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35Z' + lastUpdated: '2023-03-17T18:47:35Z' + createdOn: '2023-03-17T18:47:35Z' + fieldData: + sku-values: + ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 + name: Blue T-shirt + slug: t-shirt-blue + price: + value: 100 + unit: USD + quantity: 10 + update: + path: /sites/{site_id}/products/{product_id} + method: PATCH + auth: true + docs: > + Update an existing Product. + + + Updating an existing Product will set the product type to `Advanced`, + which ensures all Product and SKU fields will be shown to users in the + Designer. + + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + product_id: + type: string + docs: Unique identifier for a Product + display-name: Update Product + request: + name: ProductSkuUpdate + body: + properties: + publishStatus: optional + product: optional + sku: optional + content-type: application/json + response: + docs: Request was successful + type: root.Product + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + product_id: 580e63fc8c9a982ac9b8b745 + request: {} + response: + body: + id: 660eb7a486d1d6e0412292d7 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2024-04-04T14:24:19Z' + lastUpdated: '2024-04-04T14:30:19Z' + createdOn: '2024-04-04T14:22:28Z' + isArchived: false + isDraft: false + fieldData: + name: T-Shirt + slug: t-shirt + description: A plain cotton t-shirt. + shippable: true + sku-properties: + - id: Color + name: Color + enum: + - id: id + name: Royal Blue + slug: royal-blue + categories: + - categories + tax-category: standard-taxable + default-sku: default-sku + ec-product-type: ff42fee0113744f693a764e3431a9cc2 + create-sku: + path: /sites/{site_id}/products/{product_id}/skus + method: POST + auth: true + docs: > + Create additional SKUs to manage every [option and variant of your + Product.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants) + + + Creating SKUs through the API will set the product type to `Advanced`, + which ensures all Product and SKU fields will be shown to users in the + Designer. + + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + product_id: + type: string + docs: Unique identifier for a Product + display-name: Create SKU + request: + name: ProductsCreateSkuRequest + body: + properties: + publishStatus: optional + skus: + docs: An array of the SKU data your are adding + type: list + content-type: application/json + response: + docs: Request was successful + type: ProductsCreateSkuResponse + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + product_id: 580e63fc8c9a982ac9b8b745 + request: + skus: + - {} + response: + body: + skus: + - id: 580e63fc8c9a982ac9b8b745 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35Z' + lastUpdated: '2023-03-17T18:47:35Z' + createdOn: '2023-03-17T18:47:35Z' + fieldData: + sku-values: + ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 + name: Blue T-shirt + slug: t-shirt-blue + price: + value: 100 + unit: USD + quantity: 10 + update-sku: + path: /sites/{site_id}/products/{product_id}/skus/{sku_id} + method: PATCH + auth: true + docs: > + Update a specified SKU. + + + Updating an existing SKU will set the Product type to `Advanced`, which + ensures all Product and SKU fields will be shown to users in the + Designer. + + + Required scope | `ecommerce:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + product_id: + type: string + docs: Unique identifier for a Product + sku_id: + type: string + docs: Unique identifier for a SKU + display-name: Update SKU + request: + name: ProductsUpdateSkuRequest + body: + properties: + publishStatus: optional + sku: root.Sku + content-type: application/json + response: + docs: Request was successful + type: root.Sku + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + product_id: 580e63fc8c9a982ac9b8b745 + sku_id: 5e8518516e147040726cc415 + request: + sku: {} + response: + body: + id: 580e63fc8c9a982ac9b8b745 + cmsLocaleId: 653ad57de882f528b32e810e + lastPublished: '2023-03-17T18:47:35Z' + lastUpdated: '2023-03-17T18:47:35Z' + createdOn: '2023-03-17T18:47:35Z' + fieldData: + sku-values: + ff42fee0113744f693a764e3431a9cc2: 64a74715c456e36762fc39a1 + name: Blue T-shirt + slug: t-shirt-blue + price: + value: 100 + unit: USD + compare-at-price: + value: 100 + unit: USD + ec-sku-billing-method: one-time + ec-sku-subscription-plan: + interval: day + frequency: 1 + trial: 7 + plans: + - {} + track-inventory: true + quantity: 10 + source: + openapi: ../../../referenced-specs/v2.yml +types: + ProductsCreateSkuResponse: + properties: + skus: optional> + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/scripts.yml b/.mock/definition/scripts.yml new file mode 100644 index 00000000..1bd50bb8 --- /dev/null +++ b/.mock/definition/scripts.yml @@ -0,0 +1,254 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/registered_scripts + method: GET + auth: true + docs: > + List of scripts registered to a Site. + + + In order to use the Custom Code APIs for Sites and Pages, Custom Code + Scripts must first be registered + + to a Site via the `registered_scripts` endpoints, and then applied to a + Site or Page using the appropriate + + `custom_code` endpoints. + + Additionally, Scripts can be remotely hosted, or registered as inline + snippets. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Get Registered Scripts + response: + docs: Request was successful + type: root.RegisteredScriptList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + registeredScripts: + - id: alert + canCopy: false + displayName: Alert + hostedLocation: https://cdn.webflow.io/.../alert-0.0.1.js + createdOn: '2022-10-26T00:28:54.191Z' + lastUpdated: lastUpdated + version: 0.0.1 + - id: alert + canCopy: false + displayName: Alert + hostedLocation: https://cdn.webflow.io/.../alert-0.0.2.js + createdOn: '2022-10-26T00:28:54.191Z' + lastUpdated: lastUpdated + version: 0.0.2 + - id: cms_slider + canCopy: true + displayName: CMS Slider + hostedLocation: https://cdn.jsdelivr.net/.../cms_slider.js + integrityHash: >- + sha384-J+YlJ8v0gpaRoKH7SbFbEmxOZlAxLiwNjfSsBhDooGa5roXlPPpXbEevck4J7YZ+ + createdOn: '2022-10-26T00:28:54.191Z' + lastUpdated: lastUpdated + version: 1.0.0 + register-hosted: + path: /sites/{site_id}/registered_scripts/hosted + method: POST + auth: true + docs: > + Add a script to a Site's Custom Code registry. + + + In order to use the Custom Code APIs for Sites and Pages, Custom Code + Scripts must first be registered + + to a Site via the `registered_scripts` endpoints, and then applied to a + Site or Page using the appropriate + + `custom_code` endpoints. + + Additionally, Scripts can be remotely hosted, or registered as inline + snippets. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Register Script - Hosted + request: + name: CustomCodeHostedRequest + body: + properties: + hostedLocation: + type: string + docs: URI for an externally hosted script location + integrityHash: + type: string + docs: Sub-Resource Integrity Hash + canCopy: + type: optional + docs: >- + Define whether the script can be copied on site duplication and + transfer + default: false + version: + type: string + docs: >- + A Semantic Version (SemVer) string, denoting the version of the + script + displayName: + type: string + docs: >- + User-facing name for the script. Must be between 1 and 50 + alphanumeric characters + content-type: application/json + response: + docs: Request was successful + type: root.CustomCodeHostedResponse + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + hostedLocation: hostedLocation + integrityHash: integrityHash + version: version + displayName: displayName + response: + body: + id: cms_slider + canCopy: true + displayName: CMS Slider + hostedLocation: https://cdn.jsdelivr.net/.../cmsslider.js + integrityHash: >- + sha384-J+YlJ8v0gpaRoKH7SbFbEmxOZlAxLiwNjfSsBhDooGa5roXlPPpXbEevck4J7YZ+ + createdOn: '2022-10-26T00:28:54.191Z' + lastUpdated: lastUpdated + version: 1.0.0 + register-inline: + path: /sites/{site_id}/registered_scripts/inline + method: POST + auth: true + docs: > + Add a script to a Site's Custom Code registry. Inline scripts can be + between 1 and 2000 characters. + + + In order to use the Custom Code APIs for Sites and Pages, Custom Code + Scripts must first be registered + + to a Site via the `registered_scripts` endpoints, and then applied to a + Site or Page using the appropriate + + `custom_code` endpoints. + + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Register Script - Inline + request: + name: CustomCodeInlineRequest + body: + properties: + sourceCode: + type: string + docs: The code to be added to the site (to be hosted by Webflow). + integrityHash: + type: optional + docs: >- + Sub-Resource Integrity Hash. Only required for externally hosted + scripts (passed via hostedLocation) + canCopy: + type: optional + docs: >- + Define whether the script can be copied on site duplication and + transfer + default: false + version: + type: string + docs: >- + A Semantic Version (SemVer) string, denoting the version of the + script + displayName: + type: string + docs: >- + User-facing name for the script. Must be between 1 and 50 + alphanumeric characters + content-type: application/json + response: + docs: Created + type: root.CustomCodeInlineResponse + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + sourceCode: alert('hello world'); + version: 0.0.1 + displayName: Alert + response: + body: + id: alert + canCopy: false + displayName: Alert + hostedLocation: >- + https://uploads-ssl.webflow.com/6258612d1ee792848f805dcf%2F64b6c769ff52ba6c3d904a91%2F660d6e15b3d1696f2d2b1447%2Falert-0.0.1.js + createdOn: '2022-10-26T00:28:54.191Z' + lastUpdated: lastUpdated + version: 0.0.1 + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/sites.yml b/.mock/definition/sites.yml new file mode 100644 index 00000000..590df510 --- /dev/null +++ b/.mock/definition/sites.yml @@ -0,0 +1,297 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites + method: GET + auth: true + docs: | + List of all sites the provided access token is able to access. + + Required scope | `sites:read` + source: + openapi: ../../../referenced-specs/v2.yml + display-name: List Sites + response: + docs: Request was successful + type: root.Sites + errors: + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + examples: + - response: + body: + sites: + - id: 42e63e98c9a982ac9b8b741 + workspaceId: 42e63fc8c9a982ac9b8b744 + createdOn: '1979-10-12T12:00:00Z' + displayName: Heart of Gold Spaceship + shortName: heart-of-gold + lastPublished: '2023-04-02T12:42:00Z' + lastUpdated: '2016-10-24T19:43:17Z' + previewUrl: >- + https://d1otoma47x30pg.cloudfront.net/42e63e98c9a982ac9b8b741/197910121200.png + timeZone: DeepSpace/InfiniteImprobability + parentFolderId: 1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6 + customDomains: + - id: 589a331aa51e760df7ccb89e + url: heartofgold.galaxy + locales: + primary: + id: 653fd9af6a07fc9cfd7a5e57 + cmsLocaleId: 653ad57de882f528b32e810e + enabled: true + displayName: English - Heart of Gold Standard + redirect: false + subdirectory: /en + tag: The Ultimate Answer + secondary: + - id: 653fd9af6a07fc9cfd7a5e58 + cmsLocaleId: 653ad57de882f528b32e810g + enabled: true + displayName: Betelgeusian - Vogon Liaison + redirect: true + subdirectory: /bet + tag: Vogon + - id: 653fd9af6a07fc9cfd7a5e59 + cmsLocaleId: 653ad57de882f528b32e810h + enabled: false + displayName: Magrathean - Custom Planet Designs + redirect: true + subdirectory: /mg + tag: Magrathean + dataCollectionEnabled: true + dataCollectionType: always + - id: 42e63e98c9a982ac9b8b742 + workspaceId: 42e63fc8c9a982ac9b8b745 + createdOn: '1981-10-12T12:00:00Z' + displayName: Marvin's Personal Blog + shortName: paranoid-android + lastPublished: '2023-04-02T12:45:00Z' + lastUpdated: '2016-10-24T19:43:17Z' + previewUrl: >- + https://d1otoma47x30pg.cloudfront.net/42e63e98c9a982ac9b8b742/198110121200.png + timeZone: DeepSpace/Depression + customDomains: + - id: 589a331aa51e760df7ccb89f + url: marvin.blog + locales: + primary: + id: 653fd9af6a07fc9cfd7a5e57 + cmsLocaleId: 653ad57de882f528b32e810e + enabled: true + displayName: English - Marvin's Musings + redirect: false + subdirectory: /en + tag: English + secondary: + - id: 653fd9af6a07fc9cfd7a5e56 + cmsLocaleId: 653ad57de882f528b32e810f + enabled: true + displayName: Squornshellous - Mattress Speak + redirect: true + subdirectory: /sr + tag: Squornshellous + dataCollectionEnabled: true + dataCollectionType: always + - id: 42e63e98c9a982ac9b8b743 + workspaceId: 42e63fc8c9a982ac9b8b746 + createdOn: '1982-10-12T12:00:00Z' + displayName: Vogon Poetry Archive + shortName: vogon-poetry + lastPublished: '2023-04-02T12:50:00Z' + lastUpdated: '2016-10-24T19:43:17Z' + previewUrl: >- + https://d1otoma47x30pg.cloudfront.net/42e63e98c9a982ac9b8b743/198210121200.png + timeZone: Vogsphere/PoetryHall + customDomains: + - id: 589a331aa51e760df7ccb8a0 + url: vogonpoetry.galaxy + locales: + primary: + id: 653fd9af6a07fc9cfd7a5e55 + cmsLocaleId: 653ad57de882f528b32e810d + enabled: true + displayName: English - Vogon Verse + redirect: false + subdirectory: /en + tag: Third Worst Poetry + secondary: + - id: 653fd9af6a07fc9cfd7a5e54 + cmsLocaleId: 653ad57de882f528b32e810c + enabled: true + displayName: Galactic - Universal Language + redirect: true + subdirectory: /gl + tag: Pan-Galactic Gargle Blaster + dataCollectionEnabled: true + dataCollectionType: always + get: + path: /sites/{site_id} + method: GET + auth: true + docs: | + Get details of a site. + + Required scope | `sites:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Get Site + response: + docs: Request was successful + type: root.Site + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + id: 42e98c9a982ac9b8b742 + workspaceId: 42e63e98c9a982ac9b8b742 + createdOn: '1979-10-12T12:00:00Z' + displayName: The Hitchhiker's Guide to the Galaxy + shortName: hitchhikers-guide + lastPublished: '2023-04-02T12:42:00Z' + lastUpdated: '2023-04-02T12:42:00Z' + previewUrl: >- + https://screenshots.webflow.com/sites/6258612d1ee792848f805dcf/20231219211811_d5990556c743f33b7071300a03bf67e6.png + timeZone: Magrathea/FactoryFloor + parentFolderId: 1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6 + customDomains: + - id: 589a331aa51e760df7ccb89d + url: hitchhikersguide.galaxy + - id: 589a331aa51e760df7ccb89e + url: heartofgold.spaceship + 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 + get-custom-domain: + path: /sites/{site_id}/custom_domains + method: GET + auth: true + docs: | + Get a list of all custom domains related to site. + + Required scope | `sites:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Get Custom Domains + response: + docs: Request was successful + type: root.Domains + errors: + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + customDomains: + - id: 589a331aa51e760df7ccb89d + url: hitchhikersguide.galaxy + - id: 589a331aa51e760df7ccb89e + url: heartofgold.spaceship + publish: + path: /sites/{site_id}/publish + method: POST + auth: true + docs: > + Publishes a site to one or more more domains. + + + This endpoint has a limit of + one successful publish queue per minute. + + + Required scope | `sites:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Publish Site + request: + name: SitesPublishRequest + body: + properties: + customDomains: + type: optional> + docs: Array of Custom Domain IDs to publish + publishToWebflowSubdomain: + type: optional + docs: Choice of whether to publish to the default Webflow Subdomain + default: false + content-type: application/json + response: + docs: Request accepted + type: SitesPublishResponse + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: {} + response: + body: + customDomains: + - id: 589a331aa51e760df7ccb89d + url: test-api-domain.com + publishToWebflowSubdomain: true + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Sites +types: + SitesPublishResponse: + properties: + customDomains: + type: optional> + docs: Array of domains objects + publishToWebflowSubdomain: + type: optional + docs: Flag for publishing to webflow.io subdomain + default: false + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/sites/activityLogs.yml b/.mock/definition/sites/activityLogs.yml new file mode 100644 index 00000000..6f6b9114 --- /dev/null +++ b/.mock/definition/sites/activityLogs.yml @@ -0,0 +1,61 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/activity_logs + method: GET + auth: true + docs: >- + Retrieve Activity Logs for a specific Site. Requires Site to be on an + Enterprise plan.

Required scope | `site_activity:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Get Site Activity Logs + request: + name: ActivityLogsListRequest + query-parameters: + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + response: + docs: A list of site activity logs + type: root.SiteActivityLogResponse + errors: + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + items: + - id: 654c16c7b229e56bcf26872d + createdOn: '2023-11-08T23:16:23Z' + lastUpdated: '2023-11-08T23:16:23Z' + event: cms_collection + resourceOperation: CREATED + user: + id: 6509cd56e90eec668b009712 + displayName: John Doe + resourceId: 654c16c7b229e56bcf26870c + resourceName: foo-bar + pagination: + limit: 25 + offset: 0 + total: 1 + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/sites/scripts.yml b/.mock/definition/sites/scripts.yml new file mode 100644 index 00000000..c56c6c86 --- /dev/null +++ b/.mock/definition/sites/scripts.yml @@ -0,0 +1,227 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + get-custom-code: + path: /sites/{site_id}/custom_code + method: GET + auth: true + docs: > + Get all registered scripts that have been applied to a specific Site. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Get Custom Code + response: + docs: Request was successful + type: root.ScriptApplyList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + scripts: + - id: cms_slider + location: header + version: 1.0.0 + attributes: + my-attribute: some-value + - id: alert + location: header + version: 0.0.1 + attributes: + key: value + lastUpdated: '2022-10-26T00:28:54.191Z' + createdOn: '2022-10-26T00:28:54.191Z' + upsert-custom-code: + path: /sites/{site_id}/custom_code + method: PUT + auth: true + docs: > + Add a registered script to a Site. + + + In order to use the Custom Code APIs for Sites and Pages, Custom Code + Scripts must first be registered + + to a Site via the `registered_scripts` endpoints, and then applied to a + Site or Page using the appropriate + + `custom_code` endpoints. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Add/Update Custom Code + request: + body: root.ScriptApplyList + content-type: application/json + response: + docs: Request was successful + type: root.ScriptApplyList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + scripts: + - id: cms_slider + location: header + version: 1.0.0 + attributes: + my-attribute: some-value + - id: alert + location: header + version: 0.0.1 + response: + body: + scripts: + - id: cms_slider + location: header + version: 1.0.0 + attributes: + my-attribute: some-value + - id: alert + location: header + version: 0.0.1 + attributes: + key: value + lastUpdated: lastUpdated + createdOn: createdOn + delete-custom-code: + path: /sites/{site_id}/custom_code + method: DELETE + auth: true + docs: > + Delete the custom code block that an app created for a Site + + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Delete Custom Code + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + list-custom-code-blocks: + path: /sites/{site_id}/custom_code/blocks + method: GET + auth: true + docs: > + Get all instances of Custom Code applied to a Site or Pages. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + + Required scope | `custom_code:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Custom Code Blocks + request: + name: ScriptsListCustomCodeBlocksRequest + 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.ListCustomCodeBlocks + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + blocks: + - siteId: 6258612d1ee792848f805dcf + type: site + scripts: + - id: chartjs + location: header + version: 4.4.2 + attributes: + key: value + createdOn: '2024-04-03T16:49:15Z' + lastUpdated: '2024-04-03T16:49:15Z' + - siteId: 6390c49674a71f84b51a08d8 + pageId: 6419db964a9c43f6a3af6348 + type: page + scripts: + - id: id + location: header + version: version + createdOn: '2022-10-26T00:28:54Z' + lastUpdated: '2022-10-26T00:28:54Z' + pagination: + limit: 10 + offset: 0 + total: 1 + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/token.yml b/.mock/definition/token.yml new file mode 100644 index 00000000..17b11888 --- /dev/null +++ b/.mock/definition/token.yml @@ -0,0 +1,71 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + authorized-by: + path: /token/authorized_by + method: GET + auth: true + docs: | + Information about the Authorized User + + Required Scope | `authorized_user:read` + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Get Authorization User Info + response: + docs: Request was successful + type: root.AuthorizedUser + errors: + - root.UnauthorizedError + - root.ForbiddenError + examples: + - response: + body: + id: 545bbecb7bdd6769632504a7 + email: some@email.com + firstName: Some + lastName: One + introspect: + path: /token/introspect + method: GET + auth: true + docs: > + Information about the authorization token + + Access to this endpoint requires a bearer token from a []>Data + Client App](/data/docs/getting-started-data-clients). + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Get Authorization Info + response: + docs: Request was successful + type: root.Authorization + errors: + - root.UnauthorizedError + examples: + - response: + body: + authorization: + id: 55818d58616600637b9a5786 + createdOn: '2016-10-03T23:12:00Z' + lastUsed: '2016-10-10T21:41:12Z' + grantType: authorization_code + rateLimit: 60 + scope: assets:read,assets:write + authorizedTo: + siteIds: + - 62f3b1f7eafac55d0c64ef91 + workspaceIds: + - 52f3b1f7eafac55d0c64ef91 + userIds: + - 545bbecb7bdd6769632504a7 + application: + id: 55131cd036c09f7d07883dfc + description: My Amazing App + homepage: https://webflow.com + displayName: My Amazing App + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/users.yml b/.mock/definition/users.yml new file mode 100644 index 00000000..6c8b266f --- /dev/null +++ b/.mock/definition/users.yml @@ -0,0 +1,392 @@ +types: + UsersListRequestSort: + enum: + - value: CreatedOn + name: CreatedOnAscending + docs: Sorts users in ascending order based on their created date + - value: '-CreatedOn' + name: CreatedOnDescending + docs: Sorts users in descending order based on their created date + - value: Email + name: EmailAscending + docs: Sorts users in ascending order based on their email + - value: '-Email' + name: EmailDescending + docs: Sorts users in descending order based on their email + - value: Status + name: StatusAscending + docs: Sorts users in ascending order based on their status + - value: '-Status' + name: StatusDescending + docs: Sorts users in descending order based on their status + - value: LastLogin + name: LastLoginAscending + docs: Sorts users in ascending order based on their last login date + - value: '-LastLogin' + name: LastLoginDescending + docs: Sorts users in descending order based on their last login date + - value: UpdatedOn + name: UpdatedOnAscending + docs: Sorts users in ascending order based on their update date + - value: '-UpdatedOn' + name: UpdatedOnDescending + docs: Sorts users in descending order based on their update date + source: + openapi: ../../../referenced-specs/v2.yml + UsersUpdateRequestData: + properties: + name: + type: optional + docs: | + The name of the user + accept-privacy: + type: optional + docs: | + Boolean indicating if the user has accepted the privacy policy + accept-communications: + type: optional + docs: | + Boolean indicating if the user has accepted to receive communications + source: + openapi: ../../../referenced-specs/v2.yml + inline: true +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/users + method: GET + auth: true + docs: | + Get a list of users for a site + + Required scope | `users:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Users + request: + name: UsersListRequest + 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)' + sort: + type: optional + docs: | + Sort string to use when ordering users + + Example(`CreatedOn`, `Email`, `Status`, `LastLogin`, `UpdatedOn`). + + Can be prefixed with a `-` to reverse the sort (ex. `-CreatedOn`) + response: + docs: Request was successful + type: root.UserList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + count: 5 + limit: 5 + offset: 0 + total: 201 + users: + - id: 6287ec36a841b25637c663df + isEmailVerified: false + lastUpdated: '2022-05-20T13:46:12Z' + invitedOn: '2016-10-24T19:41:29Z' + createdOn: '2022-05-20T13:46:12Z' + lastLogin: '2016-10-24T19:41:29Z' + status: unverified + accessGroups: + - slug: vogon-construction-crew + type: admin + - id: 6287ec36a841b25637c663f0 + isEmailVerified: false + lastUpdated: '2022-05-19T05:32:04Z' + invitedOn: '2016-10-24T19:41:29Z' + createdOn: '2022-05-19T05:32:04Z' + lastLogin: '2016-10-24T19:41:29Z' + status: unverified + accessGroups: + - slug: improbability-drive-test-subjects + type: admin + - id: 6287ec36a841b25637c663d9 + isEmailVerified: true + lastUpdated: '2022-05-17T03:34:06Z' + invitedOn: '2016-10-24T19:41:29Z' + createdOn: '2022-05-17T03:34:06Z' + lastLogin: '2016-10-24T19:41:29Z' + status: verified + accessGroups: + - slug: heart-of-gold-crew + type: admin + - id: 6287ec37a841b25637c6641b + isEmailVerified: false + lastUpdated: '2022-05-15T03:46:09Z' + invitedOn: '2016-10-24T19:41:29Z' + createdOn: '2022-05-15T03:46:09Z' + lastLogin: '2016-10-24T19:41:29Z' + status: unverified + accessGroups: + - slug: hitchhikers-guide-research-team + type: admin + - id: 6287ec37a841b25637c66449 + isEmailVerified: true + lastUpdated: '2022-05-15T02:55:38Z' + invitedOn: '2016-10-24T19:41:29Z' + createdOn: '2022-05-15T02:55:38Z' + lastLogin: '2016-10-24T19:41:29Z' + status: verified + accessGroups: + - slug: milliways-reservationists + type: admin + get: + path: /sites/{site_id}/users/{user_id} + method: GET + auth: true + docs: | + Get a User by ID + + Required scope | `users:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + user_id: + type: string + docs: Unique identifier for a User + display-name: Get User + response: + docs: Request was successful + type: root.User + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + user_id: 580e63e98c9a982ac9b8b741 + response: + body: + id: 6287ec36a841b25637c663df + isEmailVerified: true + lastUpdated: '2022-05-20T13:46:12Z' + invitedOn: '2022-05-20T13:46:12Z' + createdOn: '2022-05-20T13:46:12Z' + lastLogin: '2022-05-20T13:46:12Z' + status: verified + accessGroups: + - slug: webflowers + type: admin + data: + data: + name: name + email: email + accept-privacy: true + accept-communications: true + additionalProperties: additionalProperties + delete: + path: /sites/{site_id}/users/{user_id} + method: DELETE + auth: true + docs: | + Delete a User by ID + + Required scope | `users:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + user_id: + type: string + docs: Unique identifier for a User + display-name: Delete User + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + user_id: 580e63e98c9a982ac9b8b741 + update: + path: /sites/{site_id}/users/{user_id} + method: PATCH + auth: true + docs: | + Update a User by ID + + Required scope | `users:write` + + The email and password + fields cannot be updated using this endpoint + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + user_id: + type: string + docs: Unique identifier for a User + display-name: Update User + request: + name: UsersUpdateRequest + body: + properties: + data: optional + accessGroups: + type: optional> + docs: > + An array of access group slugs. Access groups are assigned to + the user as type `admin` and the user remains in the group until + removed. + content-type: application/json + response: + docs: Request was successful + type: root.User + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + user_id: 580e63e98c9a982ac9b8b741 + request: + data: + name: Some One + accept-privacy: false + accept-communications: false + accessGroups: + - webflowers + - platinum + - free-tier + response: + body: + id: 6287ec36a841b25637c663df + isEmailVerified: true + lastUpdated: '2022-05-20T13:46:12Z' + invitedOn: '2022-05-20T13:46:12Z' + createdOn: '2022-05-20T13:46:12Z' + lastLogin: '2022-05-20T13:46:12Z' + status: verified + accessGroups: + - slug: webflowers + type: admin + data: + data: + name: name + email: email + accept-privacy: true + accept-communications: true + additionalProperties: additionalProperties + invite: + path: /sites/{site_id}/users/invite + method: POST + auth: true + docs: > + Create and invite a user with an email address. + + + The user will be sent and invite via email, which they will need to + accept in order to join paid any paid access group. + + + Required scope | `users:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Create and Invite a User + request: + name: UsersInviteRequest + body: + properties: + email: + type: string + docs: Email address of user to send invite to + validation: + format: email + accessGroups: + type: optional> + docs: > + An array of access group slugs. Access groups are assigned to + the user as type `admin` and the user remains in the group until + removed. + content-type: application/json + response: + docs: Request was successful + type: root.User + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.ConflictError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + email: some.one@home.com + accessGroups: + - webflowers + response: + body: + id: 6287ec36a841b25637c663df + isEmailVerified: true + lastUpdated: '2022-05-20T13:46:12Z' + invitedOn: '2022-05-20T13:46:12Z' + createdOn: '2022-05-20T13:46:12Z' + lastLogin: '2022-05-20T13:46:12Z' + status: verified + accessGroups: + - slug: webflowers + type: admin + data: + data: + name: name + email: email + accept-privacy: true + accept-communications: true + additionalProperties: additionalProperties + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/webhooks.yml b/.mock/definition/webhooks.yml new file mode 100644 index 00000000..e72b6cce --- /dev/null +++ b/.mock/definition/webhooks.yml @@ -0,0 +1,185 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/webhooks + method: GET + auth: true + docs: | + List all App-created Webhooks registered for a given site + + Required scope | `sites:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Webhooks + response: + docs: Request was successful + type: root.WebhookList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + pagination: + limit: 100 + offset: 0 + total: 100 + webhooks: + - id: 57ca0a9e418c504a6e1acbb6 + triggerType: form_submission + url: https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f + workspaceId: 4f4e46fd476ea8c507000001 + siteId: 562ac0395358780a1f5e6fbd + filter: + name: Email Form + lastTriggered: '2023-02-08T23:59:28Z' + createdOn: '2016-09-02T23:26:22Z' + - id: 578d85cce0c47cd2865f4cf2 + triggerType: form_submission + url: https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f + workspaceId: 4f4e46fd476ea8c507000001 + siteId: 562ac0395358780a1f5e6fbd + filter: + name: Email Form + lastTriggered: '2023-02-08T23:59:28Z' + createdOn: '2016-07-19T01:43:40Z' + - id: 578d85cce0c47cd2865f4cf3 + triggerType: form_submission + url: https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f + workspaceId: 4f4e46fd476ea8c507000001 + siteId: 562ac0395358780a1f5e6fbd + filter: + name: Email Form + lastTriggered: '2023-02-08T23:59:28Z' + createdOn: '2016-07-19T01:43:40Z' + create: + path: /sites/{site_id}/webhooks + method: POST + auth: true + docs: > + Create a new Webhook. + + + Limit of 75 registrations per `triggerType`, per site. + +
Access to this + endpoint requires a bearer token from a Data + Client App.
+ + Required scope | `sites:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Create Webhook + request: + body: root.Webhook + content-type: application/json + response: + docs: Request was successful + type: root.Webhook + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + id: 582266e0cd48de0f0e3c6d8b + triggerType: form_submission + url: https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f + workspaceId: 4f4e46fd476ea8c507000001 + siteId: 562ac0395358780a1f5e6fbd + lastTriggered: '2023-02-08T23:59:28Z' + createdOn: '2022-11-08T23:59:28Z' + response: + body: + id: 582266e0cd48de0f0e3c6d8b + triggerType: form_submission + url: https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f + workspaceId: 4f4e46fd476ea8c507000001 + siteId: 562ac0395358780a1f5e6fbd + lastTriggered: '2023-02-08T23:59:28Z' + createdOn: '2022-11-08T23:59:28Z' + get: + path: /webhooks/{webhook_id} + method: GET + auth: true + docs: | + Get a specific Webhook instance + + Required scope: `sites:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + webhook_id: + type: string + docs: Unique identifier for a Webhook + display-name: Get Webhook + response: + docs: Request was successful + type: root.Webhook + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + webhook_id: 580e64008c9a982ac9b8b754 + response: + body: + id: 582266e0cd48de0f0e3c6d8b + triggerType: form_submission + url: https://webhook.site/7f7f7f7f-7f7f-7f7f-7f7f-7f7f7f7f7f7f + workspaceId: 4f4e46fd476ea8c507000001 + siteId: 562ac0395358780a1f5e6fbd + lastTriggered: '2023-02-08T23:59:28Z' + createdOn: '2022-11-08T23:59:28Z' + delete: + path: /webhooks/{webhook_id} + method: DELETE + auth: true + docs: | + Remove a Webhook + + Required scope: `sites:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + webhook_id: + type: string + docs: Unique identifier for a Webhook + display-name: Remove Webhook + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + webhook_id: 580e64008c9a982ac9b8b754 + source: + openapi: ../../../referenced-specs/v2.yml + display-name: Webhooks diff --git a/.mock/fern.config.json b/.mock/fern.config.json new file mode 100644 index 00000000..6ff3ad70 --- /dev/null +++ b/.mock/fern.config.json @@ -0,0 +1,4 @@ +{ + "organization" : "webflow", + "version" : "0.45.2" +} \ No newline at end of file diff --git a/package.json b/package.json index 49bb2c64..4c27641e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webflow-api", - "version": "2.4.2", + "version": "2.5.0", "private": false, "repository": "https://github.com/webflow/js-webflow-api", "main": "./index.js", @@ -25,7 +25,6 @@ "@types/qs": "6.9.8", "@types/node-fetch": "2.6.9", "@types/readable-stream": "^4.0.15", - "fetch-mock-jest": "^1.5.1", "webpack": "^5.94.0", "ts-loader": "^9.3.1", "jest": "29.7.0", diff --git a/reference.md b/reference.md index 8104e058..ed0a88f1 100644 --- a/reference.md +++ b/reference.md @@ -14,7 +14,9 @@
-Information about the Authorized User

Required Scope | `authorized_user:read` +Information about the Authorized User + +Required Scope | `authorized_user:read`
@@ -69,7 +71,8 @@ await client.token.authorizedBy();
-Information about the authorization token
Access to this endpoint requires a bearer token from a Data Client App.
+Information about the authorization token +Access to this endpoint requires a bearer token from a []>Data Client App](/data/docs/getting-started-data-clients).
@@ -126,7 +129,9 @@ await client.token.introspect();
-List of all sites the provided access token is able to access.

Required scope | `sites:read` +List of all sites the provided access token is able to access. + +Required scope | `sites:read`
@@ -181,7 +186,9 @@ await client.sites.list();
-Get a site by site id

Required scope | `sites:read` +Get details of a site. + +Required scope | `sites:read`
@@ -244,7 +251,9 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
-Get a list of all custom domains related to site.

Required scope | `sites:read` +Get a list of all custom domains related to site. + +Required scope | `sites:read`
@@ -307,7 +316,11 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
-Publish a site to one more more domains.

Required scope | `sites:write`

📘

Endpoint-specific rate limit

This endpoint has a limit of one successful publish queue per minute.

+Publishes a site to one or more more domains. + +This endpoint has a limit of one successful publish queue per minute. + +Required scope | `sites:write`
@@ -380,7 +393,9 @@ await client.sites.publish("580e63e98c9a982ac9b8b741");
-List of all Collections within a Site.

Required scope | `cms:read` +List of all Collections within a Site. + +Required scope | `cms:read`
@@ -443,7 +458,9 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
-Create a Collection for a site.

Required scope | `cms:write` +Create a Collection for a site. + +Required scope | `cms:write`
@@ -518,7 +535,9 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
-Get the full details of a collection from its ID.

Required scope | `cms:read` +Get the full details of a collection from its ID. + +Required scope | `cms:read`
@@ -569,7 +588,7 @@ await client.collections.get("580e63fc8c9a982ac9b8b745"); -
client.collections.deleteCollection(collectionId) -> void +
client.collections.delete(collectionId) -> void
@@ -581,70 +600,9 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
-Delete a collection using its ID.

Required scope | `cms:write` - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.collections.deleteCollection("580e63fc8c9a982ac9b8b745"); -``` - -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**collectionId:** `string` — Unique identifier for a Collection - -
-
- -
-
- -**requestOptions:** `Collections.RequestOptions` - -
-
-
-
- - - -
- -
client.collections.delete(collectionId, fieldId) -> void -
-
- -#### 📝 Description - -
-
- -
-
+Delete a collection using its ID. -Delete a custom field in a collection. This endpoint does not currently support bulk deletion.

Required scope | `cms:write` +Required scope | `cms:write`
@@ -660,7 +618,7 @@ Delete a custom field in a collection. This endpoint does not currently support
```typescript -await client.collections.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745"); +await client.collections.delete("580e63fc8c9a982ac9b8b745"); ```
@@ -684,14 +642,6 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b
-**fieldId:** `string` — Unique identifier for a Field in a collection - -
-
- -
-
- **requestOptions:** `Collections.RequestOptions`
@@ -717,7 +667,9 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b
-List of all pages for a site

Required scope | `pages:read` +List of all pages for a site. + +Required scope | `pages:read`
@@ -734,7 +686,7 @@ List of all pages for a site

Required scope | `pages:read` ```typescript await client.pages.list("580e63e98c9a982ac9b8b741", { - locale: "65427cf400e02b306eaa04a0", + localeId: "65427cf400e02b306eaa04a0", }); ``` @@ -790,7 +742,9 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
-Get metadata information for a single page

Required scope | `pages:read` +Get metadata information for a single page. + +Required scope | `pages:read`
@@ -807,7 +761,7 @@ Get metadata information for a single page

Required scope | `pages:re ```typescript await client.pages.getMetadata("63c720f9347c2139b248e552", { - locale: "65427cf400e02b306eaa04a0", + localeId: "65427cf400e02b306eaa04a0", }); ``` @@ -863,7 +817,9 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-Update Page-level metadata, including SEO and Open Graph fields.

Required scope | `pages:write` +Update Page-level metadata, including SEO and Open Graph fields. + +Required scope | `pages:write`
@@ -880,19 +836,18 @@ Update Page-level metadata, including SEO and Open Graph fields.

Requ ```typescript await client.pages.updatePageSettings("63c720f9347c2139b248e552", { - locale: "65427cf400e02b306eaa04a0", + localeId: "65427cf400e02b306eaa04a0", body: { id: "6596da6045e56dee495bcbba", 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, draft: false, canBranch: true, + isBranch: false, seo: { title: "The Ultimate Hitchhiker's Guide to the Galaxy", description: @@ -962,7 +917,11 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
-Get static content from a static page.
If you do not provide a Locale ID in your request, the response will return any content that can be localized from the Primary locale

Required scope | `pages:read` +Get static content from a static page. + +If you do not provide a Locale ID in your request, the response will return any content that can be localized from the Primary locale. + +Required scope | `pages:read`
@@ -979,7 +938,7 @@ Get static content from a static page.
If you do not provide a Locale ID i ```typescript await client.pages.getContent("63c720f9347c2139b248e552", { - locale: "65427cf400e02b306eaa04a0", + localeId: "65427cf400e02b306eaa04a0", }); ``` @@ -1056,19 +1015,19 @@ Required scope | `pages:write` ```typescript await client.pages.updateStaticContent("63c720f9347c2139b248e552", { - locale: "locale", + localeId: "65427cf400e02b306eaa04a0", nodes: [ { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - text: "

The Hitchhiker's Guide to the Galaxy

", + text: "

The Hitchhiker\u2019s Guide to the Galaxy

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

Don't Panic!

Always know where your towel is.

", + text: "

Don\u2019t Panic!

Always know where your towel is.

", }, { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", - text: "Marvin, the Paranoid Android", + text: 'Marvin, the Paranoid Android', }, ], }); @@ -1128,7 +1087,16 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
-List of scripts registered to a Site.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints. Additionally, Scripts can be remotely hosted, or registered as inline snippets.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:read` +List of scripts registered to a Site. + +In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered +to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate +`custom_code` endpoints. +Additionally, Scripts can be remotely hosted, or registered as inline snippets. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:read`
@@ -1191,7 +1159,16 @@ await client.scripts.list("580e63e98c9a982ac9b8b741");
-Add a script to a Site's Custom Code registry.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints. Additionally, Scripts can be remotely hosted, or registered as inline snippets.
Access to this endpoint requires a bearer token from a Data Client App.


Required scope | `custom_code:write` +Add a script to a Site's Custom Code registry. + +In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered +to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate +`custom_code` endpoints. +Additionally, Scripts can be remotely hosted, or registered as inline snippets. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:write`
@@ -1267,7 +1244,15 @@ await client.scripts.registerHosted("580e63e98c9a982ac9b8b741", {
-Add a script to a Site's Custom Code registry. Inline scripts can be between 1 and 2000 characters.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.

Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` +Add a script to a Site's Custom Code registry. Inline scripts can be between 1 and 2000 characters. + +In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered +to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate +`custom_code` endpoints. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:write`
@@ -1344,7 +1329,9 @@ await client.scripts.registerInline("580e63e98c9a982ac9b8b741", {
-List assets for a given site

Required scope | `assets:read` +List assets for a given site + +Required scope | `assets:read`
@@ -1407,7 +1394,13 @@ await client.assets.list("580e63e98c9a982ac9b8b741");
-Create a new asset entry.

This endpoint generates a response with the following information: `uploadUrl` and `uploadDetails`. You can use these two properties to [upload the file to Amazon s3 by making a POST](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) request to the `uploadUrl` with the `uploadDetails` object as your header information in the request.

Required scope | `assets:write` +Create a new asset entry. + +This endpoint generates a response with the following information: `uploadUrl` and `uploadDetails`. +You can use these two properties to [upload the file to Amazon s3 by making a POST](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) +request to the `uploadUrl` with the `uploadDetails` object as your header information in the request. + +Required scope | `assets:write`
@@ -1481,7 +1474,9 @@ await client.assets.create("580e63e98c9a982ac9b8b741", {
-Get an Asset

Required scope | `assets:read` +Get an Asset + +Required scope | `assets:read`
@@ -1546,6 +1541,8 @@ await client.assets.get("580e63fc8c9a982ac9b8b745"); Delete an Asset +Required Scope: `assets: write` +
@@ -1607,7 +1604,9 @@ await client.assets.delete("580e63fc8c9a982ac9b8b745");
-Update an Asset

Required scope | `assets:write` +Update an Asset + +Required scope | `assets:write`
@@ -1623,9 +1622,7 @@ Update an Asset

Required scope | `assets:write`
```typescript -await client.assets.update("580e63fc8c9a982ac9b8b745", { - displayName: "bulldoze.png", -}); +await client.assets.update("580e63fc8c9a982ac9b8b745"); ```
@@ -1680,7 +1677,9 @@ await client.assets.update("580e63fc8c9a982ac9b8b745", {
-List Asset Folders within a given site

Required scope | `assets:read` +List Asset Folders within a given site + +Required scope | `assets:read`
@@ -1743,7 +1742,9 @@ await client.assets.listFolders("580e63e98c9a982ac9b8b741");
-Create an Asset Folder within a given site

Required scope | `assets:write` +Create an Asset Folder within a given site + +Required scope | `assets:write`
@@ -1816,7 +1817,9 @@ await client.assets.createFolder("580e63e98c9a982ac9b8b741", {
-Get details about a specific Asset Folder

Required scope | `assets:read` +Get details about a specific Asset Folder + +Required scope | `assets:read`
@@ -1881,7 +1884,9 @@ await client.assets.getFolder("6390c49774a71f0e3c1a08ee");
-List all App-created Webhooks registered for a given site

Required scope | `sites:read` +List all App-created Webhooks registered for a given site + +Required scope | `sites:read`
@@ -1944,8 +1949,12 @@ await client.webhooks.list("580e63e98c9a982ac9b8b741");
-Create a new Webhook, to be notified when Webflow resources change. Limit of 75 registrations per `triggerType`, per site.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `sites:write` +Create a new Webhook. +Limit of 75 registrations per `triggerType`, per site. + +
Access to this endpoint requires a bearer token from a Data Client App.
+Required scope | `sites:write`
@@ -2025,6 +2034,8 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", { Get a specific Webhook instance +Required scope: `sites:read` + @@ -2088,6 +2099,8 @@ await client.webhooks.get("580e64008c9a982ac9b8b754"); Remove a Webhook +Required scope: `sites:read` + @@ -2151,7 +2164,9 @@ await client.webhooks.delete("580e64008c9a982ac9b8b754");
-List forms for a given site

Required scope | `forms:read` +List forms for a given site. + +Required scope | `forms:read`
@@ -2222,7 +2237,9 @@ await client.forms.list("580e63e98c9a982ac9b8b741");
-Get information about a given form

Required scope | `forms:read` +Get information about a given form. + +Required scope | `forms:read`
@@ -2285,7 +2302,9 @@ await client.forms.get("580e63e98c9a982ac9b8b741");
-List form submissions for a given form

Required scope | `forms:read` +List form submissions for a given form + +Required scope | `forms:read`
@@ -2356,7 +2375,9 @@ await client.forms.listSubmissions("580e63e98c9a982ac9b8b741");
-Get information about a given form submission

Required scope | `forms:read` +Get information about a given form submissio. + +Required scope | `forms:read`
@@ -2419,7 +2440,9 @@ await client.forms.getSubmission("580e63e98c9a982ac9b8b741");
-Update hidden fields on a form submission

Required scope | `forms:write` +Update hidden fields on a form submission + +Required scope | `forms:write`
@@ -2492,7 +2515,9 @@ await client.forms.updateSubmission("580e63e98c9a982ac9b8b741");
-Get a list of users for a site

Required scope | `users:read` +Get a list of users for a site + +Required scope | `users:read`
@@ -2563,7 +2588,9 @@ await client.users.list("580e63e98c9a982ac9b8b741");
-Get a User by ID

Required scope | `users:read` +Get a User by ID + +Required scope | `users:read`
@@ -2634,7 +2661,9 @@ await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741");
-Delete a User by ID

Required scope | `users:write` +Delete a User by ID + +Required scope | `users:write`
@@ -2705,9 +2734,13 @@ await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
-Update a User by ID

Required scope | `users:write` +Update a User by ID + +Required scope | `users:write` + +The email and password +fields cannot be updated using this endpoint -
@@ -2792,7 +2825,11 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
-Create and invite a user with an email address. The user will be sent and invite via email, which they will need to accept in order to join paid Access Groups.

Required scope | `users:write` +Create and invite a user with an email address. + +The user will be sent and invite via email, which they will need to accept in order to join paid any paid access group. + +Required scope | `users:write`
@@ -2868,7 +2905,9 @@ await client.users.invite("580e63e98c9a982ac9b8b741", {
-Get a list of access groups for a site

Required scope | `users:read` +Get a list of access groups for a site + +Required scope | `users:read`
@@ -2941,7 +2980,10 @@ await client.accessGroups.list("580e63e98c9a982ac9b8b741");
-Retrieve all products for a site. Use `limit` and `offset` to page through all products with subsequent requests. All SKUs for each product will also be fetched and returned. The `limit`, `offset` and `total` values represent Products only and do not include any SKUs. +Retrieve all products for a site. + +Use `limit` and `offset` to page through all products with subsequent requests. All SKUs for each product +will also be fetched and returned. The `limit`, `offset` and `total` values represent Products only and do not include any SKUs. Required scope | `ecommerce:read` @@ -3014,13 +3056,19 @@ await client.products.list("580e63e98c9a982ac9b8b741");
-Creating a new Product involves creating both a Product and a SKU, since a Product Item has to have, at minimum, a single SKU. +Create a new product and SKU. + +When you create a product, you will always create a SKU, since a Product Item must have, at minimum, a single SKU. -In order to create a Product with multiple SKUs - for example a T-shirt in sizes small, medium and large - you'll need to create `sku-properties`. In our T-shirt example, a single `sku-property` would be Color. Within that property, we'll need to list out the various colors a T-shirt could be as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. +To create a Product with multiple SKUs - for example a T-shirt in sizes small, medium and large: -Once, you've created a Product and its `sku-properties` with `enum` values, you can create your default SKU, which will automatically be a combination of the first `sku-properties` you've created. In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. After you've created your product, you can create additional SKUs using the Create SKU endpoint +- Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). +- A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. +- Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created. +- In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. +- After you've created your product, you can create additional SKUs using the [Create SKU endpoint.](/data/reference/ecommerce/products-sk-us/create-sku) -Upon creation, the default product type will be `Advanced`. The product type is used to determine which Product and SKU fields are shown to users in the `Designer` and the `Editor`. Setting it to `Advanced` ensures that all Product and SKU fields will be shown. +Upon creation, the default product type will be `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` @@ -3093,7 +3141,8 @@ await client.products.create("580e63e98c9a982ac9b8b741");
-Retrieve a single product by its id. All of its SKUs will also be retrieved. +Retrieve a single product by its ID. All of its SKUs will also be +retrieved. Required scope | `ecommerce:read` @@ -3166,7 +3215,9 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
-Updating an existing Product will set the product type to `Advanced`. The product type is used to determine which Product and SKU fields are shown to users in the `Designer` and the `Editor`. Setting it to `Advanced` ensures that all Product and SKU fields will be shown. The product type can be edited in the `Designer` or the `Editor`. +Update an existing Product. + +Updating an existing Product will set the product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` @@ -3247,9 +3298,9 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
-Create additional SKUs to cover every variant of your Product. The Default SKU already counts as one of the variants. +Create additional SKUs to manage every [option and variant of your Product.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants) -Creating additional SKUs will set the product type to `Advanced` for the product associated with the SKUs. The product type is used to determine which Product and SKU fields are shown to users in the `Designer` and the `Editor`. Setting it to `Advanced` ensures that all Product and SKU fields will be shown. The product type can be edited in the `Designer` or the `Editor`. +Creating SKUs through the API will set the product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` @@ -3332,7 +3383,9 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-Updating an existing SKU will set the product type to `Advanced` for the product associated with the SKU. The product type is used to determine which Product and SKU fields are shown to users in the `Designer` and the `Editor`. Setting it to `Advanced` ensures that all Product and SKU fields will be shown. The product type can be edited in the `Designer` or the `Editor`. +Update a specified SKU. + +Updating an existing SKU will set the Product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` @@ -3498,7 +3551,8 @@ await client.orders.list("580e63e98c9a982ac9b8b741");
-Retrieve a single product by its id. All of its SKUs will also be retrieved. +Retrieve a single product by its ID. All of its SKUs will also be +retrieved. Required scope | `ecommerce:read` @@ -3571,7 +3625,9 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
-This API lets you update the fields, `comment`, `shippingProvider`, and/or `shippingTracking` for a given order. All three fields can be updated simultaneously or independently. +This API lets you update the fields, `comment`, `shippingProvider`, +and/or `shippingTracking` for a given order. All three fields can be +updated simultaneously or independently. Required scope | `ecommerce:write` @@ -3963,7 +4019,12 @@ await client.inventory.list("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b75
-Updates the current inventory levels for a particular SKU item. Updates may be given in one or two methods, absolutely or incrementally. Absolute updates are done by setting `quantity` directly. Incremental updates are by specifying the inventory delta in `updateQuantity` which is then added to the `quantity` stored on the server. +Updates the current inventory levels for a particular SKU item. + +Updates may be given in one or two methods, absolutely or incrementally. + +- Absolute updates are done by setting `quantity` directly. +- Incremental updates are by specifying the inventory delta in `updateQuantity` which is then added to the `quantity` stored on the server. Required scope | `ecommerce:write` @@ -4115,7 +4176,16 @@ await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741");
-Create a custom field in a collection.

Slugs must be all lowercase letters without spaces. If you pass a string with uppercase letters and/or spaces to the "Slug" property, Webflow will convert the slug to lowercase and replace spaces with "-."

Only some field types can be created through the API. This endpoint does not currently support bulk creation.

Required scope | `cms:write` +Create a custom field in a collection. + +Slugs must be all lowercase letters without spaces. +If you pass a string with uppercase letters and/or spaces to the "Slug" property, Webflow will +convert the slug to lowercase and replace spaces with "-." + +Only some field types can be created through the API. +This endpoint does not currently support bulk creation. + +Required scope | `cms:write`
@@ -4179,7 +4249,7 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", {
-
client.collections.fields.update(collectionId, fieldId, { ...params }) -> Webflow.Field +
client.collections.fields.delete(collectionId, fieldId) -> void
@@ -4191,7 +4261,9 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", {
-Update a custom field in a collection.

Required scope | `cms:write` +Delete a custom field in a collection. This endpoint does not currently support bulk deletion. + +Required scope | `cms:write`
@@ -4207,11 +4279,7 @@ Update a custom field in a collection.

Required scope | `cms:write`
```typescript -await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745", { - isRequired: false, - displayName: "Post Body", - helpText: "Add the body of your post here", -}); +await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745"); ```
@@ -4243,14 +4311,6 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-**request:** `Webflow.collections.FieldUpdate` - -
-
- -
-
- **requestOptions:** `Fields.RequestOptions`
@@ -4262,9 +4322,7 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-## Collections Items - -
client.collections.items.listItems(collectionId, { ...params }) -> Webflow.CollectionItemList +
client.collections.fields.update(collectionId, fieldId, { ...params }) -> Webflow.Field
@@ -4276,7 +4334,9 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-List of all Items within a Collection.

Required scope | `CMS:read` +Update a custom field in a collection. + +Required scope | `cms:write`
@@ -4292,7 +4352,11 @@ List of all Items within a Collection.

Required scope | `CMS:read`
```typescript -await client.collections.items.listItems("580e63fc8c9a982ac9b8b745"); +await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745", { + isRequired: false, + displayName: "Post Body", + helpText: "Add the body of your post here", +}); ```
@@ -4316,7 +4380,7 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745");
-**request:** `Webflow.collections.ItemsListItemsRequest` +**fieldId:** `string` — Unique identifier for a Field in a collection
@@ -4324,7 +4388,15 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745");
-**requestOptions:** `Items.RequestOptions` +**request:** `Webflow.collections.FieldUpdate` + +
+
+ +
+
+ +**requestOptions:** `Fields.RequestOptions`
@@ -4335,7 +4407,9 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745");
-
client.collections.items.createItem(collectionId, { ...params }) -> Webflow.CollectionItem +## Collections Items + +
client.collections.items.listItems(collectionId, { ...params }) -> Webflow.CollectionItemList
@@ -4347,7 +4421,10 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745");
- Create Item in a Collection.

To create items across multiple locales, please use the bulk item endpoint.

Required scope | CMS:write +List of all Items within a Collection. + +Required scope | `CMS:read` +
@@ -4362,19 +4439,7 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745");
```typescript -await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Pan Galactic Gargle Blaster Recipe", - slug: "pan-galactic-gargle-blaster", - }, -}); +await client.collections.items.listItems("580e63fc8c9a982ac9b8b745"); ```
@@ -4398,7 +4463,7 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
-**request:** `Webflow.CollectionItem` +**request:** `Webflow.collections.ItemsListItemsRequest`
@@ -4417,7 +4482,7 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
-
client.collections.items.listItemsLive(collectionId, { ...params }) -> Webflow.CollectionItemList +
client.collections.items.createItem(collectionId, { ...params }) -> Webflow.CollectionItem
@@ -4429,7 +4494,11 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
-List of all live Items within a Collection.

Required scope | `CMS:read` +Create Item(s) in a Collection. + +To create items across multiple locales, please use [this endpoint.](/data/v2.0.0/reference/cms/collection-items/bulk-items/create-items) + +Required scope | `CMS:write`
@@ -4445,7 +4514,15 @@ List of all live Items within a Collection.

Required scope | `CMS:rea
```typescript -await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745"); +await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + name: "Pan Galactic Gargle Blaster Recipe", + slug: "pan-galactic-gargle-blaster", + }, +}); ```
@@ -4469,7 +4546,7 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745");
-**request:** `Webflow.collections.ItemsListItemsLiveRequest` +**request:** `Webflow.ItemsCreateItemRequest`
@@ -4488,7 +4565,7 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745");
-
client.collections.items.createItemLive(collectionId, { ...params }) -> Webflow.CollectionItem +
client.collections.items.deleteItems(collectionId, { ...params }) -> void
@@ -4500,7 +4577,11 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745");
-Create live Item in a Collection. This Item will be published to the live site.

To create items across multiple locales, please use this endpoint.

Required scope | `CMS:write` +Delete Items from a Collection. + +**Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be deleted only in the primary locale. + +Required scope | `CMS:write`
@@ -4516,19 +4597,7 @@ Create live Item in a Collection. This Item will be published to the live site.
```typescript -await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Pan Galactic Gargle Blaster Recipe", - slug: "pan-galactic-gargle-blaster", - }, -}); +await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745"); ```
@@ -4552,7 +4621,7 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
-**request:** `Webflow.CollectionItem` +**request:** `Webflow.collections.ItemsDeleteItemsRequest`
@@ -4571,7 +4640,7 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
-
client.collections.items.createItemForMultipleLocales(collectionId, { ...params }) -> Webflow.BulkCollectionItem +
client.collections.items.updateItems(collectionId, { ...params }) -> Webflow.CollectionItem
@@ -4583,7 +4652,11 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
-Create single Item in a Collection with multiple corresponding locales.

Required scope | `CMS:write` +Update a single item or multiple items (up to 100) in a Collection. + +**Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be updated only in the primary locale. + +Required scope | `CMS:write`
@@ -4599,8 +4672,41 @@ Create single Item in a Collection with multiple corresponding locales.
```typescript -await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", { - id: "580e64008c9a982ac9b8b754", +await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], }); ``` @@ -4625,7 +4731,7 @@ await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b
-**request:** `Webflow.BulkCollectionItem` +**request:** `Webflow.collections.ItemsUpdateItemsRequest`
@@ -4644,7 +4750,7 @@ await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b
-
client.collections.items.getItem(collectionId, itemId, { ...params }) -> Webflow.CollectionItem +
client.collections.items.listItemsLive(collectionId, { ...params }) -> Webflow.CollectionItemList
@@ -4656,7 +4762,9 @@ await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b
-Get details of a selected Collection Item.

Required scope | `CMS:read` +List of all live Items within a Collection. + +Required scope | `CMS:read`
@@ -4672,7 +4780,7 @@ Get details of a selected Collection Item.

Required scope | `CMS:read
```typescript -await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754"); +await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745"); ```
@@ -4696,15 +4804,7 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-**itemId:** `string` — Unique identifier for an Item - -
-
- -
-
- -**request:** `Webflow.collections.ItemsGetItemRequest` +**request:** `Webflow.collections.ItemsListItemsLiveRequest`
@@ -4723,7 +4823,7 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-
client.collections.items.deleteItem(collectionId, itemId, { ...params }) -> void +
client.collections.items.createItemLive(collectionId, { ...params }) -> Webflow.CollectionItem
@@ -4735,7 +4835,11 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-Delete an Item from a Collection. This endpoint does not currently support bulk deletion.

Required scope | `CMS:write` +Create live Item(s) in a Collection. The Item(s) will be published to the live site. + +To create items across multiple locales, [please use this endpoint.](/v2.0.0/data/reference/cms/collection-items/bulk-items/create-items) + +Required scope | `CMS:write`
@@ -4751,8 +4855,441 @@ Delete an Item from a Collection. This endpoint does not currently support bulk
```typescript -await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754"); -``` +await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + id: "580e64008c9a982ac9b8b754", + isArchived: false, + isDraft: false, + fieldData: { + name: "Pan Galactic Gargle Blaster Recipe", + slug: "pan-galactic-gargle-blaster", + }, +}); +``` + +
+
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `string` — Unique identifier for a Collection + +
+
+ +
+
+ +**request:** `Webflow.ItemsCreateItemLiveRequest` + +
+
+ +
+
+ +**requestOptions:** `Items.RequestOptions` + +
+
+
+
+ + + +
+ +
client.collections.items.deleteItemsLive(collectionId, { ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove an item or multiple items (up to 100 items) from the live site. Deleting published items will unpublish the items from the live site and set them to draft. + +**Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be unpublished only in the primary locale. + +Required scope | `CMS:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `string` — Unique identifier for a Collection + +
+
+ +
+
+ +**request:** `Webflow.collections.ItemsDeleteItemsLiveRequest` + +
+
+ +
+
+ +**requestOptions:** `Items.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.collections.items.updateItemsLive(collectionId, { ...params }) -> Webflow.CollectionItemListNoPagination +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a single live item or multiple live items (up to 100) in a Collection + +**Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be updated only in the primary locale. + +Required scope | `CMS:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", + }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", + }, + }, + ], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `string` — Unique identifier for a Collection + +
+
+ +
+
+ +**request:** `Webflow.collections.ItemsUpdateItemsLiveRequest` + +
+
+ +
+
+ +**requestOptions:** `Items.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.collections.items.createItems(collectionId, { ...params }) -> Webflow.BulkCollectionItem +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create an item or multiple items in a CMS Collection across multiple corresponding locales. + +**Notes:** + +- This endpoint can create up to 100 items in a request. +- If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale. + +Required scope | `CMS:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { + name: "Don\u2019t Panic", + slug: "dont-panic", + }, +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `string` — Unique identifier for a Collection + +
+
+ +
+
+ +**request:** `Webflow.collections.CreateBulkCollectionItemRequestBody` + +
+
+ +
+
+ +**requestOptions:** `Items.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.collections.items.getItem(collectionId, itemId, { ...params }) -> Webflow.CollectionItem +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details of a selected Collection Item. + +Required scope | `CMS:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `string` — Unique identifier for a Collection + +
+
+ +
+
+ +**itemId:** `string` — Unique identifier for an Item + +
+
+ +
+
+ +**request:** `Webflow.collections.ItemsGetItemRequest` + +
+
+ +
+
+ +**requestOptions:** `Items.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.collections.items.deleteItem(collectionId, itemId, { ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete an Item from a Collection. This endpoint does not currently support bulk deletion. + +Required scope | `CMS:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754"); +```
@@ -4814,7 +5351,9 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
-Update a selected Item in a Collection.

Required scope | `CMS:write` +Update a selected Item in a Collection. + +Required scope | `CMS:write`
@@ -4905,7 +5444,9 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
-Get details of a selected Collection live Item.

Required scope | `CMS:read` +Get details of a selected Collection live Item. + +Required scope | `CMS:read`
@@ -4984,7 +5525,11 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
-Remove a live item from the site. Removing a published item will unpublish the item from the live site and set it to draft. This endpoint does not currently support bulk deletion.

Required scope | `CMS:write` +Remove a live item from the site. Removing a published item will unpublish the item from the live site and set it to draft. + +This endpoint does not currently support bulk deletion. + +Required scope | `CMS:write`
@@ -5063,7 +5608,9 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
-Update a selected live Item in a Collection. The updates for this Item will be published to the live site.

Required scope | `CMS:write` +Update a selected live Item in a Collection. The updates for this Item will be published to the live site. + +Required scope | `CMS:write`
@@ -5154,7 +5701,9 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
-Publish an item or multiple items.

Required scope | `cms:write` +Publish an item or multiple items. + +Required scope | `cms:write`
@@ -5229,7 +5778,15 @@ await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", {
-Get all registered scripts that have been applied to a specific Page.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:read` +Get all registered scripts that have been applied to a specific Page. + +In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered +to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate +`custom_code` endpoints. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:read`
@@ -5292,7 +5849,15 @@ await client.pages.scripts.getCustomCode("63c720f9347c2139b248e552");
-Add a registered script to a Page.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` +Add a registered script to a Page. + +In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered +to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate +`custom_code` endpoints. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:write`
@@ -5379,7 +5944,15 @@ await client.pages.scripts.upsertCustomCode("63c720f9347c2139b248e552", {
-Delete the custom code block that an app has created for a page

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` +Delete the custom code block that an app has created for a page + +In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered +to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate +`custom_code` endpoints. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:write`
@@ -5517,7 +6090,11 @@ await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741");
-Get all registered scripts that have been applied to a specific Site.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:read` +Get all registered scripts that have been applied to a specific Site. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:read`
@@ -5580,7 +6157,15 @@ await client.sites.scripts.getCustomCode("580e63e98c9a982ac9b8b741");
-Add a registered script to a Site.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` +Add a registered script to a Site. + +In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered +to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate +`custom_code` endpoints. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:write`
@@ -5667,7 +6252,11 @@ await client.sites.scripts.upsertCustomCode("580e63e98c9a982ac9b8b741", {
-Delete the custom code block that an app created for a Site

Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` +Delete the custom code block that an app created for a Site + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:write`
@@ -5730,7 +6319,11 @@ await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741");
-Get all instances of Custom Code applied to a Site or Pages.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:read` +Get all instances of Custom Code applied to a Site or Pages. + +
Access to this endpoint requires a bearer token from a Data Client App.
+ +Required scope | `custom_code:read`
diff --git a/src/Client.ts b/src/Client.ts index e1e74c57..e4cb5550 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -32,6 +32,8 @@ export declare namespace WebflowClient { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } diff --git a/src/api/errors/InternalServerError.ts b/src/api/errors/InternalServerError.ts index f9aec6df..a83d14b5 100644 --- a/src/api/errors/InternalServerError.ts +++ b/src/api/errors/InternalServerError.ts @@ -3,9 +3,10 @@ */ import * as errors from "../../errors/index"; +import * as Webflow from "../index"; export class InternalServerError extends errors.WebflowError { - constructor(body?: unknown) { + constructor(body: Webflow.Error_) { super({ message: "InternalServerError", statusCode: 500, diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts index 97686b39..bc6c3fb9 100644 --- a/src/api/errors/NotFoundError.ts +++ b/src/api/errors/NotFoundError.ts @@ -3,9 +3,10 @@ */ import * as errors from "../../errors/index"; +import * as Webflow from "../index"; export class NotFoundError extends errors.WebflowError { - constructor(body?: unknown) { + constructor(body: Webflow.Error_) { super({ message: "NotFoundError", statusCode: 404, diff --git a/src/api/errors/TooManyRequestsError.ts b/src/api/errors/TooManyRequestsError.ts index 8b4b9421..1a041104 100644 --- a/src/api/errors/TooManyRequestsError.ts +++ b/src/api/errors/TooManyRequestsError.ts @@ -6,7 +6,7 @@ import * as errors from "../../errors/index"; import * as Webflow from "../index"; export class TooManyRequestsError extends errors.WebflowError { - constructor(body: Webflow.TooManyRequestsErrorBody) { + constructor(body: Webflow.Error_) { super({ message: "TooManyRequestsError", statusCode: 429, diff --git a/src/api/errors/UnauthorizedError.ts b/src/api/errors/UnauthorizedError.ts index 43ce22a3..62dd92e5 100644 --- a/src/api/errors/UnauthorizedError.ts +++ b/src/api/errors/UnauthorizedError.ts @@ -3,9 +3,10 @@ */ import * as errors from "../../errors/index"; +import * as Webflow from "../index"; export class UnauthorizedError extends errors.WebflowError { - constructor(body?: unknown) { + constructor(body: Webflow.Error_) { super({ message: "UnauthorizedError", statusCode: 401, diff --git a/src/api/resources/accessGroups/client/Client.ts b/src/api/resources/accessGroups/client/Client.ts index 317b9cd0..6cbd2c8f 100644 --- a/src/api/resources/accessGroups/client/Client.ts +++ b/src/api/resources/accessGroups/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace AccessGroups { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,9 @@ export class AccessGroups { constructor(protected readonly _options: AccessGroups.Options) {} /** - * Get a list of access groups for a site

Required scope | `users:read` + * Get a list of access groups for a site + * + * Required scope | `users:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.AccessGroupsListRequest} request @@ -74,10 +78,11 @@ export class AccessGroups { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -101,14 +106,30 @@ export class AccessGroups { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -117,7 +138,15 @@ export class AccessGroups { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -133,7 +162,9 @@ export class AccessGroups { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/accessgroups." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/assets/client/Client.ts b/src/api/resources/assets/client/Client.ts index 0d2c7470..3a97d92c 100644 --- a/src/api/resources/assets/client/Client.ts +++ b/src/api/resources/assets/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Assets { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,9 @@ export class Assets { constructor(protected readonly _options: Assets.Options) {} /** - * List assets for a given site

Required scope | `assets:read` + * List assets for a given site + * + * Required scope | `assets:read` * * @param {string} siteId - Unique identifier for a Site * @param {Assets.RequestOptions} requestOptions - Request-specific configuration. @@ -54,10 +58,11 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -80,12 +85,28 @@ export class Assets { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -94,7 +115,15 @@ export class Assets { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -110,7 +139,7 @@ export class Assets { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/assets."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -119,7 +148,13 @@ export class Assets { } /** - * Create a new asset entry.

This endpoint generates a response with the following information: `uploadUrl` and `uploadDetails`. You can use these two properties to [upload the file to Amazon s3 by making a POST](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) request to the `uploadUrl` with the `uploadDetails` object as your header information in the request.

Required scope | `assets:write` + * Create a new asset entry. + * + * This endpoint generates a response with the following information: `uploadUrl` and `uploadDetails`. + * You can use these two properties to [upload the file to Amazon s3 by making a POST](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) + * request to the `uploadUrl` with the `uploadDetails` object as your header information in the request. + * + * Required scope | `assets:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.AssetsCreateRequest} request @@ -152,14 +187,19 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.AssetsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.AssetsCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -179,12 +219,28 @@ export class Assets { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -193,7 +249,15 @@ export class Assets { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -209,7 +273,7 @@ export class Assets { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/assets."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -218,7 +282,9 @@ export class Assets { } /** - * Get an Asset

Required scope | `assets:read` + * Get an Asset + * + * Required scope | `assets:read` * * @param {string} assetId - Unique identifier for an Asset on a site * @param {Assets.RequestOptions} requestOptions - Request-specific configuration. @@ -243,10 +309,11 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -269,12 +336,28 @@ export class Assets { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -283,7 +366,15 @@ export class Assets { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -299,7 +390,7 @@ export class Assets { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /assets/{asset_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -310,6 +401,8 @@ export class Assets { /** * Delete an Asset * + * Required Scope: `assets: write` + * * @param {string} assetId - Unique identifier for an Asset on a site * @param {Assets.RequestOptions} requestOptions - Request-specific configuration. * @@ -333,10 +426,11 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -353,12 +447,28 @@ export class Assets { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -367,7 +477,15 @@ export class Assets { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -383,7 +501,7 @@ export class Assets { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /assets/{asset_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -392,7 +510,9 @@ export class Assets { } /** - * Update an Asset

Required scope | `assets:write` + * Update an Asset + * + * Required scope | `assets:write` * * @param {string} assetId - Unique identifier for an Asset on a site * @param {Webflow.AssetsUpdateRequest} request @@ -405,13 +525,11 @@ export class Assets { * @throws {@link Webflow.InternalServerError} * * @example - * await client.assets.update("580e63fc8c9a982ac9b8b745", { - * displayName: "bulldoze.png" - * }) + * await client.assets.update("580e63fc8c9a982ac9b8b745") */ public async update( assetId: string, - request: Webflow.AssetsUpdateRequest, + request: Webflow.AssetsUpdateRequest = {}, requestOptions?: Assets.RequestOptions ): Promise { const _response = await core.fetcher({ @@ -424,14 +542,19 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.AssetsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.AssetsUpdateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -451,12 +574,28 @@ export class Assets { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -465,7 +604,15 @@ export class Assets { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -481,7 +628,7 @@ export class Assets { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /assets/{asset_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -490,7 +637,9 @@ export class Assets { } /** - * List Asset Folders within a given site

Required scope | `assets:read` + * List Asset Folders within a given site + * + * Required scope | `assets:read` * * @param {string} siteId - Unique identifier for a Site * @param {Assets.RequestOptions} requestOptions - Request-specific configuration. @@ -515,10 +664,11 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -541,12 +691,28 @@ export class Assets { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -555,7 +721,15 @@ export class Assets { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -571,7 +745,9 @@ export class Assets { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/asset_folders." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -580,7 +756,9 @@ export class Assets { } /** - * Create an Asset Folder within a given site

Required scope | `assets:write` + * Create an Asset Folder within a given site + * + * Required scope | `assets:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.AssetsCreateFolderRequest} request @@ -612,14 +790,19 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.AssetsCreateFolderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.AssetsCreateFolderRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -639,12 +822,28 @@ export class Assets { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -653,7 +852,15 @@ export class Assets { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -669,7 +876,9 @@ export class Assets { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/asset_folders." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -678,7 +887,9 @@ export class Assets { } /** - * Get details about a specific Asset Folder

Required scope | `assets:read` + * Get details about a specific Asset Folder + * + * Required scope | `assets:read` * * @param {string} assetFolderId - Unique identifier for an Asset Folder * @param {Assets.RequestOptions} requestOptions - Request-specific configuration. @@ -706,10 +917,11 @@ export class Assets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -732,12 +944,28 @@ export class Assets { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -746,7 +974,15 @@ export class Assets { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -762,7 +998,9 @@ export class Assets { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /asset_folders/{asset_folder_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/assets/client/requests/AssetsCreateRequest.ts b/src/api/resources/assets/client/requests/AssetsCreateRequest.ts index 242fd8a3..71adecd7 100644 --- a/src/api/resources/assets/client/requests/AssetsCreateRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsCreateRequest.ts @@ -10,10 +10,10 @@ * } */ export interface AssetsCreateRequest { - /** file name including file extension */ + /** File name including file extension. File names must be less than 100 characters. */ fileName: string; /** MD5 hash of the file */ fileHash: string; - /** id of the Asset folder (optional) */ + /** ID of the Asset folder (optional) */ parentFolder?: string; } diff --git a/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts b/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts index 0aed8a60..a01981af 100644 --- a/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts @@ -4,11 +4,11 @@ /** * @example - * { - * displayName: "bulldoze.png" - * } + * {} */ export interface AssetsUpdateRequest { - /** file name including file extension */ - displayName: string; + /** Unique identifier for a specific locale. Applicable, when using localization. */ + localeId?: string; + /** A human readable name for the asset */ + displayName?: string; } diff --git a/src/api/resources/collections/client/Client.ts b/src/api/resources/collections/client/Client.ts index ddd398b9..ea0639c6 100644 --- a/src/api/resources/collections/client/Client.ts +++ b/src/api/resources/collections/client/Client.ts @@ -24,6 +24,8 @@ export declare namespace Collections { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -31,7 +33,9 @@ export class Collections { constructor(protected readonly _options: Collections.Options) {} /** - * List of all Collections within a Site.

Required scope | `cms:read` + * List of all Collections within a Site. + * + * Required scope | `cms:read` * * @param {string} siteId - Unique identifier for a Site * @param {Collections.RequestOptions} requestOptions - Request-specific configuration. @@ -56,10 +60,11 @@ export class Collections { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -82,12 +87,28 @@ export class Collections { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -96,7 +117,15 @@ export class Collections { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -112,7 +141,7 @@ export class Collections { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/collections."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -121,7 +150,9 @@ export class Collections { } /** - * Create a Collection for a site.

Required scope | `cms:write` + * Create a Collection for a site. + * + * Required scope | `cms:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.CollectionsCreateRequest} request @@ -155,14 +186,19 @@ export class Collections { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.CollectionsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.CollectionsCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -182,12 +218,28 @@ export class Collections { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -196,7 +248,15 @@ export class Collections { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -212,7 +272,9 @@ export class Collections { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/collections." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -221,7 +283,9 @@ export class Collections { } /** - * Get the full details of a collection from its ID.

Required scope | `cms:read` + * Get the full details of a collection from its ID. + * + * Required scope | `cms:read` * * @param {string} collectionId - Unique identifier for a Collection * @param {Collections.RequestOptions} requestOptions - Request-specific configuration. @@ -246,10 +310,11 @@ export class Collections { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -272,12 +337,28 @@ export class Collections { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -286,7 +367,15 @@ export class Collections { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -302,7 +391,7 @@ export class Collections { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /collections/{collection_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -311,7 +400,9 @@ export class Collections { } /** - * Delete a collection using its ID.

Required scope | `cms:write` + * Delete a collection using its ID. + * + * Required scope | `cms:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {Collections.RequestOptions} requestOptions - Request-specific configuration. @@ -323,9 +414,9 @@ export class Collections { * @throws {@link Webflow.InternalServerError} * * @example - * await client.collections.deleteCollection("580e63fc8c9a982ac9b8b745") + * await client.collections.delete("580e63fc8c9a982ac9b8b745") */ - public async deleteCollection(collectionId: string, requestOptions?: Collections.RequestOptions): Promise { + public async delete(collectionId: string, requestOptions?: Collections.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, @@ -336,10 +427,11 @@ export class Collections { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -356,12 +448,8 @@ export class Collections { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); - case 404: - throw new Webflow.NotFoundError(_response.error.body); - case 429: - throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -369,88 +457,19 @@ export class Collections { breadcrumbsPrefix: ["response"], }) ); - case 500: - throw new Webflow.InternalServerError(_response.error.body); - default: - throw new errors.WebflowError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.WebflowError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.WebflowTimeoutError(); - case "unknown": - throw new errors.WebflowError({ - message: _response.error.errorMessage, - }); - } - } - - /** - * Delete a custom field in a collection. This endpoint does not currently support bulk deletion.

Required scope | `cms:write` - * - * @param {string} collectionId - Unique identifier for a Collection - * @param {string} fieldId - Unique identifier for a Field in a collection - * @param {Collections.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Webflow.BadRequestError} - * @throws {@link Webflow.UnauthorizedError} - * @throws {@link Webflow.NotFoundError} - * @throws {@link Webflow.TooManyRequestsError} - * @throws {@link Webflow.InternalServerError} - * - * @example - * await client.collections.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745") - */ - public async delete( - collectionId: string, - fieldId: string, - requestOptions?: Collections.RequestOptions - ): Promise { - const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, - `collections/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}` - ), - method: "DELETE", - headers: { - Authorization: await this._getAuthorizationHeader(), - "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - }, - contentType: "application/json", - requestType: "json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Webflow.BadRequestError(_response.error.body); - case 401: - throw new Webflow.UnauthorizedError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -459,7 +478,15 @@ export class Collections { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -475,7 +502,9 @@ export class Collections { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /collections/{collection_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/collections/resources/fields/client/Client.ts b/src/api/resources/collections/resources/fields/client/Client.ts index 558f0f01..ec00e8dc 100644 --- a/src/api/resources/collections/resources/fields/client/Client.ts +++ b/src/api/resources/collections/resources/fields/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Fields { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,16 @@ export class Fields { constructor(protected readonly _options: Fields.Options) {} /** - * Create a custom field in a collection.

Slugs must be all lowercase letters without spaces. If you pass a string with uppercase letters and/or spaces to the "Slug" property, Webflow will convert the slug to lowercase and replace spaces with "-."

Only some field types can be created through the API. This endpoint does not currently support bulk creation.

Required scope | `cms:write` + * Create a custom field in a collection. + * + * Slugs must be all lowercase letters without spaces. + * If you pass a string with uppercase letters and/or spaces to the "Slug" property, Webflow will + * convert the slug to lowercase and replace spaces with "-." + * + * Only some field types can be created through the API. + * This endpoint does not currently support bulk creation. + * + * Required scope | `cms:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {Webflow.collections.FieldCreate} request @@ -64,14 +75,19 @@ export class Fields { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.collections.FieldCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.collections.FieldCreate.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -91,12 +107,28 @@ export class Fields { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -105,7 +137,15 @@ export class Fields { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -121,7 +161,9 @@ export class Fields { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /collections/{collection_id}/fields." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -130,7 +172,123 @@ export class Fields { } /** - * Update a custom field in a collection.

Required scope | `cms:write` + * Delete a custom field in a collection. This endpoint does not currently support bulk deletion. + * + * Required scope | `cms:write` + * + * @param {string} collectionId - Unique identifier for a Collection + * @param {string} fieldId - Unique identifier for a Field in a collection + * @param {Fields.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745") + */ + public async delete(collectionId: string, fieldId: string, requestOptions?: Fields.RequestOptions): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `collections/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}` + ), + method: "DELETE", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /collections/{collection_id}/fields/{field_id}." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Update a custom field in a collection. + * + * Required scope | `cms:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {string} fieldId - Unique identifier for a Field in a collection @@ -166,14 +324,19 @@ export class Fields { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.collections.FieldUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.collections.FieldUpdate.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -193,12 +356,28 @@ export class Fields { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -207,7 +386,15 @@ export class Fields { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -223,7 +410,9 @@ export class Fields { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /collections/{collection_id}/fields/{field_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/collections/resources/items/client/Client.ts b/src/api/resources/collections/resources/items/client/Client.ts index 43f3ac5d..2839e57c 100644 --- a/src/api/resources/collections/resources/items/client/Client.ts +++ b/src/api/resources/collections/resources/items/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Items { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,9 @@ export class Items { constructor(protected readonly _options: Items.Options) {} /** - * List of all Items within a Collection.

Required scope | `CMS:read` + * List of all Items within a Collection. + * + * Required scope | `CMS:read` * * @param {string} collectionId - Unique identifier for a Collection * @param {Webflow.collections.ItemsListItemsRequest} request @@ -89,10 +93,11 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -116,12 +121,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -130,7 +151,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -146,7 +175,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /collections/{collection_id}/items." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -155,10 +186,14 @@ export class Items { } /** - * Create Item in a Collection.

To create items across multiple locales, please use the bulk item endpoint.

Required scope | CMS:write + * Create Item(s) in a Collection. + * + * To create items across multiple locales, please use [this endpoint.](/data/v2.0.0/reference/cms/collection-items/bulk-items/create-items) + * + * Required scope | `CMS:write` * * @param {string} collectionId - Unique identifier for a Collection - * @param {Webflow.CollectionItem} request + * @param {Webflow.collections.ItemsCreateItemRequest} request * @param {Items.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} @@ -169,11 +204,7 @@ export class Items { * * @example * await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", { - * id: "42b720ef280c7a7a3be8cabe", - * cmsLocaleId: "653ad57de882f528b32e810e", - * lastPublished: "2022-11-29T16:22:43.159Z", - * lastUpdated: "2022-11-17T17:19:43.282Z", - * createdOn: "2022-11-17T17:11:57.148Z", + * id: "580e64008c9a982ac9b8b754", * isArchived: false, * isDraft: false, * fieldData: { @@ -181,10 +212,31 @@ export class Items { * slug: "pan-galactic-gargle-blaster" * } * }) + * + * @example + * await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", { + * items: [{ + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Senior Data Analyst", + * slug: "senior-data-analyst" + * } + * }, { + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Product Manager", + * slug: "product-manager" + * } + * }] + * }) */ public async createItem( collectionId: string, - request: Webflow.CollectionItem, + request: Webflow.collections.ItemsCreateItemRequest, requestOptions?: Items.RequestOptions ): Promise { const _response = await core.fetcher({ @@ -197,14 +249,19 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.CollectionItem.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.collections.ItemsCreateItemRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -224,12 +281,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -238,7 +311,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -254,7 +335,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /collections/{collection_id}/items." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -263,10 +346,14 @@ export class Items { } /** - * List of all live Items within a Collection.

Required scope | `CMS:read` + * Delete Items from a Collection. + * + * **Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be deleted only in the primary locale. + * + * Required scope | `CMS:write` * * @param {string} collectionId - Unique identifier for a Collection - * @param {Webflow.collections.ItemsListItemsLiveRequest} request + * @param {Webflow.collections.ItemsDeleteItemsRequest} request * @param {Items.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} @@ -276,67 +363,218 @@ export class Items { * @throws {@link Webflow.InternalServerError} * * @example - * await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745") + * await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745") */ - public async listItemsLive( + public async deleteItems( collectionId: string, - request: Webflow.collections.ItemsListItemsLiveRequest = {}, + request: Webflow.collections.ItemsDeleteItemsRequest = {}, requestOptions?: Items.RequestOptions - ): Promise { - const { cmsLocaleId, offset, limit, name, slug, sortBy, sortOrder } = request; - const _queryParams: Record = {}; - if (cmsLocaleId != null) { - _queryParams["cmsLocaleId"] = cmsLocaleId; - } - - if (offset != null) { - _queryParams["offset"] = offset.toString(); - } - - if (limit != null) { - _queryParams["limit"] = limit.toString(); - } - - if (name != null) { - _queryParams["name"] = name; - } - - if (slug != null) { - _queryParams["slug"] = slug; + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `collections/${encodeURIComponent(collectionId)}/items` + ), + method: "DELETE", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.collections.ItemsDeleteItemsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; } - if (sortBy != null) { - _queryParams["sortBy"] = sortBy; + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } } - if (sortOrder != null) { - _queryParams["sortOrder"] = sortOrder; + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /collections/{collection_id}/items." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); } + } + /** + * Update a single item or multiple items (up to 100) in a Collection. + * + * **Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be updated only in the primary locale. + * + * Required scope | `CMS:write` + * + * @param {string} collectionId - Unique identifier for a Collection + * @param {Webflow.collections.ItemsUpdateItemsRequest} request + * @param {Items.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { + * items: [{ + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Ne Paniquez Pas", + * slug: "ne-paniquez-pas" + * } + * }, { + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "No Entrar en P\u00E1nico", + * slug: "no-entrar-en-panico" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Au Revoir et Merci pour Tous les Poissons", + * slug: "au-revoir-et-merci" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "Hasta Luego y Gracias por Todo el Pescado", + * slug: "hasta-luego-y-gracias" + * } + * }] + * }) + * + * @example + * await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { + * items: [{ + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Senior Data Analyst", + * slug: "senior-data-analyst" + * } + * }, { + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Product Manager", + * slug: "product-manager" + * } + * }] + * }) + */ + public async updateItems( + collectionId: string, + request: Webflow.collections.ItemsUpdateItemsRequest = {}, + requestOptions?: Items.RequestOptions + ): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, - `collections/${encodeURIComponent(collectionId)}/items/live` + `collections/${encodeURIComponent(collectionId)}/items` ), - method: "GET", + method: "PATCH", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", - queryParameters: _queryParams, requestType: "json", + body: serializers.collections.ItemsUpdateItemsRequest.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 serializers.CollectionItemList.parseOrThrow(_response.body, { + return serializers.CollectionItem.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -350,12 +588,478 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /collections/{collection_id}/items." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * List of all live Items within a Collection. + * + * Required scope | `CMS:read` + * + * @param {string} collectionId - Unique identifier for a Collection + * @param {Webflow.collections.ItemsListItemsLiveRequest} request + * @param {Items.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745") + */ + public async listItemsLive( + collectionId: string, + request: Webflow.collections.ItemsListItemsLiveRequest = {}, + requestOptions?: Items.RequestOptions + ): Promise { + const { cmsLocaleId, offset, limit, name, slug, sortBy, sortOrder } = request; + const _queryParams: Record = {}; + if (cmsLocaleId != null) { + _queryParams["cmsLocaleId"] = cmsLocaleId; + } + + if (offset != null) { + _queryParams["offset"] = offset.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (name != null) { + _queryParams["name"] = name; + } + + if (slug != null) { + _queryParams["slug"] = slug; + } + + if (sortBy != null) { + _queryParams["sortBy"] = sortBy; + } + + if (sortOrder != null) { + _queryParams["sortOrder"] = sortOrder; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `collections/${encodeURIComponent(collectionId)}/items/live` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CollectionItemList.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /collections/{collection_id}/items/live." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Create live Item(s) in a Collection. The Item(s) will be published to the live site. + * + * To create items across multiple locales, [please use this endpoint.](/v2.0.0/data/reference/cms/collection-items/bulk-items/create-items) + * + * Required scope | `CMS:write` + * + * @param {string} collectionId - Unique identifier for a Collection + * @param {Webflow.collections.ItemsCreateItemLiveRequest} request + * @param {Items.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Pan Galactic Gargle Blaster Recipe", + * slug: "pan-galactic-gargle-blaster" + * } + * }) + * + * @example + * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + * items: [{ + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Senior Data Analyst", + * slug: "senior-data-analyst" + * } + * }, { + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Product Manager", + * slug: "product-manager" + * } + * }] + * }) + */ + public async createItemLive( + collectionId: string, + request: Webflow.collections.ItemsCreateItemLiveRequest, + requestOptions?: Items.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `collections/${encodeURIComponent(collectionId)}/items/live` + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.collections.ItemsCreateItemLiveRequest.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 serializers.CollectionItem.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /collections/{collection_id}/items/live." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Remove an item or multiple items (up to 100 items) from the live site. Deleting published items will unpublish the items from the live site and set them to draft. + * + * **Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be unpublished only in the primary locale. + * + * Required scope | `CMS:write` + * + * @param {string} collectionId - Unique identifier for a Collection + * @param {Webflow.collections.ItemsDeleteItemsLiveRequest} request + * @param {Items.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Webflow.BadRequestError} + * @throws {@link Webflow.UnauthorizedError} + * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.TooManyRequestsError} + * @throws {@link Webflow.InternalServerError} + * + * @example + * await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745") + */ + public async deleteItemsLive( + collectionId: string, + request: Webflow.collections.ItemsDeleteItemsLiveRequest = {}, + requestOptions?: Items.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `collections/${encodeURIComponent(collectionId)}/items/live` + ), + method: "DELETE", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.collections.ItemsDeleteItemsLiveRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -363,8 +1067,6 @@ export class Items { breadcrumbsPrefix: ["response"], }) ); - case 500: - throw new Webflow.InternalServerError(_response.error.body); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -380,7 +1082,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /collections/{collection_id}/items/live." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -389,10 +1093,14 @@ export class Items { } /** - * Create live Item in a Collection. This Item will be published to the live site.

To create items across multiple locales, please use this endpoint.

Required scope | `CMS:write` + * Update a single live item or multiple live items (up to 100) in a Collection + * + * **Note:** If the `cmsLocaleId` parameter is undefined or empty and the items are localized, items will be updated only in the primary locale. + * + * Required scope | `CMS:write` * * @param {string} collectionId - Unique identifier for a Collection - * @param {Webflow.CollectionItem} request + * @param {Webflow.collections.ItemsUpdateItemsLiveRequest} request * @param {Items.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} @@ -402,49 +1110,93 @@ export class Items { * @throws {@link Webflow.InternalServerError} * * @example - * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { - * id: "42b720ef280c7a7a3be8cabe", - * cmsLocaleId: "653ad57de882f528b32e810e", - * lastPublished: "2022-11-29T16:22:43.159Z", - * lastUpdated: "2022-11-17T17:19:43.282Z", - * createdOn: "2022-11-17T17:11:57.148Z", - * isArchived: false, - * isDraft: false, - * fieldData: { - * name: "Pan Galactic Gargle Blaster Recipe", - * slug: "pan-galactic-gargle-blaster" - * } + * await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + * items: [{ + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Ne Paniquez Pas", + * slug: "ne-paniquez-pas" + * } + * }, { + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "No Entrar en P\u00E1nico", + * slug: "no-entrar-en-panico" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Au Revoir et Merci pour Tous les Poissons", + * slug: "au-revoir-et-merci" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "Hasta Luego y Gracias por Todo el Pescado", + * slug: "hasta-luego-y-gracias" + * } + * }] + * }) + * + * @example + * await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + * items: [{ + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Senior Data Analyst", + * slug: "senior-data-analyst" + * } + * }, { + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Product Manager", + * slug: "product-manager" + * } + * }] * }) */ - public async createItemLive( + public async updateItemsLive( collectionId: string, - request: Webflow.CollectionItem, + request: Webflow.collections.ItemsUpdateItemsLiveRequest = {}, requestOptions?: Items.RequestOptions - ): Promise { + ): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/live` ), - method: "POST", + method: "PATCH", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.CollectionItem.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.collections.ItemsUpdateItemsLiveRequest.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 serializers.CollectionItem.parseOrThrow(_response.body, { + return serializers.CollectionItemListNoPagination.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -458,12 +1210,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -472,7 +1240,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -488,7 +1264,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /collections/{collection_id}/items/live." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -497,10 +1275,17 @@ export class Items { } /** - * Create single Item in a Collection with multiple corresponding locales.

Required scope | `CMS:write` + * Create an item or multiple items in a CMS Collection across multiple corresponding locales. + * + * **Notes:** + * + * - This endpoint can create up to 100 items in a request. + * - If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale. + * + * Required scope | `CMS:write` * * @param {string} collectionId - Unique identifier for a Collection - * @param {Webflow.BulkCollectionItem} request + * @param {Webflow.collections.CreateBulkCollectionItemRequestBody} request * @param {Items.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} @@ -510,13 +1295,33 @@ export class Items { * @throws {@link Webflow.InternalServerError} * * @example - * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", { - * id: "580e64008c9a982ac9b8b754" + * await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { + * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Don\u2019t Panic", + * slug: "dont-panic" + * } + * }) + * + * @example + * await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { + * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"], + * isArchived: false, + * isDraft: false, + * fieldData: [{ + * name: "Don\u2019t Panic", + * slug: "dont-panic" + * }, { + * name: "So Long and Thanks for All the Fish", + * slug: "so-long-and-thanks" + * }] * }) */ - public async createItemForMultipleLocales( + public async createItems( collectionId: string, - request: Webflow.BulkCollectionItem, + request: Webflow.collections.CreateBulkCollectionItemRequestBody = {}, requestOptions?: Items.RequestOptions ): Promise { const _response = await core.fetcher({ @@ -529,14 +1334,19 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.BulkCollectionItem.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough" }), + body: serializers.collections.CreateBulkCollectionItemRequestBody.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -556,12 +1366,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -570,7 +1396,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -586,7 +1420,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /collections/{collection_id}/items/bulk." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -595,7 +1431,9 @@ export class Items { } /** - * Get details of a selected Collection Item.

Required scope | `CMS:read` + * Get details of a selected Collection Item. + * + * Required scope | `CMS:read` * * @param {string} collectionId - Unique identifier for a Collection * @param {string} itemId - Unique identifier for an Item @@ -633,10 +1471,11 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -660,12 +1499,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -674,7 +1529,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -690,7 +1553,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /collections/{collection_id}/items/{item_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -699,7 +1564,9 @@ export class Items { } /** - * Delete an Item from a Collection. This endpoint does not currently support bulk deletion.

Required scope | `CMS:write` + * Delete an Item from a Collection. This endpoint does not currently support bulk deletion. + * + * Required scope | `CMS:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {string} itemId - Unique identifier for an Item @@ -737,10 +1604,11 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -758,12 +1626,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -772,7 +1656,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -788,7 +1680,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /collections/{collection_id}/items/{item_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -797,7 +1691,9 @@ export class Items { } /** - * Update a selected Item in a Collection.

Required scope | `CMS:write` + * Update a selected Item in a Collection. + * + * Required scope | `CMS:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {string} itemId - Unique identifier for an Item @@ -841,14 +1737,19 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.CollectionItem.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough" }), + body: serializers.CollectionItem.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -868,12 +1769,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -882,7 +1799,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -898,7 +1823,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /collections/{collection_id}/items/{item_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -907,7 +1834,9 @@ export class Items { } /** - * Get details of a selected Collection live Item.

Required scope | `CMS:read` + * Get details of a selected Collection live Item. + * + * Required scope | `CMS:read` * * @param {string} collectionId - Unique identifier for a Collection * @param {string} itemId - Unique identifier for an Item @@ -945,10 +1874,11 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -972,12 +1902,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -986,7 +1932,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -1002,7 +1956,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /collections/{collection_id}/items/{item_id}/live." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -1011,7 +1967,11 @@ export class Items { } /** - * Remove a live item from the site. Removing a published item will unpublish the item from the live site and set it to draft. This endpoint does not currently support bulk deletion.

Required scope | `CMS:write` + * Remove a live item from the site. Removing a published item will unpublish the item from the live site and set it to draft. + * + * This endpoint does not currently support bulk deletion. + * + * Required scope | `CMS:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {string} itemId - Unique identifier for an Item @@ -1049,10 +2009,11 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -1070,12 +2031,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -1084,7 +2061,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -1100,7 +2085,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /collections/{collection_id}/items/{item_id}/live." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -1109,7 +2096,9 @@ export class Items { } /** - * Update a selected live Item in a Collection. The updates for this Item will be published to the live site.

Required scope | `CMS:write` + * Update a selected live Item in a Collection. The updates for this Item will be published to the live site. + * + * Required scope | `CMS:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {string} itemId - Unique identifier for an Item @@ -1153,14 +2142,19 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.CollectionItem.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough" }), + body: serializers.CollectionItem.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1180,12 +2174,28 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -1194,7 +2204,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -1210,7 +2228,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /collections/{collection_id}/items/{item_id}/live." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -1219,7 +2239,9 @@ export class Items { } /** - * Publish an item or multiple items.

Required scope | `cms:write` + * Publish an item or multiple items. + * + * Required scope | `cms:write` * * @param {string} collectionId - Unique identifier for a Collection * @param {Webflow.collections.ItemsPublishItemRequest} request @@ -1228,6 +2250,7 @@ export class Items { * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} + * @throws {@link Webflow.ConflictError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * @@ -1251,15 +2274,18 @@ export class Items { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", body: serializers.collections.ItemsPublishItemRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, @@ -1280,12 +2306,30 @@ export class Items { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 409: + throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -1294,7 +2338,15 @@ export class Items { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -1310,7 +2362,9 @@ export class Items { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /collections/{collection_id}/items/publish." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts b/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts new file mode 100644 index 00000000..43701eac --- /dev/null +++ b/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * { + * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Don\u2019t Panic", + * slug: "dont-panic" + * } + * } + * + * @example + * { + * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"], + * isArchived: false, + * isDraft: false, + * fieldData: [{ + * name: "Don\u2019t Panic", + * slug: "dont-panic" + * }, { + * name: "So Long and Thanks for All the Fish", + * slug: "so-long-and-thanks" + * }] + * } + * + * @example + * { + * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Don\u2019t Panic", + * slug: "dont-panic" + * } + * } + * + * @example + * { + * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Don\u2019t Panic", + * slug: "dont-panic" + * } + * } + */ +export interface CreateBulkCollectionItemRequestBody { + /** Array of identifiers for the locales where the item will be created */ + cmsLocaleIds?: string[]; + /** Indicates whether the item is archived. */ + isArchived?: boolean; + /** Indicates whether the item is in draft state. */ + isDraft?: boolean; + fieldData?: Webflow.collections.CreateBulkCollectionItemRequestBodyFieldData; +} diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts new file mode 100644 index 00000000..88fa549f --- /dev/null +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * {} + */ +export interface ItemsDeleteItemsLiveRequest { + items?: Webflow.collections.ItemsDeleteItemsLiveRequestItemsItem[]; +} diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts new file mode 100644 index 00000000..39d30414 --- /dev/null +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * {} + */ +export interface ItemsDeleteItemsRequest { + items?: Webflow.collections.ItemsDeleteItemsRequestItemsItem[]; +} diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts new file mode 100644 index 00000000..8af8abaf --- /dev/null +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * { + * items: [{ + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Ne Paniquez Pas", + * slug: "ne-paniquez-pas" + * } + * }, { + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "No Entrar en P\u00E1nico", + * slug: "no-entrar-en-panico" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Au Revoir et Merci pour Tous les Poissons", + * slug: "au-revoir-et-merci" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "Hasta Luego y Gracias por Todo el Pescado", + * slug: "hasta-luego-y-gracias" + * } + * }] + * } + * + * @example + * { + * items: [{ + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Senior Data Analyst", + * slug: "senior-data-analyst" + * } + * }, { + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Product Manager", + * slug: "product-manager" + * } + * }] + * } + * + * @example + * { + * items: [{ + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Ne Paniquez Pas", + * slug: "ne-paniquez-pas" + * } + * }, { + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "No Entrar en P\u00E1nico", + * slug: "no-entrar-en-panico" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Au Revoir et Merci pour Tous les Poissons", + * slug: "au-revoir-et-merci" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "Hasta Luego y Gracias por Todo el Pescado", + * slug: "hasta-luego-y-gracias" + * } + * }] + * } + * + * @example + * { + * items: [{ + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Ne Paniquez Pas", + * slug: "ne-paniquez-pas" + * } + * }, { + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "No Entrar en P\u00E1nico", + * slug: "no-entrar-en-panico" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Au Revoir et Merci pour Tous les Poissons", + * slug: "au-revoir-et-merci" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "Hasta Luego y Gracias por Todo el Pescado", + * slug: "hasta-luego-y-gracias" + * } + * }] + * } + */ +export interface ItemsUpdateItemsLiveRequest { + items?: Webflow.CollectionItemWithIdInput[]; +} diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts new file mode 100644 index 00000000..d80365ae --- /dev/null +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../../index"; + +/** + * @example + * { + * items: [{ + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Ne Paniquez Pas", + * slug: "ne-paniquez-pas" + * } + * }, { + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "No Entrar en P\u00E1nico", + * slug: "no-entrar-en-panico" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Au Revoir et Merci pour Tous les Poissons", + * slug: "au-revoir-et-merci" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "Hasta Luego y Gracias por Todo el Pescado", + * slug: "hasta-luego-y-gracias" + * } + * }] + * } + * + * @example + * { + * items: [{ + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Senior Data Analyst", + * slug: "senior-data-analyst" + * } + * }, { + * id: "580e64008c9a982ac9b8b754", + * isArchived: false, + * isDraft: false, + * fieldData: { + * name: "Product Manager", + * slug: "product-manager" + * } + * }] + * } + * + * @example + * { + * items: [{ + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Ne Paniquez Pas", + * slug: "ne-paniquez-pas" + * } + * }, { + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "No Entrar en P\u00E1nico", + * slug: "no-entrar-en-panico" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Au Revoir et Merci pour Tous les Poissons", + * slug: "au-revoir-et-merci" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "Hasta Luego y Gracias por Todo el Pescado", + * slug: "hasta-luego-y-gracias" + * } + * }] + * } + * + * @example + * { + * items: [{ + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Ne Paniquez Pas", + * slug: "ne-paniquez-pas" + * } + * }, { + * id: "66f6ed9576ddacf3149d5ea6", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "No Entrar en P\u00E1nico", + * slug: "no-entrar-en-panico" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca5", + * fieldData: { + * name: "Au Revoir et Merci pour Tous les Poissons", + * slug: "au-revoir-et-merci" + * } + * }, { + * id: "66f6ed9576ddacf3149d5eaa", + * cmsLocaleId: "66f6e966c9e1dc700a857ca4", + * fieldData: { + * name: "Hasta Luego y Gracias por Todo el Pescado", + * slug: "hasta-luego-y-gracias" + * } + * }] + * } + */ +export interface ItemsUpdateItemsRequest { + items?: Webflow.CollectionItemWithIdInput[]; +} diff --git a/src/api/resources/collections/resources/items/client/requests/index.ts b/src/api/resources/collections/resources/items/client/requests/index.ts index c5e6b062..3c8a1893 100644 --- a/src/api/resources/collections/resources/items/client/requests/index.ts +++ b/src/api/resources/collections/resources/items/client/requests/index.ts @@ -1,5 +1,10 @@ export { type ItemsListItemsRequest } from "./ItemsListItemsRequest"; +export { type ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; +export { type ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; export { type ItemsListItemsLiveRequest } from "./ItemsListItemsLiveRequest"; +export { type ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; +export { type ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; +export { type CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; export { type ItemsGetItemRequest } from "./ItemsGetItemRequest"; export { type ItemsDeleteItemRequest } from "./ItemsDeleteItemRequest"; export { type ItemsGetItemLiveRequest } from "./ItemsGetItemLiveRequest"; diff --git a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts new file mode 100644 index 00000000..ba28059d --- /dev/null +++ b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../index"; + +export type CreateBulkCollectionItemRequestBodyFieldData = + | Webflow.collections.CreateBulkCollectionItemRequestBodyFieldDataName + | Webflow.collections.CreateBulkCollectionItemRequestBodyFieldDataItem[]; diff --git a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts new file mode 100644 index 00000000..b6181f54 --- /dev/null +++ b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CreateBulkCollectionItemRequestBodyFieldDataItem { + /** The name of the item. */ + name: string; + /** + * URL slug for the item in your site. + * Note: Updating the item slug will break all links referencing the old slug. + */ + slug: string; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.ts b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.ts new file mode 100644 index 00000000..78e3a858 --- /dev/null +++ b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CreateBulkCollectionItemRequestBodyFieldDataName { + /** The name of the item. */ + name: string; + /** + * URL slug for the item in your site. + * Note: Updating the item slug will break all links referencing the old slug. + */ + slug: string; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.ts b/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.ts new file mode 100644 index 00000000..933fc7b8 --- /dev/null +++ b/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../index"; + +export type ItemsCreateItemLiveRequest = Webflow.CollectionItem | Webflow.collections.ItemsCreateItemLiveRequestItems; diff --git a/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.ts b/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.ts new file mode 100644 index 00000000..5040e3e6 --- /dev/null +++ b/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../index"; + +export interface ItemsCreateItemLiveRequestItems { + /** List of collection items to create */ + items?: Webflow.CollectionItem[]; +} diff --git a/src/api/resources/collections/resources/items/types/ItemsCreateItemRequest.ts b/src/api/resources/collections/resources/items/types/ItemsCreateItemRequest.ts new file mode 100644 index 00000000..936dafe3 --- /dev/null +++ b/src/api/resources/collections/resources/items/types/ItemsCreateItemRequest.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../index"; + +export type ItemsCreateItemRequest = Webflow.CollectionItem | Webflow.collections.ItemsCreateItemRequestItems; diff --git a/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestItems.ts b/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestItems.ts new file mode 100644 index 00000000..678d6422 --- /dev/null +++ b/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestItems.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../../index"; + +export interface ItemsCreateItemRequestItems { + /** An array of items to create */ + items?: Webflow.CollectionItem[]; +} diff --git a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts new file mode 100644 index 00000000..aff9bd08 --- /dev/null +++ b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ItemsDeleteItemsLiveRequestItemsItem { + /** Unique identifier for the Item */ + itemId: string; + /** Array of identifiers for the locales where the item will be created */ + cmsLocaleIds?: string[]; +} diff --git a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts new file mode 100644 index 00000000..f7758491 --- /dev/null +++ b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ItemsDeleteItemsRequestItemsItem { + /** Unique identifier for the Item */ + id: string; + /** Array of identifiers for the locales where the item will be created */ + cmsLocaleIds?: string[]; +} diff --git a/src/api/resources/collections/resources/items/types/index.ts b/src/api/resources/collections/resources/items/types/index.ts index dce8a6ed..be18fc71 100644 --- a/src/api/resources/collections/resources/items/types/index.ts +++ b/src/api/resources/collections/resources/items/types/index.ts @@ -1,5 +1,14 @@ export * from "./ItemsListItemsRequestSortBy"; export * from "./ItemsListItemsRequestSortOrder"; +export * from "./ItemsCreateItemRequestItems"; +export * from "./ItemsCreateItemRequest"; +export * from "./ItemsDeleteItemsRequestItemsItem"; export * from "./ItemsListItemsLiveRequestSortBy"; export * from "./ItemsListItemsLiveRequestSortOrder"; +export * from "./ItemsCreateItemLiveRequestItems"; +export * from "./ItemsCreateItemLiveRequest"; +export * from "./ItemsDeleteItemsLiveRequestItemsItem"; +export * from "./CreateBulkCollectionItemRequestBodyFieldDataName"; +export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; +export * from "./CreateBulkCollectionItemRequestBodyFieldData"; export * from "./ItemsPublishItemResponse"; diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index 4707f716..7e61b07a 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Ecommerce { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -61,10 +63,11 @@ export class Ecommerce { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -87,16 +90,32 @@ export class Ecommerce { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -105,7 +124,15 @@ export class Ecommerce { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -121,7 +148,9 @@ export class Ecommerce { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/ecommerce/settings." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/forms/client/Client.ts b/src/api/resources/forms/client/Client.ts index 00094696..ea2f58d3 100644 --- a/src/api/resources/forms/client/Client.ts +++ b/src/api/resources/forms/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Forms { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,9 @@ export class Forms { constructor(protected readonly _options: Forms.Options) {} /** - * List forms for a given site

Required scope | `forms:read` + * List forms for a given site. + * + * Required scope | `forms:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.FormsListRequest} request @@ -71,10 +75,11 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -98,16 +103,32 @@ export class Forms { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -116,7 +137,15 @@ export class Forms { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -132,7 +161,7 @@ export class Forms { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/forms."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -141,7 +170,9 @@ export class Forms { } /** - * Get information about a given form

Required scope | `forms:read` + * Get information about a given form. + * + * Required scope | `forms:read` * * @param {string} formId - Unique identifier for a Form * @param {Forms.RequestOptions} requestOptions - Request-specific configuration. @@ -167,10 +198,11 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -193,14 +225,30 @@ export class Forms { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -209,7 +257,15 @@ export class Forms { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -225,7 +281,7 @@ export class Forms { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /forms/{form_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -234,7 +290,9 @@ export class Forms { } /** - * List form submissions for a given form

Required scope | `forms:read` + * List form submissions for a given form + * + * Required scope | `forms:read` * * @param {string} formId - Unique identifier for a Form * @param {Webflow.FormsListSubmissionsRequest} request @@ -275,10 +333,11 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -302,14 +361,30 @@ export class Forms { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -318,7 +393,15 @@ export class Forms { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -334,7 +417,7 @@ export class Forms { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /forms/{form_id}/submissions."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -343,7 +426,9 @@ export class Forms { } /** - * Get information about a given form submission

Required scope | `forms:read` + * Get information about a given form submissio. + * + * Required scope | `forms:read` * * @param {string} formSubmissionId - Unique identifier for a Form Submission * @param {Forms.RequestOptions} requestOptions - Request-specific configuration. @@ -372,10 +457,11 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -398,14 +484,30 @@ export class Forms { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -414,7 +516,15 @@ export class Forms { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -430,7 +540,9 @@ export class Forms { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /form_submissions/{form_submission_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -439,7 +551,9 @@ export class Forms { } /** - * Update hidden fields on a form submission

Required scope | `forms:write` + * Update hidden fields on a form submission + * + * Required scope | `forms:write` * * @param {string} formSubmissionId - Unique identifier for a Form Submission * @param {Webflow.FormsUpdateSubmissionRequest} request @@ -471,14 +585,19 @@ export class Forms { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.FormsUpdateSubmissionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.FormsUpdateSubmissionRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -498,16 +617,32 @@ export class Forms { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -516,7 +651,15 @@ export class Forms { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -532,7 +675,9 @@ export class Forms { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /form_submissions/{form_submission_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index 4731edbf..da43dad8 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Inventory { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -63,10 +65,11 @@ export class Inventory { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -89,16 +92,32 @@ export class Inventory { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -107,7 +126,15 @@ export class Inventory { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -123,7 +150,9 @@ export class Inventory { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /collections/{collection_id}/items/{item_id}/inventory." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -132,7 +161,12 @@ export class Inventory { } /** - * Updates the current inventory levels for a particular SKU item. Updates may be given in one or two methods, absolutely or incrementally. Absolute updates are done by setting `quantity` directly. Incremental updates are by specifying the inventory delta in `updateQuantity` which is then added to the `quantity` stored on the server. + * Updates the current inventory levels for a particular SKU item. + * + * Updates may be given in one or two methods, absolutely or incrementally. + * + * - Absolute updates are done by setting `quantity` directly. + * - Incremental updates are by specifying the inventory delta in `updateQuantity` which is then added to the `quantity` stored on the server. * * Required scope | `ecommerce:write` * @@ -170,14 +204,19 @@ export class Inventory { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.InventoryUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.InventoryUpdateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -197,16 +236,32 @@ export class Inventory { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -215,7 +270,15 @@ export class Inventory { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -231,7 +294,9 @@ export class Inventory { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /collections/{collection_id}/items/{item_id}/inventory." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/orders/client/Client.ts b/src/api/resources/orders/client/Client.ts index fb466ec3..dab57017 100644 --- a/src/api/resources/orders/client/Client.ts +++ b/src/api/resources/orders/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Orders { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -77,10 +79,11 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -104,16 +107,32 @@ export class Orders { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -122,7 +141,15 @@ export class Orders { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -138,7 +165,7 @@ export class Orders { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/orders."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -147,7 +174,8 @@ export class Orders { } /** - * Retrieve a single product by its id. All of its SKUs will also be retrieved. + * Retrieve a single product by its ID. All of its SKUs will also be + * retrieved. * * Required scope | `ecommerce:read` * @@ -177,10 +205,11 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -203,16 +232,32 @@ export class Orders { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -221,7 +266,15 @@ export class Orders { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -237,7 +290,9 @@ export class Orders { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/orders/{order_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -246,7 +301,9 @@ export class Orders { } /** - * This API lets you update the fields, `comment`, `shippingProvider`, and/or `shippingTracking` for a given order. All three fields can be updated simultaneously or independently. + * This API lets you update the fields, `comment`, `shippingProvider`, + * and/or `shippingTracking` for a given order. All three fields can be + * updated simultaneously or independently. * * Required scope | `ecommerce:write` * @@ -282,14 +339,19 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.OrdersUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.OrdersUpdateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -309,16 +371,32 @@ export class Orders { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -327,7 +405,15 @@ export class Orders { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -343,7 +429,9 @@ export class Orders { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /sites/{site_id}/orders/{order_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -388,14 +476,19 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.OrdersUpdateFulfillRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.OrdersUpdateFulfillRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -415,16 +508,32 @@ export class Orders { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -433,7 +542,15 @@ export class Orders { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -449,7 +566,9 @@ export class Orders { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/orders/{order_id}/fulfill." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -492,10 +611,11 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -518,16 +638,32 @@ export class Orders { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -536,7 +672,15 @@ export class Orders { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -552,7 +696,9 @@ export class Orders { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/orders/{order_id}/unfulfill." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -598,14 +744,19 @@ export class Orders { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.OrdersRefundRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.OrdersRefundRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -625,16 +776,32 @@ export class Orders { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -643,7 +810,15 @@ export class Orders { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -659,7 +834,9 @@ export class Orders { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/orders/{order_id}/refund." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/pages/client/Client.ts b/src/api/resources/pages/client/Client.ts index d85f1b5d..e7fcaf95 100644 --- a/src/api/resources/pages/client/Client.ts +++ b/src/api/resources/pages/client/Client.ts @@ -23,6 +23,8 @@ export declare namespace Pages { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -30,7 +32,9 @@ export class Pages { constructor(protected readonly _options: Pages.Options) {} /** - * List of all pages for a site

Required scope | `pages:read` + * List of all pages for a site. + * + * Required scope | `pages:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.PagesListRequest} request @@ -44,7 +48,7 @@ export class Pages { * * @example * await client.pages.list("580e63e98c9a982ac9b8b741", { - * locale: "65427cf400e02b306eaa04a0" + * localeId: "65427cf400e02b306eaa04a0" * }) */ public async list( @@ -52,10 +56,10 @@ export class Pages { request: Webflow.PagesListRequest = {}, requestOptions?: Pages.RequestOptions ): Promise { - const { locale, limit, offset } = request; + const { localeId, limit, offset } = request; const _queryParams: Record = {}; - if (locale != null) { - _queryParams["locale"] = locale; + if (localeId != null) { + _queryParams["localeId"] = localeId; } if (limit != null) { @@ -76,10 +80,11 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -103,12 +108,28 @@ export class Pages { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -117,7 +138,15 @@ export class Pages { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -133,7 +162,7 @@ export class Pages { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/pages."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -142,7 +171,9 @@ export class Pages { } /** - * Get metadata information for a single page

Required scope | `pages:read` + * Get metadata information for a single page. + * + * Required scope | `pages:read` * * @param {string} pageId - Unique identifier for a Page * @param {Webflow.PagesGetMetadataRequest} request @@ -156,7 +187,7 @@ export class Pages { * * @example * await client.pages.getMetadata("63c720f9347c2139b248e552", { - * locale: "65427cf400e02b306eaa04a0" + * localeId: "65427cf400e02b306eaa04a0" * }) */ public async getMetadata( @@ -164,10 +195,10 @@ export class Pages { request: Webflow.PagesGetMetadataRequest = {}, requestOptions?: Pages.RequestOptions ): Promise { - const { locale } = request; + const { localeId } = request; const _queryParams: Record = {}; - if (locale != null) { - _queryParams["locale"] = locale; + if (localeId != null) { + _queryParams["localeId"] = localeId; } const _response = await core.fetcher({ @@ -180,10 +211,11 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -207,12 +239,28 @@ export class Pages { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -221,7 +269,15 @@ export class Pages { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -237,7 +293,7 @@ export class Pages { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /pages/{page_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -246,7 +302,9 @@ export class Pages { } /** - * Update Page-level metadata, including SEO and Open Graph fields.

Required scope | `pages:write` + * Update Page-level metadata, including SEO and Open Graph fields. + * + * Required scope | `pages:write` * * @param {string} pageId - Unique identifier for a Page * @param {Webflow.UpdatePageSettingsRequest} request @@ -260,19 +318,18 @@ export class Pages { * * @example * await client.pages.updatePageSettings("63c720f9347c2139b248e552", { - * locale: "65427cf400e02b306eaa04a0", + * localeId: "65427cf400e02b306eaa04a0", * body: { * id: "6596da6045e56dee495bcbba", * 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, * draft: false, * canBranch: true, + * isBranch: false, * seo: { * title: "The Ultimate Hitchhiker's Guide to the Galaxy", * description: "Everything you need to know about the galaxy, from avoiding Vogon poetry to the importance of towels." @@ -293,10 +350,10 @@ export class Pages { request: Webflow.UpdatePageSettingsRequest, requestOptions?: Pages.RequestOptions ): Promise { - const { locale, body: _body } = request; + const { localeId, body: _body } = request; const _queryParams: Record = {}; - if (locale != null) { - _queryParams["locale"] = locale; + if (localeId != null) { + _queryParams["localeId"] = localeId; } const _response = await core.fetcher({ @@ -309,15 +366,20 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, requestType: "json", - body: serializers.Page.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.Page.jsonOrThrow(_body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -337,12 +399,28 @@ export class Pages { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -351,7 +429,15 @@ export class Pages { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -367,7 +453,7 @@ export class Pages { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling PUT /pages/{page_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -376,7 +462,11 @@ export class Pages { } /** - * Get static content from a static page.
If you do not provide a Locale ID in your request, the response will return any content that can be localized from the Primary locale

Required scope | `pages:read` + * Get static content from a static page. + * + * If you do not provide a Locale ID in your request, the response will return any content that can be localized from the Primary locale. + * + * Required scope | `pages:read` * * @param {string} pageId - Unique identifier for a Page * @param {Webflow.PagesGetContentRequest} request @@ -391,7 +481,7 @@ export class Pages { * * @example * await client.pages.getContent("63c720f9347c2139b248e552", { - * locale: "65427cf400e02b306eaa04a0" + * localeId: "65427cf400e02b306eaa04a0" * }) */ public async getContent( @@ -399,10 +489,10 @@ export class Pages { request: Webflow.PagesGetContentRequest = {}, requestOptions?: Pages.RequestOptions ): Promise { - const { locale, limit, offset } = request; + const { localeId, limit, offset } = request; const _queryParams: Record = {}; - if (locale != null) { - _queryParams["locale"] = locale; + if (localeId != null) { + _queryParams["localeId"] = localeId; } if (limit != null) { @@ -423,10 +513,11 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -450,14 +541,30 @@ export class Pages { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -466,7 +573,15 @@ export class Pages { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -482,7 +597,7 @@ export class Pages { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /pages/{page_id}/dom."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -510,16 +625,16 @@ export class Pages { * * @example * await client.pages.updateStaticContent("63c720f9347c2139b248e552", { - * locale: "locale", + * localeId: "65427cf400e02b306eaa04a0", * nodes: [{ * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - * text: "

The Hitchhiker's Guide to the Galaxy

" + * text: "

The Hitchhiker\u2019s Guide to the Galaxy

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

Don't Panic!

Always know where your towel is.

" + * text: "

Don\u2019t Panic!

Always know where your towel is.

" * }, { * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", - * text: "Marvin, the Paranoid Android" + * text: "\"Marvin," * }] * }) */ @@ -528,9 +643,12 @@ export class Pages { request: Webflow.DomWrite, requestOptions?: Pages.RequestOptions ): Promise { - const { locale, ..._body } = request; + const { localeId, ..._body } = request; const _queryParams: Record = {}; - _queryParams["locale"] = locale; + if (localeId != null) { + _queryParams["localeId"] = localeId; + } + const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, @@ -541,15 +659,20 @@ export class Pages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, requestType: "json", - body: serializers.DomWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.DomWrite.jsonOrThrow(_body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -569,14 +692,30 @@ export class Pages { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -585,7 +724,15 @@ export class Pages { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -601,7 +748,7 @@ export class Pages { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /pages/{page_id}/dom."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/pages/client/requests/DomWrite.ts b/src/api/resources/pages/client/requests/DomWrite.ts index ce43919e..0f0d95ff 100644 --- a/src/api/resources/pages/client/requests/DomWrite.ts +++ b/src/api/resources/pages/client/requests/DomWrite.ts @@ -7,23 +7,23 @@ import * as Webflow from "../../../../index"; /** * @example * { - * locale: "locale", + * localeId: "65427cf400e02b306eaa04a0", * nodes: [{ * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - * text: "

The Hitchhiker's Guide to the Galaxy

" + * text: "

The Hitchhiker\u2019s Guide to the Galaxy

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

Don't Panic!

Always know where your towel is.

" + * text: "

Don\u2019t Panic!

Always know where your towel is.

" * }, { * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", - * text: "Marvin, the Paranoid Android" + * text: "\"Marvin," * }] * } */ export interface DomWrite { /** - * The locale identifier. + * Unique identifier for a specific locale. Applicable, when using localization. */ - locale: string; + localeId?: string; nodes: Webflow.DomWriteNodesItem[]; } diff --git a/src/api/resources/pages/client/requests/PagesGetContentRequest.ts b/src/api/resources/pages/client/requests/PagesGetContentRequest.ts index 971e471c..498d1f87 100644 --- a/src/api/resources/pages/client/requests/PagesGetContentRequest.ts +++ b/src/api/resources/pages/client/requests/PagesGetContentRequest.ts @@ -5,14 +5,14 @@ /** * @example * { - * locale: "65427cf400e02b306eaa04a0" + * localeId: "65427cf400e02b306eaa04a0" * } */ export interface PagesGetContentRequest { /** * Unique identifier for a specific locale. Applicable, when using localization. */ - locale?: string; + localeId?: string; /** * Maximum number of records to be returned (max limit: 100) */ diff --git a/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts b/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts index d4a4e72d..6afc0c77 100644 --- a/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts +++ b/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts @@ -5,12 +5,12 @@ /** * @example * { - * locale: "65427cf400e02b306eaa04a0" + * localeId: "65427cf400e02b306eaa04a0" * } */ export interface PagesGetMetadataRequest { /** * Unique identifier for a specific locale. Applicable, when using localization. */ - locale?: string; + localeId?: string; } diff --git a/src/api/resources/pages/client/requests/PagesListRequest.ts b/src/api/resources/pages/client/requests/PagesListRequest.ts index b7ba9cf4..5ba1736d 100644 --- a/src/api/resources/pages/client/requests/PagesListRequest.ts +++ b/src/api/resources/pages/client/requests/PagesListRequest.ts @@ -5,14 +5,14 @@ /** * @example * { - * locale: "65427cf400e02b306eaa04a0" + * localeId: "65427cf400e02b306eaa04a0" * } */ export interface PagesListRequest { /** * Unique identifier for a specific locale. Applicable, when using localization. */ - locale?: string; + localeId?: string; /** * Maximum number of records to be returned (max limit: 100) */ diff --git a/src/api/resources/pages/client/requests/UpdatePageSettingsRequest.ts b/src/api/resources/pages/client/requests/UpdatePageSettingsRequest.ts index d66afa13..72b16682 100644 --- a/src/api/resources/pages/client/requests/UpdatePageSettingsRequest.ts +++ b/src/api/resources/pages/client/requests/UpdatePageSettingsRequest.ts @@ -7,19 +7,18 @@ import * as Webflow from "../../../../index"; /** * @example * { - * locale: "65427cf400e02b306eaa04a0", + * localeId: "65427cf400e02b306eaa04a0", * body: { * id: "6596da6045e56dee495bcbba", * 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, * draft: false, * canBranch: true, + * isBranch: false, * seo: { * title: "The Ultimate Hitchhiker's Guide to the Galaxy", * description: "Everything you need to know about the galaxy, from avoiding Vogon poetry to the importance of towels." @@ -39,6 +38,6 @@ export interface UpdatePageSettingsRequest { /** * Unique identifier for a specific locale. Applicable, when using localization. */ - locale?: string; + localeId?: string; body: Webflow.Page; } diff --git a/src/api/resources/pages/resources/scripts/client/Client.ts b/src/api/resources/pages/resources/scripts/client/Client.ts index 83a099e0..e686ebe6 100644 --- a/src/api/resources/pages/resources/scripts/client/Client.ts +++ b/src/api/resources/pages/resources/scripts/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Scripts { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,15 @@ export class Scripts { constructor(protected readonly _options: Scripts.Options) {} /** - * Get all registered scripts that have been applied to a specific Page.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:read` + * Get all registered scripts that have been applied to a specific Page. + * + * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered + * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate + * `custom_code` endpoints. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:read` * * @param {string} pageId - Unique identifier for a Page * @param {Scripts.RequestOptions} requestOptions - Request-specific configuration. @@ -57,10 +67,11 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -83,12 +94,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -97,7 +124,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -113,7 +148,7 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /pages/{page_id}/custom_code."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -122,7 +157,15 @@ export class Scripts { } /** - * Add a registered script to a Page.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` + * Add a registered script to a Page. + * + * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered + * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate + * `custom_code` endpoints. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:write` * * @param {string} pageId - Unique identifier for a Page * @param {Webflow.ScriptApplyList} request @@ -165,14 +208,19 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.ScriptApplyList.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.ScriptApplyList.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -192,12 +240,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -206,7 +270,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -222,7 +294,7 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling PUT /pages/{page_id}/custom_code."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -231,7 +303,15 @@ export class Scripts { } /** - * Delete the custom code block that an app has created for a page

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` + * Delete the custom code block that an app has created for a page + * + * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered + * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate + * `custom_code` endpoints. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:write` * * @param {string} pageId - Unique identifier for a Page * @param {Scripts.RequestOptions} requestOptions - Request-specific configuration. @@ -256,10 +336,11 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -276,12 +357,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -290,7 +387,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -306,7 +411,9 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /pages/{page_id}/custom_code." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/products/client/Client.ts b/src/api/resources/products/client/Client.ts index d98b1f2a..4abbb981 100644 --- a/src/api/resources/products/client/Client.ts +++ b/src/api/resources/products/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Products { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,10 @@ export class Products { constructor(protected readonly _options: Products.Options) {} /** - * Retrieve all products for a site. Use `limit` and `offset` to page through all products with subsequent requests. All SKUs for each product will also be fetched and returned. The `limit`, `offset` and `total` values represent Products only and do not include any SKUs. + * Retrieve all products for a site. + * + * Use `limit` and `offset` to page through all products with subsequent requests. All SKUs for each product + * will also be fetched and returned. The `limit`, `offset` and `total` values represent Products only and do not include any SKUs. * * Required scope | `ecommerce:read` * @@ -73,10 +78,11 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -100,16 +106,32 @@ export class Products { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -118,7 +140,15 @@ export class Products { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -134,7 +164,7 @@ export class Products { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/products."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -143,13 +173,19 @@ export class Products { } /** - * Creating a new Product involves creating both a Product and a SKU, since a Product Item has to have, at minimum, a single SKU. + * Create a new product and SKU. + * + * When you create a product, you will always create a SKU, since a Product Item must have, at minimum, a single SKU. * - * In order to create a Product with multiple SKUs - for example a T-shirt in sizes small, medium and large - you'll need to create `sku-properties`. In our T-shirt example, a single `sku-property` would be Color. Within that property, we'll need to list out the various colors a T-shirt could be as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. + * To create a Product with multiple SKUs - for example a T-shirt in sizes small, medium and large: * - * Once, you've created a Product and its `sku-properties` with `enum` values, you can create your default SKU, which will automatically be a combination of the first `sku-properties` you've created. In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. After you've created your product, you can create additional SKUs using the Create SKU endpoint + * - Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). + * - A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. + * - Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created. + * - In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. + * - After you've created your product, you can create additional SKUs using the [Create SKU endpoint.](/data/reference/ecommerce/products-sk-us/create-sku) * - * Upon creation, the default product type will be `Advanced`. The product type is used to determine which Product and SKU fields are shown to users in the `Designer` and the `Editor`. Setting it to `Advanced` ensures that all Product and SKU fields will be shown. + * Upon creation, the default product type will be `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. * * Required scope | `ecommerce:write` * @@ -183,14 +219,19 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.ProductSkuCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.ProductSkuCreate.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -210,16 +251,32 @@ export class Products { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -228,7 +285,15 @@ export class Products { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -244,7 +309,7 @@ export class Products { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/products."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -253,7 +318,8 @@ export class Products { } /** - * Retrieve a single product by its id. All of its SKUs will also be retrieved. + * Retrieve a single product by its ID. All of its SKUs will also be + * retrieved. * * Required scope | `ecommerce:read` * @@ -287,10 +353,11 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -313,16 +380,32 @@ export class Products { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -331,7 +414,15 @@ export class Products { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -347,7 +438,9 @@ export class Products { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/products/{product_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -356,7 +449,9 @@ export class Products { } /** - * Updating an existing Product will set the product type to `Advanced`. The product type is used to determine which Product and SKU fields are shown to users in the `Designer` and the `Editor`. Setting it to `Advanced` ensures that all Product and SKU fields will be shown. The product type can be edited in the `Designer` or the `Editor`. + * Update an existing Product. + * + * Updating an existing Product will set the product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. * * Required scope | `ecommerce:write` * @@ -392,14 +487,19 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.ProductSkuUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.ProductSkuUpdate.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -419,16 +519,32 @@ export class Products { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -437,7 +553,15 @@ export class Products { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -453,7 +577,9 @@ export class Products { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /sites/{site_id}/products/{product_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -462,9 +588,9 @@ export class Products { } /** - * Create additional SKUs to cover every variant of your Product. The Default SKU already counts as one of the variants. + * Create additional SKUs to manage every [option and variant of your Product.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants) * - * Creating additional SKUs will set the product type to `Advanced` for the product associated with the SKUs. The product type is used to determine which Product and SKU fields are shown to users in the `Designer` and the `Editor`. Setting it to `Advanced` ensures that all Product and SKU fields will be shown. The product type can be edited in the `Designer` or the `Editor`. + * Creating SKUs through the API will set the product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. * * Required scope | `ecommerce:write` * @@ -502,14 +628,19 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.ProductsCreateSkuRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.ProductsCreateSkuRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -529,16 +660,32 @@ export class Products { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -547,7 +694,15 @@ export class Products { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -563,7 +718,9 @@ export class Products { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/products/{product_id}/skus." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -572,7 +729,9 @@ export class Products { } /** - * Updating an existing SKU will set the product type to `Advanced` for the product associated with the SKU. The product type is used to determine which Product and SKU fields are shown to users in the `Designer` and the `Editor`. Setting it to `Advanced` ensures that all Product and SKU fields will be shown. The product type can be edited in the `Designer` or the `Editor`. + * Update a specified SKU. + * + * Updating an existing SKU will set the Product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. * * Required scope | `ecommerce:write` * @@ -614,14 +773,19 @@ export class Products { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.ProductsUpdateSkuRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.ProductsUpdateSkuRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -641,16 +805,32 @@ export class Products { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -659,7 +839,15 @@ export class Products { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -675,7 +863,9 @@ export class Products { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /sites/{site_id}/products/{product_id}/skus/{sku_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/scripts/client/Client.ts b/src/api/resources/scripts/client/Client.ts index 537efeb6..240e10d8 100644 --- a/src/api/resources/scripts/client/Client.ts +++ b/src/api/resources/scripts/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Scripts { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,16 @@ export class Scripts { constructor(protected readonly _options: Scripts.Options) {} /** - * List of scripts registered to a Site.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints. Additionally, Scripts can be remotely hosted, or registered as inline snippets.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:read` + * List of scripts registered to a Site. + * + * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered + * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate + * `custom_code` endpoints. + * Additionally, Scripts can be remotely hosted, or registered as inline snippets. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:read` * * @param {string} siteId - Unique identifier for a Site * @param {Scripts.RequestOptions} requestOptions - Request-specific configuration. @@ -54,10 +65,11 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -80,12 +92,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -94,7 +122,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -110,7 +146,9 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/registered_scripts." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -119,7 +157,16 @@ export class Scripts { } /** - * Add a script to a Site's Custom Code registry.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints. Additionally, Scripts can be remotely hosted, or registered as inline snippets.
Access to this endpoint requires a bearer token from a Data Client App.


Required scope | `custom_code:write` + * Add a script to a Site's Custom Code registry. + * + * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered + * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate + * `custom_code` endpoints. + * Additionally, Scripts can be remotely hosted, or registered as inline snippets. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.CustomCodeHostedRequest} request @@ -154,14 +201,19 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.CustomCodeHostedRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.CustomCodeHostedRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -181,12 +233,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -195,7 +263,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -211,7 +287,9 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/registered_scripts/hosted." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -220,7 +298,15 @@ export class Scripts { } /** - * Add a script to a Site's Custom Code registry. Inline scripts can be between 1 and 2000 characters.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.

Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` + * Add a script to a Site's Custom Code registry. Inline scripts can be between 1 and 2000 characters. + * + * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered + * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate + * `custom_code` endpoints. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.CustomCodeInlineRequest} request @@ -254,14 +340,19 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.CustomCodeInlineRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.CustomCodeInlineRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -281,12 +372,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -295,7 +402,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -311,7 +426,9 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/registered_scripts/inline." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index ad6bf98d..2fb304eb 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -24,6 +24,8 @@ export declare namespace Sites { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -31,7 +33,9 @@ export class Sites { constructor(protected readonly _options: Sites.Options) {} /** - * List of all sites the provided access token is able to access.

Required scope | `sites:read` + * List of all sites the provided access token is able to access. + * + * Required scope | `sites:read` * * @param {Sites.RequestOptions} requestOptions - Request-specific configuration. * @@ -53,10 +57,11 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -77,12 +82,28 @@ export class Sites { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -105,7 +126,7 @@ export class Sites { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -114,7 +135,9 @@ export class Sites { } /** - * Get a site by site id

Required scope | `sites:read` + * Get details of a site. + * + * Required scope | `sites:read` * * @param {string} siteId - Unique identifier for a Site * @param {Sites.RequestOptions} requestOptions - Request-specific configuration. @@ -139,10 +162,11 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -165,12 +189,28 @@ export class Sites { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -179,7 +219,15 @@ export class Sites { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -195,7 +243,7 @@ export class Sites { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -204,7 +252,9 @@ export class Sites { } /** - * Get a list of all custom domains related to site.

Required scope | `sites:read` + * Get a list of all custom domains related to site. + * + * Required scope | `sites:read` * * @param {string} siteId - Unique identifier for a Site * @param {Sites.RequestOptions} requestOptions - Request-specific configuration. @@ -229,10 +279,11 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -253,14 +304,30 @@ export class Sites { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -269,7 +336,15 @@ export class Sites { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -285,7 +360,9 @@ export class Sites { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/custom_domains." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -294,7 +371,11 @@ export class Sites { } /** - * Publish a site to one more more domains.

Required scope | `sites:write`

📘

Endpoint-specific rate limit

This endpoint has a limit of one successful publish queue per minute.

+ * Publishes a site to one or more more domains. + * + * This endpoint has a limit of one successful publish queue per minute. + * + * Required scope | `sites:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.SitesPublishRequest} request @@ -324,14 +405,19 @@ export class Sites { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.SitesPublishRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.SitesPublishRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -351,14 +437,30 @@ export class Sites { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -381,7 +483,7 @@ export class Sites { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/publish."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/sites/client/requests/SitesPublishRequest.ts b/src/api/resources/sites/client/requests/SitesPublishRequest.ts index c8fc5cbc..98d54bb0 100644 --- a/src/api/resources/sites/client/requests/SitesPublishRequest.ts +++ b/src/api/resources/sites/client/requests/SitesPublishRequest.ts @@ -7,7 +7,7 @@ * {} */ export interface SitesPublishRequest { - /** Array of Custom Domain ids to publish */ + /** Array of Custom Domain IDs to publish */ customDomains?: string[]; /** Choice of whether to publish to the default Webflow Subdomain */ publishToWebflowSubdomain?: boolean; diff --git a/src/api/resources/sites/resources/activityLogs/client/Client.ts b/src/api/resources/sites/resources/activityLogs/client/Client.ts index 5675d9c4..59a57c8b 100644 --- a/src/api/resources/sites/resources/activityLogs/client/Client.ts +++ b/src/api/resources/sites/resources/activityLogs/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace ActivityLogs { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -68,10 +70,11 @@ export class ActivityLogs { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -95,10 +98,18 @@ export class ActivityLogs { case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -107,7 +118,15 @@ export class ActivityLogs { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -123,7 +142,9 @@ export class ActivityLogs { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/activity_logs." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/sites/resources/scripts/client/Client.ts b/src/api/resources/sites/resources/scripts/client/Client.ts index 16e13e45..64d7b669 100644 --- a/src/api/resources/sites/resources/scripts/client/Client.ts +++ b/src/api/resources/sites/resources/scripts/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Scripts { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,11 @@ export class Scripts { constructor(protected readonly _options: Scripts.Options) {} /** - * Get all registered scripts that have been applied to a specific Site.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:read` + * Get all registered scripts that have been applied to a specific Site. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:read` * * @param {string} siteId - Unique identifier for a Site * @param {Scripts.RequestOptions} requestOptions - Request-specific configuration. @@ -57,10 +63,11 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -83,12 +90,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -97,7 +120,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -113,7 +144,7 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/custom_code."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -122,7 +153,15 @@ export class Scripts { } /** - * Add a registered script to a Site.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate `custom_code` endpoints.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` + * Add a registered script to a Site. + * + * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered + * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate + * `custom_code` endpoints. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.ScriptApplyList} request @@ -165,14 +204,19 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.ScriptApplyList.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.ScriptApplyList.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -192,12 +236,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -206,7 +266,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -222,7 +290,7 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling PUT /sites/{site_id}/custom_code."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -231,7 +299,11 @@ export class Scripts { } /** - * Delete the custom code block that an app created for a Site

Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:write` + * Delete the custom code block that an app created for a Site + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:write` * * @param {string} siteId - Unique identifier for a Site * @param {Scripts.RequestOptions} requestOptions - Request-specific configuration. @@ -256,10 +328,11 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -276,12 +349,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -290,7 +379,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -306,7 +403,9 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /sites/{site_id}/custom_code." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -315,7 +414,11 @@ export class Scripts { } /** - * Get all instances of Custom Code applied to a Site or Pages.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `custom_code:read` + * Get all instances of Custom Code applied to a Site or Pages. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * + * Required scope | `custom_code:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.sites.ScriptsListCustomCodeBlocksRequest} request @@ -355,10 +458,11 @@ export class Scripts { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -382,12 +486,28 @@ export class Scripts { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -396,7 +516,15 @@ export class Scripts { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -412,7 +540,9 @@ export class Scripts { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/custom_code/blocks." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/token/client/Client.ts b/src/api/resources/token/client/Client.ts index 428ab59e..cd0f0658 100644 --- a/src/api/resources/token/client/Client.ts +++ b/src/api/resources/token/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Token { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,9 @@ export class Token { constructor(protected readonly _options: Token.Options) {} /** - * Information about the Authorized User

Required Scope | `authorized_user:read` + * Information about the Authorized User + * + * Required Scope | `authorized_user:read` * * @param {Token.RequestOptions} requestOptions - Request-specific configuration. * @@ -50,10 +54,11 @@ export class Token { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -74,7 +79,15 @@ export class Token { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); default: @@ -92,7 +105,7 @@ export class Token { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /token/authorized_by."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -101,7 +114,8 @@ export class Token { } /** - * Information about the authorization token
Access to this endpoint requires a bearer token from a Data Client App.
+ * Information about the authorization token + * Access to this endpoint requires a bearer token from a []>Data Client App](/data/docs/getting-started-data-clients). * * @param {Token.RequestOptions} requestOptions - Request-specific configuration. * @@ -121,10 +135,11 @@ export class Token { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -145,7 +160,15 @@ export class Token { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -161,7 +184,7 @@ export class Token { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /token/introspect."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/users/client/Client.ts b/src/api/resources/users/client/Client.ts index e8953e6b..3931c6cd 100644 --- a/src/api/resources/users/client/Client.ts +++ b/src/api/resources/users/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Users { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,9 @@ export class Users { constructor(protected readonly _options: Users.Options) {} /** - * Get a list of users for a site

Required scope | `users:read` + * Get a list of users for a site + * + * Required scope | `users:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.UsersListRequest} request @@ -74,10 +78,11 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", queryParameters: _queryParams, @@ -101,14 +106,30 @@ export class Users { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -117,7 +138,15 @@ export class Users { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -133,7 +162,7 @@ export class Users { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/users."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -142,7 +171,9 @@ export class Users { } /** - * Get a User by ID

Required scope | `users:read` + * Get a User by ID + * + * Required scope | `users:read` * * @param {string} siteId - Unique identifier for a Site * @param {string} userId - Unique identifier for a User @@ -169,10 +200,11 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -195,14 +227,30 @@ export class Users { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -211,7 +259,15 @@ export class Users { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -227,7 +283,9 @@ export class Users { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/users/{user_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -236,7 +294,9 @@ export class Users { } /** - * Delete a User by ID

Required scope | `users:write` + * Delete a User by ID + * + * Required scope | `users:write` * * @param {string} siteId - Unique identifier for a Site * @param {string} userId - Unique identifier for a User @@ -263,10 +323,11 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -283,14 +344,30 @@ export class Users { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -299,7 +376,15 @@ export class Users { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -315,7 +400,9 @@ export class Users { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /sites/{site_id}/users/{user_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -324,9 +411,12 @@ export class Users { } /** - * Update a User by ID

Required scope | `users:write` + * Update a User by ID + * + * Required scope | `users:write` * - * + * The email and password + * fields cannot be updated using this endpoint * * @param {string} siteId - Unique identifier for a Site * @param {string} userId - Unique identifier for a User @@ -366,14 +456,19 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.UsersUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.UsersUpdateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -393,14 +488,30 @@ export class Users { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -409,7 +520,15 @@ export class Users { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -425,7 +544,9 @@ export class Users { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /sites/{site_id}/users/{user_id}." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -434,7 +555,11 @@ export class Users { } /** - * Create and invite a user with an email address. The user will be sent and invite via email, which they will need to accept in order to join paid Access Groups.

Required scope | `users:write` + * Create and invite a user with an email address. + * + * The user will be sent and invite via email, which they will need to accept in order to join paid any paid access group. + * + * Required scope | `users:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.UsersInviteRequest} request @@ -469,14 +594,19 @@ export class Users { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.UsersInviteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.UsersInviteRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -496,16 +626,32 @@ export class Users { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 403: throw new Webflow.ForbiddenError(_response.error.body); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 409: throw new Webflow.ConflictError(_response.error.body); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -514,7 +660,15 @@ export class Users { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -530,7 +684,9 @@ export class Users { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/users/invite." + ); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index 281779cd..409863d7 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -22,6 +22,8 @@ export declare namespace Webhooks { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; } } @@ -29,7 +31,9 @@ export class Webhooks { constructor(protected readonly _options: Webhooks.Options) {} /** - * List all App-created Webhooks registered for a given site

Required scope | `sites:read` + * List all App-created Webhooks registered for a given site + * + * Required scope | `sites:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration. @@ -54,10 +58,11 @@ export class Webhooks { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -80,12 +85,28 @@ export class Webhooks { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -94,7 +115,15 @@ export class Webhooks { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -110,7 +139,7 @@ export class Webhooks { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/webhooks."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -119,7 +148,12 @@ export class Webhooks { } /** - * Create a new Webhook, to be notified when Webflow resources change. Limit of 75 registrations per `triggerType`, per site.
Access to this endpoint requires a bearer token from a Data Client App.
Required scope | `sites:write` + * Create a new Webhook. + * + * Limit of 75 registrations per `triggerType`, per site. + * + *
Access to this endpoint requires a bearer token from a Data Client App.
+ * Required scope | `sites:write` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.Webhook} request @@ -157,14 +191,19 @@ export class Webhooks { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", - body: serializers.Webhook.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.Webhook.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -184,12 +223,28 @@ export class Webhooks { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -198,7 +253,15 @@ export class Webhooks { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -214,7 +277,7 @@ export class Webhooks { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/webhooks."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -225,6 +288,8 @@ export class Webhooks { /** * Get a specific Webhook instance * + * Required scope: `sites:read` + * * @param {string} webhookId - Unique identifier for a Webhook * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration. * @@ -248,10 +313,11 @@ export class Webhooks { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -274,12 +340,28 @@ export class Webhooks { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -288,7 +370,15 @@ export class Webhooks { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -304,7 +394,7 @@ export class Webhooks { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /webhooks/{webhook_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, @@ -315,6 +405,8 @@ export class Webhooks { /** * Remove a Webhook * + * Required scope: `sites:read` + * * @param {string} webhookId - Unique identifier for a Webhook * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration. * @@ -338,10 +430,11 @@ export class Webhooks { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "2.4.2", - "User-Agent": "webflow-api/2.4.2", + "X-Fern-SDK-Version": "2.5.0", + "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, }, contentType: "application/json", requestType: "json", @@ -358,12 +451,28 @@ export class Webhooks { case 400: throw new Webflow.BadRequestError(_response.error.body); case 401: - throw new Webflow.UnauthorizedError(_response.error.body); + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 404: - throw new Webflow.NotFoundError(_response.error.body); + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: throw new Webflow.TooManyRequestsError( - serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + serializers.Error_.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -372,7 +481,15 @@ export class Webhooks { }) ); case 500: - throw new Webflow.InternalServerError(_response.error.body); + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.WebflowError({ statusCode: _response.error.statusCode, @@ -388,7 +505,7 @@ export class Webhooks { body: _response.error.rawBody, }); case "timeout": - throw new errors.WebflowTimeoutError(); + throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /webhooks/{webhook_id}."); case "unknown": throw new errors.WebflowError({ message: _response.error.errorMessage, diff --git a/src/api/types/AssetFolder.ts b/src/api/types/AssetFolder.ts index 5e7d18a6..9affae5a 100644 --- a/src/api/types/AssetFolder.ts +++ b/src/api/types/AssetFolder.ts @@ -14,7 +14,7 @@ export interface AssetFolder { parentFolder?: string; /** Array of Asset instances in the folder */ assets?: string[]; - /** The unique id of the site the Asset Folder belongs to */ + /** The unique ID of the site the Asset Folder belongs to */ siteId?: string; /** Date that the Asset Folder was created on */ createdOn?: Date; diff --git a/src/api/types/AuthorizationAuthorization.ts b/src/api/types/AuthorizationAuthorization.ts index 9609859a..3527fde3 100644 --- a/src/api/types/AuthorizationAuthorization.ts +++ b/src/api/types/AuthorizationAuthorization.ts @@ -8,7 +8,7 @@ import * as Webflow from "../index"; * The Authorization object */ export interface AuthorizationAuthorization { - /** The unique id of the Authorization instance */ + /** The unique ID of the Authorization instance */ id?: string; /** The date the Authorization was created */ createdOn?: Date; diff --git a/src/api/types/AuthorizedUser.ts b/src/api/types/AuthorizedUser.ts index de8672df..c62b63d5 100644 --- a/src/api/types/AuthorizedUser.ts +++ b/src/api/types/AuthorizedUser.ts @@ -3,7 +3,7 @@ */ export interface AuthorizedUser { - /** The unique id of the user */ + /** The unique ID of the user */ id?: string; /** The user's email address */ email?: string; diff --git a/src/api/types/BulkCollectionItemFieldData.ts b/src/api/types/BulkCollectionItemFieldData.ts index a3d4c6b1..9c7a049b 100644 --- a/src/api/types/BulkCollectionItemFieldData.ts +++ b/src/api/types/BulkCollectionItemFieldData.ts @@ -7,6 +7,6 @@ export interface BulkCollectionItemFieldData { name?: string; /** URL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug. */ slug?: string; - /** Additional CMS Item field properties with any name and any type */ + /** Accepts any additional properties */ [key: string]: any; } diff --git a/src/api/types/CollectionItemFieldData.ts b/src/api/types/CollectionItemFieldData.ts index 24f3be2c..20ff95fb 100644 --- a/src/api/types/CollectionItemFieldData.ts +++ b/src/api/types/CollectionItemFieldData.ts @@ -7,6 +7,6 @@ export interface CollectionItemFieldData { name?: string; /** URL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug. */ slug?: string; - /** Additional CMS Item field properties with any name and any type */ + /** Accepts any additional properties */ [key: string]: any; } diff --git a/src/api/types/CollectionItemListNoPagination.ts b/src/api/types/CollectionItemListNoPagination.ts new file mode 100644 index 00000000..64e063ac --- /dev/null +++ b/src/api/types/CollectionItemListNoPagination.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * Results from collection items list + */ +export interface CollectionItemListNoPagination { + /** List of Items within the collection */ + items?: Webflow.CollectionItem[]; +} diff --git a/src/api/types/CollectionItemWithIdInput.ts b/src/api/types/CollectionItemWithIdInput.ts new file mode 100644 index 00000000..0320115e --- /dev/null +++ b/src/api/types/CollectionItemWithIdInput.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items + */ +export interface CollectionItemWithIdInput { + /** Unique identifier for the Item */ + id: string; + /** Identifier for the locale of the CMS item */ + cmsLocaleId?: string; + /** The date the item was last published */ + lastPublished?: string; + /** The date the item was last updated */ + lastUpdated?: string; + /** The date the item was created */ + createdOn?: string; + /** Boolean determining if the Item is set to archived */ + isArchived?: boolean; + /** Boolean determining if the Item is set to draft */ + isDraft?: boolean; + fieldData?: Webflow.CollectionItemWithIdInputFieldData; +} diff --git a/src/api/types/CollectionItemWithIdInputFieldData.ts b/src/api/types/CollectionItemWithIdInputFieldData.ts new file mode 100644 index 00000000..1b528c07 --- /dev/null +++ b/src/api/types/CollectionItemWithIdInputFieldData.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CollectionItemWithIdInputFieldData { + /** Name of the Item */ + name?: string; + /** URL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug. */ + slug?: string; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/types/ConflictErrorBody.ts b/src/api/types/ConflictErrorBody.ts index 83105915..81bcd8d1 100644 --- a/src/api/types/ConflictErrorBody.ts +++ b/src/api/types/ConflictErrorBody.ts @@ -4,13 +4,4 @@ import * as Webflow from "../index"; -export interface ConflictErrorBody { - /** Error code */ - code?: "ecommerce_not_enabled"; - /** Error message */ - message?: string; - /** Link to more information */ - externalReference?: string; - /** Array of errors */ - details?: Webflow.ErrorDetailsItem[]; -} +export type ConflictErrorBody = Webflow.DuplicateUserEmail | undefined | Webflow.UserLimitReached | undefined; diff --git a/src/api/types/CustomCodeBlock.ts b/src/api/types/CustomCodeBlock.ts index c82d6d34..41acef4b 100644 --- a/src/api/types/CustomCodeBlock.ts +++ b/src/api/types/CustomCodeBlock.ts @@ -8,9 +8,9 @@ import * as Webflow from "../index"; * A specific instance of Custom Code applied to a Site or Page */ export interface CustomCodeBlock { - /** The Site id where the custom code was applied */ + /** The Site ID where the custom code was applied */ siteId?: string; - /** The Page id (if applied at Page-level) */ + /** The Page ID (if applied at Page-level) */ pageId?: string; /** Whether the Custom Code script is applied at the Site-level or Page-level */ type?: Webflow.CustomCodeBlockType; diff --git a/src/api/types/DuplicateUserEmail.ts b/src/api/types/DuplicateUserEmail.ts index e714016e..79b2a95b 100644 --- a/src/api/types/DuplicateUserEmail.ts +++ b/src/api/types/DuplicateUserEmail.ts @@ -2,15 +2,4 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Webflow from "../index"; - -export interface DuplicateUserEmail { - /** Error code */ - code?: string; - /** Error message */ - message?: string; - /** Link to more information */ - externalReference?: string; - /** Array of errors */ - details?: Webflow.ErrorDetailsItem[]; -} +export type DuplicateUserEmail = unknown; diff --git a/src/api/types/ErrorCode.ts b/src/api/types/ErrorCode.ts new file mode 100644 index 00000000..209379a8 --- /dev/null +++ b/src/api/types/ErrorCode.ts @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Error code + */ +export type ErrorCode = + | "bad_request" + | "collection_not_found" + | "conflict" + | "duplicate_collection" + | "duplicate_user_email" + | "ecommerce_not_enabled" + | "forbidden" + | "forms_require_republish" + | "incompatible_webhook_filter" + | "internal_error" + | "invalid_auth_version" + | "invalid_credentials" + | "invalid_domain" + | "invalid_user_email" + | "item_not_found" + | "missing_scopes" + | "no_domains" + | "not_authorized" + | "not_enterprise_plan_site" + | "not_enterprise_plan_workspace" + | "order_not_found" + | "resource_not_found" + | "too_many_requests" + | "unsupported_version" + | "unsupported_webhook_trigger_type" + | "user_limit_reached" + | "user_not_found" + | "users_not_enabled" + | "validation_error"; + +export const ErrorCode = { + BadRequest: "bad_request", + CollectionNotFound: "collection_not_found", + Conflict: "conflict", + DuplicateCollection: "duplicate_collection", + DuplicateUserEmail: "duplicate_user_email", + EcommerceNotEnabled: "ecommerce_not_enabled", + Forbidden: "forbidden", + FormsRequireRepublish: "forms_require_republish", + IncompatibleWebhookFilter: "incompatible_webhook_filter", + InternalError: "internal_error", + InvalidAuthVersion: "invalid_auth_version", + InvalidCredentials: "invalid_credentials", + InvalidDomain: "invalid_domain", + InvalidUserEmail: "invalid_user_email", + ItemNotFound: "item_not_found", + MissingScopes: "missing_scopes", + NoDomains: "no_domains", + NotAuthorized: "not_authorized", + NotEnterprisePlanSite: "not_enterprise_plan_site", + NotEnterprisePlanWorkspace: "not_enterprise_plan_workspace", + OrderNotFound: "order_not_found", + ResourceNotFound: "resource_not_found", + TooManyRequests: "too_many_requests", + UnsupportedVersion: "unsupported_version", + UnsupportedWebhookTriggerType: "unsupported_webhook_trigger_type", + UserLimitReached: "user_limit_reached", + UserNotFound: "user_not_found", + UsersNotEnabled: "users_not_enabled", + ValidationError: "validation_error", +} as const; diff --git a/src/api/types/Error_.ts b/src/api/types/Error_.ts index d257bfb4..9a223848 100644 --- a/src/api/types/Error_.ts +++ b/src/api/types/Error_.ts @@ -6,7 +6,7 @@ import * as Webflow from "../index"; export interface Error_ { /** Error code */ - code?: string; + code?: Webflow.ErrorCode; /** Error message */ message?: string; /** Link to more information */ diff --git a/src/api/types/ForbiddenErrorBody.ts b/src/api/types/ForbiddenErrorBody.ts index 636aaef2..73b8f3f9 100644 --- a/src/api/types/ForbiddenErrorBody.ts +++ b/src/api/types/ForbiddenErrorBody.ts @@ -2,10 +2,6 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface ForbiddenErrorBody { - status?: number; - message?: string; - publicErrorCode?: string; - externalReference?: string; - details?: string[]; -} +import * as Webflow from "../index"; + +export type ForbiddenErrorBody = Webflow.InvalidScopes | undefined | Webflow.UsersNotEnabled | undefined; diff --git a/src/api/types/Form.ts b/src/api/types/Form.ts index 52ea2338..ec91d181 100644 --- a/src/api/types/Form.ts +++ b/src/api/types/Form.ts @@ -14,22 +14,22 @@ export interface Form { createdOn?: Date; /** Date that the Form was last updated on */ lastUpdated?: Date; - /** A list of form fields */ - fields?: Webflow.FormField[]; + /** A collection of form field objects */ + fields?: Webflow.FormField; /** Settings for form responses */ responseSettings?: Webflow.FormResponseSettings; - /** The unique id for the Form */ + /** The unique ID for the Form */ id?: string; - /** The unique id of the Site the Form belongs to */ + /** The unique ID of the Site the Form belongs to */ siteId?: string; - /** The unique id corresponding to the site's Domain name */ + /** The unique ID corresponding to the site's Domain name */ siteDomainId?: string; - /** The unique id for the Page on which the Form is placed */ + /** The unique ID for the Page on which the Form is placed */ pageId?: string; /** The user-visible name of the Page where the Form is placed */ pageName?: string; - /** The unique id of the Form element */ + /** The unique ID of the Form element */ formElementId?: string; - /** The unique id of the Workspace the Site belongs to */ + /** The unique ID of the Workspace the Site belongs to */ workspaceId?: string; } diff --git a/src/api/types/FormSubmission.ts b/src/api/types/FormSubmission.ts index 159cf192..a156b7d6 100644 --- a/src/api/types/FormSubmission.ts +++ b/src/api/types/FormSubmission.ts @@ -3,13 +3,13 @@ */ export interface FormSubmission { - /** The unique id of the Form submission */ + /** The unique ID of the Form submission */ id?: string; /** The Form name displayed on the site */ displayName?: string; - /** The unique id of the Site the Form belongs to */ + /** The unique ID of the Site the Form belongs to */ siteId?: string; - /** The unique id of the Workspace the Site belongs to */ + /** The unique ID of the Workspace the Site belongs to */ workspaceId?: string; /** Date that the Form was submitted on */ dateSubmitted?: Date; diff --git a/src/api/types/InvalidScopes.ts b/src/api/types/InvalidScopes.ts new file mode 100644 index 00000000..b389c2bb --- /dev/null +++ b/src/api/types/InvalidScopes.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type InvalidScopes = unknown; diff --git a/src/api/types/MissingScopes.ts b/src/api/types/MissingScopes.ts deleted file mode 100644 index 121a3a27..00000000 --- a/src/api/types/MissingScopes.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Webflow from "../index"; - -export interface MissingScopes { - /** Error code */ - code?: "missing_scopes"; - /** Error message */ - message?: string; - /** Link to more information */ - externalReference?: string; - /** Array of errors */ - details?: Webflow.ErrorDetailsItem[]; -} diff --git a/src/api/types/NotEnterprisePlanSite.ts b/src/api/types/NotEnterprisePlanSite.ts index 23d6c370..20fad119 100644 --- a/src/api/types/NotEnterprisePlanSite.ts +++ b/src/api/types/NotEnterprisePlanSite.ts @@ -2,15 +2,4 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Webflow from "../index"; - -export interface NotEnterprisePlanSite { - /** Error code */ - code?: "missing_scopes"; - /** Error message */ - message?: string; - /** Link to more information */ - externalReference?: string; - /** Array of errors */ - details?: Webflow.ErrorDetailsItem[]; -} +export type NotEnterprisePlanSite = unknown; diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 1ad23709..4f460899 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -5,7 +5,11 @@ import * as Webflow from "../index"; export interface Order { - /** The order id. Will usually be 6 hex characters, but can also be 9 hex characters if the site has a very large number of Orders. Randomly assigned. */ + /** + * The order ID. Will usually be 6 hex characters, but can also be 9 + * hex characters if the site has a very large number of Orders. + * Randomly assigned. + */ orderId?: string; /** The status of the Order */ status?: Webflow.OrderStatus; diff --git a/src/api/types/Page.ts b/src/api/types/Page.ts index 6c02a76b..93268288 100644 --- a/src/api/types/Page.ts +++ b/src/api/types/Page.ts @@ -30,6 +30,8 @@ export interface Page { draft?: boolean; /** Indicates whether the Page supports [Page Branching](https://university.webflow.com/lesson/page-branching) */ canBranch?: boolean; + /** Indicates whether the Page is a Branch of another Page [Page Branching](https://university.webflow.com/lesson/page-branching) */ + isBranch?: boolean; /** Indicates whether the Page is restricted by [Memberships Controls](https://university.webflow.com/lesson/webflow-memberships-overview#how-to-manage-page-restrictions) */ isMembersOnly?: boolean; /** SEO-related fields for the Page */ diff --git a/src/api/types/Site.ts b/src/api/types/Site.ts index 15c053cd..57dcd424 100644 --- a/src/api/types/Site.ts +++ b/src/api/types/Site.ts @@ -27,4 +27,8 @@ export interface Site { parentFolderId?: string; customDomains?: Webflow.Domain[]; locales?: Webflow.Locales; + /** Indicates if data collection is enabled for the site. */ + dataCollectionEnabled?: boolean; + /** The type of data collection enabled for the site. */ + dataCollectionType?: Webflow.SiteDataCollectionType; } diff --git a/src/api/types/SiteActivityLogItem.ts b/src/api/types/SiteActivityLogItem.ts index 4f1a4bb0..36040f5d 100644 --- a/src/api/types/SiteActivityLogItem.ts +++ b/src/api/types/SiteActivityLogItem.ts @@ -8,7 +8,7 @@ export interface SiteActivityLogItem { id?: string; createdOn?: Date; lastUpdated?: Date; - event?: string; + event?: Webflow.SiteActivityLogItemEvent; resourceOperation?: Webflow.SiteActivityLogItemResourceOperation; user?: Webflow.SiteActivityLogItemUser; resourceId?: string; diff --git a/src/api/types/SiteActivityLogItemEvent.ts b/src/api/types/SiteActivityLogItemEvent.ts new file mode 100644 index 00000000..0a996243 --- /dev/null +++ b/src/api/types/SiteActivityLogItemEvent.ts @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SiteActivityLogItemEvent = + | "styles_modified" + | "site_published" + | "ix2_modified_on_page" + | "page_dom_modified" + | "cms_item" + | "backup_created" + | "page_custom_code_modified" + | "symbols_modified" + | "variable_modified" + | "variables_modified" + | "cms_collection" + | "page_settings_modified" + | "page_settings_custom_code_modified" + | "ix2_modified_on_component" + | "ix2_modified_on_class" + | "site_custom_code_modified" + | "page_duplicated" + | "secondary_locale_page_content_modified" + | "page_renamed" + | "page_created" + | "page_deleted" + | "site_unpublished" + | "backup_restored" + | "locale_added" + | "branch_created" + | "locale_display_name_updated" + | "locale_subdirectory_updated" + | "branch_merged" + | "locale_tag_updated" + | "branch_deleted" + | "locale_enabled" + | "locale_removed" + | "locale_disabled" + | "library_shared" + | "library_unshared" + | "library_installed" + | "library_uninstalled" + | "library_update_shared" + | "library_update_accepted" + | "branch_review_created" + | "branch_review_approved" + | "branch_review_canceled"; + +export const SiteActivityLogItemEvent = { + StylesModified: "styles_modified", + SitePublished: "site_published", + Ix2ModifiedOnPage: "ix2_modified_on_page", + PageDomModified: "page_dom_modified", + CmsItem: "cms_item", + BackupCreated: "backup_created", + PageCustomCodeModified: "page_custom_code_modified", + SymbolsModified: "symbols_modified", + VariableModified: "variable_modified", + VariablesModified: "variables_modified", + CmsCollection: "cms_collection", + PageSettingsModified: "page_settings_modified", + PageSettingsCustomCodeModified: "page_settings_custom_code_modified", + Ix2ModifiedOnComponent: "ix2_modified_on_component", + Ix2ModifiedOnClass: "ix2_modified_on_class", + SiteCustomCodeModified: "site_custom_code_modified", + PageDuplicated: "page_duplicated", + SecondaryLocalePageContentModified: "secondary_locale_page_content_modified", + PageRenamed: "page_renamed", + PageCreated: "page_created", + PageDeleted: "page_deleted", + SiteUnpublished: "site_unpublished", + BackupRestored: "backup_restored", + LocaleAdded: "locale_added", + BranchCreated: "branch_created", + LocaleDisplayNameUpdated: "locale_display_name_updated", + LocaleSubdirectoryUpdated: "locale_subdirectory_updated", + BranchMerged: "branch_merged", + LocaleTagUpdated: "locale_tag_updated", + BranchDeleted: "branch_deleted", + LocaleEnabled: "locale_enabled", + LocaleRemoved: "locale_removed", + LocaleDisabled: "locale_disabled", + LibraryShared: "library_shared", + LibraryUnshared: "library_unshared", + LibraryInstalled: "library_installed", + LibraryUninstalled: "library_uninstalled", + LibraryUpdateShared: "library_update_shared", + LibraryUpdateAccepted: "library_update_accepted", + BranchReviewCreated: "branch_review_created", + BranchReviewApproved: "branch_review_approved", + BranchReviewCanceled: "branch_review_canceled", +} as const; diff --git a/src/api/types/SiteActivityLogItemResourceOperation.ts b/src/api/types/SiteActivityLogItemResourceOperation.ts index 77ebc3c3..1ab8629f 100644 --- a/src/api/types/SiteActivityLogItemResourceOperation.ts +++ b/src/api/types/SiteActivityLogItemResourceOperation.ts @@ -2,7 +2,16 @@ * This file was auto-generated by Fern from our API Definition. */ -export type SiteActivityLogItemResourceOperation = "CREATED" | "MODIFIED" | "PUBLISHED" | "UNPUBLISHED" | "DELETED"; +export type SiteActivityLogItemResourceOperation = + | "CREATED" + | "MODIFIED" + | "PUBLISHED" + | "UNPUBLISHED" + | "DELETED" + | "GROUP_REORDERED" + | "GROUP_CREATED" + | "GROUP_DELETED" + | "REORDERED"; export const SiteActivityLogItemResourceOperation = { Created: "CREATED", @@ -10,4 +19,8 @@ export const SiteActivityLogItemResourceOperation = { Published: "PUBLISHED", Unpublished: "UNPUBLISHED", Deleted: "DELETED", + GroupReordered: "GROUP_REORDERED", + GroupCreated: "GROUP_CREATED", + GroupDeleted: "GROUP_DELETED", + Reordered: "REORDERED", } as const; diff --git a/src/api/types/SiteDataCollectionType.ts b/src/api/types/SiteDataCollectionType.ts new file mode 100644 index 00000000..14ad3453 --- /dev/null +++ b/src/api/types/SiteDataCollectionType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The type of data collection enabled for the site. + */ +export type SiteDataCollectionType = "always" | "optOut" | "disabled"; + +export const SiteDataCollectionType = { + Always: "always", + OptOut: "optOut", + Disabled: "disabled", +} as const; diff --git a/src/api/types/TooManyRequestsErrorBody.ts b/src/api/types/TooManyRequestsErrorBody.ts deleted file mode 100644 index bda6fafb..00000000 --- a/src/api/types/TooManyRequestsErrorBody.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface TooManyRequestsErrorBody { - message?: string; - code?: string; - externalReference?: string; - details?: unknown[]; -} diff --git a/src/api/types/UserLimitReached.ts b/src/api/types/UserLimitReached.ts index 8e614bdd..ca77b2b9 100644 --- a/src/api/types/UserLimitReached.ts +++ b/src/api/types/UserLimitReached.ts @@ -2,15 +2,4 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Webflow from "../index"; - -export interface UserLimitReached { - /** Error code */ - code?: string; - /** Error message */ - message?: string; - /** Link to more information */ - externalReference?: string; - /** Array of errors */ - details?: Webflow.ErrorDetailsItem[]; -} +export type UserLimitReached = unknown; diff --git a/src/api/types/UsersNotEnabled.ts b/src/api/types/UsersNotEnabled.ts index aa1d20a2..fe129bc3 100644 --- a/src/api/types/UsersNotEnabled.ts +++ b/src/api/types/UsersNotEnabled.ts @@ -2,15 +2,4 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Webflow from "../index"; - -export interface UsersNotEnabled { - /** Error code */ - code?: string; - /** Error message */ - message?: string; - /** Link to more information */ - externalReference?: string; - /** Array of errors */ - details?: Webflow.ErrorDetailsItem[]; -} +export type UsersNotEnabled = unknown; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 1e6ee2ff..e2f02c81 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,9 +1,10 @@ -export * from "./ForbiddenErrorBody"; -export * from "./TooManyRequestsErrorBody"; export * from "./BadRequestErrorBody"; +export * from "./ForbiddenErrorBody"; export * from "./ConflictErrorBody"; -export * from "./ErrorDetailsItem"; export * from "./AuthorizedUser"; +export * from "./ErrorCode"; +export * from "./ErrorDetailsItem"; +export * from "./Error_"; export * from "./Application"; export * from "./AuthorizationAuthorizationAuthorizedTo"; export * from "./AuthorizationAuthorization"; @@ -11,18 +12,19 @@ export * from "./Authorization"; export * from "./Domain"; export * from "./Locale"; export * from "./Locales"; +export * from "./SiteDataCollectionType"; export * from "./Site"; export * from "./Sites"; export * from "./Domains"; export * from "./InvalidDomain"; export * from "./NoDomains"; +export * from "./SiteActivityLogItemEvent"; export * from "./SiteActivityLogItemResourceOperation"; export * from "./SiteActivityLogItemUser"; export * from "./SiteActivityLogItem"; export * from "./Pagination"; export * from "./SiteActivityLogResponse"; -export * from "./Error_"; -export * from "./MissingScopes"; +export * from "./InvalidScopes"; export * from "./NotEnterprisePlanSite"; export * from "./CollectionListArrayItem"; export * from "./CollectionList"; @@ -33,6 +35,9 @@ export * from "./CollectionItemFieldData"; export * from "./CollectionItem"; export * from "./CollectionItemListPagination"; export * from "./CollectionItemList"; +export * from "./CollectionItemWithIdInputFieldData"; +export * from "./CollectionItemWithIdInput"; +export * from "./CollectionItemListNoPagination"; export * from "./BulkCollectionItemFieldData"; export * from "./BulkCollectionItem"; export * from "./PageSeo"; @@ -130,4 +135,3 @@ export * from "./OrderList"; export * from "./InventoryItemInventoryType"; export * from "./InventoryItem"; export * from "./EcommerceSettings"; -export * from "./OAuthScope"; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index d67bc042..b8f23717 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/src/core/fetcher/getResponseBody.ts b/src/core/fetcher/getResponseBody.ts index a7a9c508..d046e6ea 100644 --- a/src/core/fetcher/getResponseBody.ts +++ b/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index ff5dc3bb..8d5af9d5 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -1,6 +1,13 @@ -const INITIAL_RETRY_DELAY = 1; -const MAX_RETRY_DELAY = 60; +const INITIAL_RETRY_DELAY = 1000; // in milliseconds +const MAX_RETRY_DELAY = 60000; // in milliseconds const DEFAULT_MAX_RETRIES = 2; +const JITTER_FACTOR = 0.2; // 20% random jitter + +function addJitter(delay: number): number { + // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR + const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR; + return delay * jitterMultiplier; +} export async function requestWithRetries( requestFn: () => Promise, @@ -10,8 +17,13 @@ export async function requestWithRetries( for (let i = 0; i < maxRetries; ++i) { if ([408, 409, 429].includes(response.status) || response.status >= 500) { - const delay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY); - await new Promise((resolve) => setTimeout(resolve, delay)); + // Calculate base delay using exponential backoff (in milliseconds) + const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY); + + // Add jitter to the delay + const delayWithJitter = addJitter(baseDelay); + + await new Promise((resolve) => setTimeout(resolve, delayWithJitter)); response = await requestFn(); } else { break; diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts index e00136d7..8d40c33c 100644 --- a/src/core/schemas/builders/object/object.ts +++ b/src/core/schemas/builders/object/object.ts @@ -260,6 +260,47 @@ export function getObjectUtils(schema: BaseObjectSchema SchemaType.OBJECT, }; + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + ...getObjectUtils(baseSchema), + }; + }, + passthrough: () => { + const baseSchema: BaseObjectSchema = + { + _getParsedProperties: () => schema._getParsedProperties(), + _getRawProperties: () => schema._getRawProperties(), + parse: (raw, opts) => { + const transformed = schema.parse(raw, { ...opts, unrecognizedObjectKeys: "passthrough" }); + if (!transformed.ok) { + return transformed; + } + return { + ok: true, + value: { + ...(raw as any), + ...transformed.value, + }, + }; + }, + json: (parsed, opts) => { + const transformed = schema.json(parsed, { ...opts, unrecognizedObjectKeys: "passthrough" }); + if (!transformed.ok) { + return transformed; + } + return { + ok: true, + value: { + ...(parsed as any), + ...transformed.value, + }, + }; + }, + getType: () => SchemaType.OBJECT, + }; + return { ...baseSchema, ...getSchemaUtils(baseSchema), diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts index de9bb407..9f87cbb7 100644 --- a/src/core/schemas/builders/object/types.ts +++ b/src/core/schemas/builders/object/types.ts @@ -18,6 +18,7 @@ export interface ObjectUtils { extend: ( schemas: ObjectSchema ) => ObjectSchema; + passthrough: () => ObjectSchema; } export type inferRawObject> = O extends ObjectSchema ? Raw : never; diff --git a/src/errors/WebflowTimeoutError.ts b/src/errors/WebflowTimeoutError.ts index 7e16b05e..40bd92c0 100644 --- a/src/errors/WebflowTimeoutError.ts +++ b/src/errors/WebflowTimeoutError.ts @@ -3,8 +3,8 @@ */ export class WebflowTimeoutError extends Error { - constructor() { - super("Timeout"); + constructor(message: string) { + super(message); Object.setPrototypeOf(this, WebflowTimeoutError.prototype); } } diff --git a/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts b/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts index 2ceb794f..d9907f60 100644 --- a/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts +++ b/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts @@ -10,11 +10,13 @@ export const AssetsUpdateRequest: core.serialization.Schema< serializers.AssetsUpdateRequest.Raw, Webflow.AssetsUpdateRequest > = core.serialization.object({ - displayName: core.serialization.string(), + localeId: core.serialization.string().optional(), + displayName: core.serialization.string().optional(), }); export declare namespace AssetsUpdateRequest { interface Raw { - displayName: string; + localeId?: string | null; + displayName?: string | null; } } diff --git a/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts b/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts new file mode 100644 index 00000000..ce3b3841 --- /dev/null +++ b/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; +import * as core from "../../../../../../../core"; +import { CreateBulkCollectionItemRequestBodyFieldData } from "../../types/CreateBulkCollectionItemRequestBodyFieldData"; + +export const CreateBulkCollectionItemRequestBody: core.serialization.Schema< + serializers.collections.CreateBulkCollectionItemRequestBody.Raw, + Webflow.collections.CreateBulkCollectionItemRequestBody +> = core.serialization.object({ + cmsLocaleIds: core.serialization.list(core.serialization.string()).optional(), + isArchived: core.serialization.boolean().optional(), + isDraft: core.serialization.boolean().optional(), + fieldData: CreateBulkCollectionItemRequestBodyFieldData.optional(), +}); + +export declare namespace CreateBulkCollectionItemRequestBody { + interface Raw { + cmsLocaleIds?: string[] | null; + isArchived?: boolean | null; + isDraft?: boolean | null; + fieldData?: CreateBulkCollectionItemRequestBodyFieldData.Raw | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts new file mode 100644 index 00000000..cb601ac2 --- /dev/null +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; +import * as core from "../../../../../../../core"; +import { ItemsDeleteItemsLiveRequestItemsItem } from "../../types/ItemsDeleteItemsLiveRequestItemsItem"; + +export const ItemsDeleteItemsLiveRequest: core.serialization.Schema< + serializers.collections.ItemsDeleteItemsLiveRequest.Raw, + Webflow.collections.ItemsDeleteItemsLiveRequest +> = core.serialization.object({ + items: core.serialization.list(ItemsDeleteItemsLiveRequestItemsItem).optional(), +}); + +export declare namespace ItemsDeleteItemsLiveRequest { + interface Raw { + items?: ItemsDeleteItemsLiveRequestItemsItem.Raw[] | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts new file mode 100644 index 00000000..28d2785c --- /dev/null +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; +import * as core from "../../../../../../../core"; +import { ItemsDeleteItemsRequestItemsItem } from "../../types/ItemsDeleteItemsRequestItemsItem"; + +export const ItemsDeleteItemsRequest: core.serialization.Schema< + serializers.collections.ItemsDeleteItemsRequest.Raw, + Webflow.collections.ItemsDeleteItemsRequest +> = core.serialization.object({ + items: core.serialization.list(ItemsDeleteItemsRequestItemsItem).optional(), +}); + +export declare namespace ItemsDeleteItemsRequest { + interface Raw { + items?: ItemsDeleteItemsRequestItemsItem.Raw[] | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts new file mode 100644 index 00000000..fe7d996d --- /dev/null +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; +import * as core from "../../../../../../../core"; +import { CollectionItemWithIdInput } from "../../../../../../types/CollectionItemWithIdInput"; + +export const ItemsUpdateItemsLiveRequest: core.serialization.Schema< + serializers.collections.ItemsUpdateItemsLiveRequest.Raw, + Webflow.collections.ItemsUpdateItemsLiveRequest +> = core.serialization.object({ + items: core.serialization.list(CollectionItemWithIdInput).optional(), +}); + +export declare namespace ItemsUpdateItemsLiveRequest { + interface Raw { + items?: CollectionItemWithIdInput.Raw[] | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts new file mode 100644 index 00000000..f96719f1 --- /dev/null +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; +import * as core from "../../../../../../../core"; +import { CollectionItemWithIdInput } from "../../../../../../types/CollectionItemWithIdInput"; + +export const ItemsUpdateItemsRequest: core.serialization.Schema< + serializers.collections.ItemsUpdateItemsRequest.Raw, + Webflow.collections.ItemsUpdateItemsRequest +> = core.serialization.object({ + items: core.serialization.list(CollectionItemWithIdInput).optional(), +}); + +export declare namespace ItemsUpdateItemsRequest { + interface Raw { + items?: CollectionItemWithIdInput.Raw[] | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/client/requests/index.ts b/src/serialization/resources/collections/resources/items/client/requests/index.ts index a1b783c7..c76caf92 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/index.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/index.ts @@ -1 +1,6 @@ +export { ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; +export { ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; +export { ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; +export { ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; +export { CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; export { ItemsPublishItemRequest } from "./ItemsPublishItemRequest"; diff --git a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts new file mode 100644 index 00000000..c4ca1aba --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; +import { CreateBulkCollectionItemRequestBodyFieldDataName } from "./CreateBulkCollectionItemRequestBodyFieldDataName"; +import { CreateBulkCollectionItemRequestBodyFieldDataItem } from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; + +export const CreateBulkCollectionItemRequestBodyFieldData: core.serialization.Schema< + serializers.collections.CreateBulkCollectionItemRequestBodyFieldData.Raw, + Webflow.collections.CreateBulkCollectionItemRequestBodyFieldData +> = core.serialization.undiscriminatedUnion([ + CreateBulkCollectionItemRequestBodyFieldDataName, + core.serialization.list(CreateBulkCollectionItemRequestBodyFieldDataItem), +]); + +export declare namespace CreateBulkCollectionItemRequestBodyFieldData { + type Raw = + | CreateBulkCollectionItemRequestBodyFieldDataName.Raw + | CreateBulkCollectionItemRequestBodyFieldDataItem.Raw[]; +} diff --git a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts new file mode 100644 index 00000000..45807d57 --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const CreateBulkCollectionItemRequestBodyFieldDataItem: core.serialization.ObjectSchema< + serializers.collections.CreateBulkCollectionItemRequestBodyFieldDataItem.Raw, + Webflow.collections.CreateBulkCollectionItemRequestBodyFieldDataItem +> = core.serialization + .object({ + name: core.serialization.string(), + slug: core.serialization.string(), + }) + .passthrough(); + +export declare namespace CreateBulkCollectionItemRequestBodyFieldDataItem { + interface Raw { + name: string; + slug: string; + [key: string]: any; + } +} diff --git a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.ts b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.ts new file mode 100644 index 00000000..955e2086 --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataName.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; + +export const CreateBulkCollectionItemRequestBodyFieldDataName: core.serialization.ObjectSchema< + serializers.collections.CreateBulkCollectionItemRequestBodyFieldDataName.Raw, + Webflow.collections.CreateBulkCollectionItemRequestBodyFieldDataName +> = core.serialization + .object({ + name: core.serialization.string(), + slug: core.serialization.string(), + }) + .passthrough(); + +export declare namespace CreateBulkCollectionItemRequestBodyFieldDataName { + interface Raw { + name: string; + slug: string; + [key: string]: any; + } +} diff --git a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.ts b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.ts new file mode 100644 index 00000000..ce34ebc7 --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; +import { CollectionItem } from "../../../../../types/CollectionItem"; +import { ItemsCreateItemLiveRequestItems } from "./ItemsCreateItemLiveRequestItems"; + +export const ItemsCreateItemLiveRequest: core.serialization.Schema< + serializers.collections.ItemsCreateItemLiveRequest.Raw, + Webflow.collections.ItemsCreateItemLiveRequest +> = core.serialization.undiscriminatedUnion([CollectionItem, ItemsCreateItemLiveRequestItems]); + +export declare namespace ItemsCreateItemLiveRequest { + type Raw = CollectionItem.Raw | ItemsCreateItemLiveRequestItems.Raw; +} diff --git a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.ts b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.ts new file mode 100644 index 00000000..b52f56a5 --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestItems.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; +import { CollectionItem } from "../../../../../types/CollectionItem"; + +export const ItemsCreateItemLiveRequestItems: core.serialization.ObjectSchema< + serializers.collections.ItemsCreateItemLiveRequestItems.Raw, + Webflow.collections.ItemsCreateItemLiveRequestItems +> = core.serialization.object({ + items: core.serialization.list(CollectionItem).optional(), +}); + +export declare namespace ItemsCreateItemLiveRequestItems { + interface Raw { + items?: CollectionItem.Raw[] | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequest.ts b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequest.ts new file mode 100644 index 00000000..9e300c4c --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; +import { CollectionItem } from "../../../../../types/CollectionItem"; +import { ItemsCreateItemRequestItems } from "./ItemsCreateItemRequestItems"; + +export const ItemsCreateItemRequest: core.serialization.Schema< + serializers.collections.ItemsCreateItemRequest.Raw, + Webflow.collections.ItemsCreateItemRequest +> = core.serialization.undiscriminatedUnion([CollectionItem, ItemsCreateItemRequestItems]); + +export declare namespace ItemsCreateItemRequest { + type Raw = CollectionItem.Raw | ItemsCreateItemRequestItems.Raw; +} diff --git a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestItems.ts b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestItems.ts new file mode 100644 index 00000000..971df0ca --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestItems.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; +import * as core from "../../../../../../core"; +import { CollectionItem } from "../../../../../types/CollectionItem"; + +export const ItemsCreateItemRequestItems: core.serialization.ObjectSchema< + serializers.collections.ItemsCreateItemRequestItems.Raw, + Webflow.collections.ItemsCreateItemRequestItems +> = core.serialization.object({ + items: core.serialization.list(CollectionItem).optional(), +}); + +export declare namespace ItemsCreateItemRequestItems { + interface Raw { + items?: CollectionItem.Raw[] | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts new file mode 100644 index 00000000..5bb4a2da --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts @@ -0,0 +1,22 @@ +/** + * 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 ItemsDeleteItemsLiveRequestItemsItem: core.serialization.ObjectSchema< + serializers.collections.ItemsDeleteItemsLiveRequestItemsItem.Raw, + Webflow.collections.ItemsDeleteItemsLiveRequestItemsItem +> = core.serialization.object({ + itemId: core.serialization.string(), + cmsLocaleIds: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ItemsDeleteItemsLiveRequestItemsItem { + interface Raw { + itemId: string; + cmsLocaleIds?: string[] | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts new file mode 100644 index 00000000..523d0ca5 --- /dev/null +++ b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts @@ -0,0 +1,22 @@ +/** + * 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 ItemsDeleteItemsRequestItemsItem: core.serialization.ObjectSchema< + serializers.collections.ItemsDeleteItemsRequestItemsItem.Raw, + Webflow.collections.ItemsDeleteItemsRequestItemsItem +> = core.serialization.object({ + id: core.serialization.string(), + cmsLocaleIds: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ItemsDeleteItemsRequestItemsItem { + interface Raw { + id: string; + cmsLocaleIds?: string[] | null; + } +} diff --git a/src/serialization/resources/collections/resources/items/types/index.ts b/src/serialization/resources/collections/resources/items/types/index.ts index dce8a6ed..be18fc71 100644 --- a/src/serialization/resources/collections/resources/items/types/index.ts +++ b/src/serialization/resources/collections/resources/items/types/index.ts @@ -1,5 +1,14 @@ export * from "./ItemsListItemsRequestSortBy"; export * from "./ItemsListItemsRequestSortOrder"; +export * from "./ItemsCreateItemRequestItems"; +export * from "./ItemsCreateItemRequest"; +export * from "./ItemsDeleteItemsRequestItemsItem"; export * from "./ItemsListItemsLiveRequestSortBy"; export * from "./ItemsListItemsLiveRequestSortOrder"; +export * from "./ItemsCreateItemLiveRequestItems"; +export * from "./ItemsCreateItemLiveRequest"; +export * from "./ItemsDeleteItemsLiveRequestItemsItem"; +export * from "./CreateBulkCollectionItemRequestBodyFieldDataName"; +export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; +export * from "./CreateBulkCollectionItemRequestBodyFieldData"; export * from "./ItemsPublishItemResponse"; diff --git a/src/serialization/resources/pages/client/requests/DomWrite.ts b/src/serialization/resources/pages/client/requests/DomWrite.ts index 0c67e0f4..7ec432f7 100644 --- a/src/serialization/resources/pages/client/requests/DomWrite.ts +++ b/src/serialization/resources/pages/client/requests/DomWrite.ts @@ -9,7 +9,7 @@ import { DomWriteNodesItem } from "../../types/DomWriteNodesItem"; export const DomWrite: core.serialization.Schema< serializers.DomWrite.Raw, - Omit + Omit > = core.serialization.object({ nodes: core.serialization.list(DomWriteNodesItem), }); diff --git a/src/serialization/types/BulkCollectionItemFieldData.ts b/src/serialization/types/BulkCollectionItemFieldData.ts index d4486017..0de77420 100644 --- a/src/serialization/types/BulkCollectionItemFieldData.ts +++ b/src/serialization/types/BulkCollectionItemFieldData.ts @@ -9,10 +9,12 @@ import * as core from "../../core"; export const BulkCollectionItemFieldData: core.serialization.ObjectSchema< serializers.BulkCollectionItemFieldData.Raw, Webflow.BulkCollectionItemFieldData -> = core.serialization.object({ - name: core.serialization.string().optional(), - slug: core.serialization.string().optional(), -}); +> = core.serialization + .object({ + name: core.serialization.string().optional(), + slug: core.serialization.string().optional(), + }) + .passthrough(); export declare namespace BulkCollectionItemFieldData { interface Raw { diff --git a/src/serialization/types/CollectionItemFieldData.ts b/src/serialization/types/CollectionItemFieldData.ts index 383dfeb0..3c0f0e04 100644 --- a/src/serialization/types/CollectionItemFieldData.ts +++ b/src/serialization/types/CollectionItemFieldData.ts @@ -9,10 +9,12 @@ import * as core from "../../core"; export const CollectionItemFieldData: core.serialization.ObjectSchema< serializers.CollectionItemFieldData.Raw, Webflow.CollectionItemFieldData -> = core.serialization.object({ - name: core.serialization.string().optional(), - slug: core.serialization.string().optional(), -}); +> = core.serialization + .object({ + name: core.serialization.string().optional(), + slug: core.serialization.string().optional(), + }) + .passthrough(); export declare namespace CollectionItemFieldData { interface Raw { diff --git a/src/serialization/types/CollectionItemListNoPagination.ts b/src/serialization/types/CollectionItemListNoPagination.ts new file mode 100644 index 00000000..3f401159 --- /dev/null +++ b/src/serialization/types/CollectionItemListNoPagination.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { CollectionItem } from "./CollectionItem"; + +export const CollectionItemListNoPagination: core.serialization.ObjectSchema< + serializers.CollectionItemListNoPagination.Raw, + Webflow.CollectionItemListNoPagination +> = core.serialization.object({ + items: core.serialization.list(CollectionItem).optional(), +}); + +export declare namespace CollectionItemListNoPagination { + interface Raw { + items?: CollectionItem.Raw[] | null; + } +} diff --git a/src/serialization/types/CollectionItemWithIdInput.ts b/src/serialization/types/CollectionItemWithIdInput.ts new file mode 100644 index 00000000..4c919516 --- /dev/null +++ b/src/serialization/types/CollectionItemWithIdInput.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { CollectionItemWithIdInputFieldData } from "./CollectionItemWithIdInputFieldData"; + +export const CollectionItemWithIdInput: core.serialization.ObjectSchema< + serializers.CollectionItemWithIdInput.Raw, + Webflow.CollectionItemWithIdInput +> = core.serialization.object({ + id: core.serialization.string(), + cmsLocaleId: core.serialization.string().optional(), + lastPublished: core.serialization.string().optional(), + lastUpdated: core.serialization.string().optional(), + createdOn: core.serialization.string().optional(), + isArchived: core.serialization.boolean().optional(), + isDraft: core.serialization.boolean().optional(), + fieldData: CollectionItemWithIdInputFieldData.optional(), +}); + +export declare namespace CollectionItemWithIdInput { + interface Raw { + id: string; + cmsLocaleId?: string | null; + lastPublished?: string | null; + lastUpdated?: string | null; + createdOn?: string | null; + isArchived?: boolean | null; + isDraft?: boolean | null; + fieldData?: CollectionItemWithIdInputFieldData.Raw | null; + } +} diff --git a/src/serialization/types/CollectionItemWithIdInputFieldData.ts b/src/serialization/types/CollectionItemWithIdInputFieldData.ts new file mode 100644 index 00000000..8c749e76 --- /dev/null +++ b/src/serialization/types/CollectionItemWithIdInputFieldData.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const CollectionItemWithIdInputFieldData: core.serialization.ObjectSchema< + serializers.CollectionItemWithIdInputFieldData.Raw, + Webflow.CollectionItemWithIdInputFieldData +> = core.serialization + .object({ + name: core.serialization.string().optional(), + slug: core.serialization.string().optional(), + }) + .passthrough(); + +export declare namespace CollectionItemWithIdInputFieldData { + interface Raw { + name?: string | null; + slug?: string | null; + [key: string]: any; + } +} diff --git a/src/serialization/types/ConflictErrorBody.ts b/src/serialization/types/ConflictErrorBody.ts index b5050c4a..4148ae4a 100644 --- a/src/serialization/types/ConflictErrorBody.ts +++ b/src/serialization/types/ConflictErrorBody.ts @@ -5,23 +5,14 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; -import { ErrorDetailsItem } from "./ErrorDetailsItem"; +import { DuplicateUserEmail } from "./DuplicateUserEmail"; +import { UserLimitReached } from "./UserLimitReached"; -export const ConflictErrorBody: core.serialization.ObjectSchema< +export const ConflictErrorBody: core.serialization.Schema< serializers.ConflictErrorBody.Raw, Webflow.ConflictErrorBody -> = core.serialization.object({ - code: core.serialization.stringLiteral("ecommerce_not_enabled").optional(), - message: core.serialization.string().optional(), - externalReference: core.serialization.string().optional(), - details: core.serialization.list(ErrorDetailsItem).optional(), -}); +> = core.serialization.undiscriminatedUnion([DuplicateUserEmail, UserLimitReached]); export declare namespace ConflictErrorBody { - interface Raw { - code?: "ecommerce_not_enabled" | null; - message?: string | null; - externalReference?: string | null; - details?: ErrorDetailsItem.Raw[] | null; - } + type Raw = (DuplicateUserEmail.Raw | undefined) | (UserLimitReached.Raw | undefined); } diff --git a/src/serialization/types/DuplicateUserEmail.ts b/src/serialization/types/DuplicateUserEmail.ts index 6f083835..a3e15d4a 100644 --- a/src/serialization/types/DuplicateUserEmail.ts +++ b/src/serialization/types/DuplicateUserEmail.ts @@ -5,23 +5,12 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; -import { ErrorDetailsItem } from "./ErrorDetailsItem"; -export const DuplicateUserEmail: core.serialization.ObjectSchema< +export const DuplicateUserEmail: core.serialization.Schema< serializers.DuplicateUserEmail.Raw, Webflow.DuplicateUserEmail -> = core.serialization.object({ - code: core.serialization.string().optional(), - message: core.serialization.string().optional(), - externalReference: core.serialization.string().optional(), - details: core.serialization.list(ErrorDetailsItem).optional(), -}); +> = core.serialization.unknown(); export declare namespace DuplicateUserEmail { - interface Raw { - code?: string | null; - message?: string | null; - externalReference?: string | null; - details?: ErrorDetailsItem.Raw[] | null; - } + type Raw = unknown; } diff --git a/src/serialization/types/ErrorCode.ts b/src/serialization/types/ErrorCode.ts new file mode 100644 index 00000000..6e99e6e5 --- /dev/null +++ b/src/serialization/types/ErrorCode.ts @@ -0,0 +1,73 @@ +/** + * 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 ErrorCode: core.serialization.Schema = + core.serialization.enum_([ + "bad_request", + "collection_not_found", + "conflict", + "duplicate_collection", + "duplicate_user_email", + "ecommerce_not_enabled", + "forbidden", + "forms_require_republish", + "incompatible_webhook_filter", + "internal_error", + "invalid_auth_version", + "invalid_credentials", + "invalid_domain", + "invalid_user_email", + "item_not_found", + "missing_scopes", + "no_domains", + "not_authorized", + "not_enterprise_plan_site", + "not_enterprise_plan_workspace", + "order_not_found", + "resource_not_found", + "too_many_requests", + "unsupported_version", + "unsupported_webhook_trigger_type", + "user_limit_reached", + "user_not_found", + "users_not_enabled", + "validation_error", + ]); + +export declare namespace ErrorCode { + type Raw = + | "bad_request" + | "collection_not_found" + | "conflict" + | "duplicate_collection" + | "duplicate_user_email" + | "ecommerce_not_enabled" + | "forbidden" + | "forms_require_republish" + | "incompatible_webhook_filter" + | "internal_error" + | "invalid_auth_version" + | "invalid_credentials" + | "invalid_domain" + | "invalid_user_email" + | "item_not_found" + | "missing_scopes" + | "no_domains" + | "not_authorized" + | "not_enterprise_plan_site" + | "not_enterprise_plan_workspace" + | "order_not_found" + | "resource_not_found" + | "too_many_requests" + | "unsupported_version" + | "unsupported_webhook_trigger_type" + | "user_limit_reached" + | "user_not_found" + | "users_not_enabled" + | "validation_error"; +} diff --git a/src/serialization/types/Error_.ts b/src/serialization/types/Error_.ts index 7bc5df26..604d9399 100644 --- a/src/serialization/types/Error_.ts +++ b/src/serialization/types/Error_.ts @@ -5,11 +5,12 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; +import { ErrorCode } from "./ErrorCode"; import { ErrorDetailsItem } from "./ErrorDetailsItem"; export const Error_: core.serialization.ObjectSchema = core.serialization.object({ - code: core.serialization.string().optional(), + code: ErrorCode.optional(), message: core.serialization.string().optional(), externalReference: core.serialization.string().optional(), details: core.serialization.list(ErrorDetailsItem).optional(), @@ -17,7 +18,7 @@ export const Error_: core.serialization.ObjectSchema = core.serialization.object({ - status: core.serialization.number().optional(), - message: core.serialization.string().optional(), - publicErrorCode: core.serialization.string().optional(), - externalReference: core.serialization.string().optional(), - details: core.serialization.list(core.serialization.string()).optional(), -}); +> = core.serialization.undiscriminatedUnion([InvalidScopes, UsersNotEnabled]); export declare namespace ForbiddenErrorBody { - interface Raw { - status?: number | null; - message?: string | null; - publicErrorCode?: string | null; - externalReference?: string | null; - details?: string[] | null; - } + type Raw = (InvalidScopes.Raw | undefined) | (UsersNotEnabled.Raw | undefined); } diff --git a/src/serialization/types/Form.ts b/src/serialization/types/Form.ts index 084d23c2..f99bd6ba 100644 --- a/src/serialization/types/Form.ts +++ b/src/serialization/types/Form.ts @@ -13,7 +13,7 @@ export const Form: core.serialization.ObjectSchema = + core.serialization.unknown(); + +export declare namespace InvalidScopes { + type Raw = unknown; +} diff --git a/src/serialization/types/MissingScopes.ts b/src/serialization/types/MissingScopes.ts deleted file mode 100644 index cb217762..00000000 --- a/src/serialization/types/MissingScopes.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; -import * as core from "../../core"; -import { ErrorDetailsItem } from "./ErrorDetailsItem"; - -export const MissingScopes: core.serialization.ObjectSchema = - core.serialization.object({ - code: core.serialization.stringLiteral("missing_scopes").optional(), - message: core.serialization.string().optional(), - externalReference: core.serialization.string().optional(), - details: core.serialization.list(ErrorDetailsItem).optional(), - }); - -export declare namespace MissingScopes { - interface Raw { - code?: "missing_scopes" | null; - message?: string | null; - externalReference?: string | null; - details?: ErrorDetailsItem.Raw[] | null; - } -} diff --git a/src/serialization/types/NotEnterprisePlanSite.ts b/src/serialization/types/NotEnterprisePlanSite.ts index 98d40890..e394ffbe 100644 --- a/src/serialization/types/NotEnterprisePlanSite.ts +++ b/src/serialization/types/NotEnterprisePlanSite.ts @@ -5,23 +5,12 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; -import { ErrorDetailsItem } from "./ErrorDetailsItem"; -export const NotEnterprisePlanSite: core.serialization.ObjectSchema< +export const NotEnterprisePlanSite: core.serialization.Schema< serializers.NotEnterprisePlanSite.Raw, Webflow.NotEnterprisePlanSite -> = core.serialization.object({ - code: core.serialization.stringLiteral("missing_scopes").optional(), - message: core.serialization.string().optional(), - externalReference: core.serialization.string().optional(), - details: core.serialization.list(ErrorDetailsItem).optional(), -}); +> = core.serialization.unknown(); export declare namespace NotEnterprisePlanSite { - interface Raw { - code?: "missing_scopes" | null; - message?: string | null; - externalReference?: string | null; - details?: ErrorDetailsItem.Raw[] | null; - } + type Raw = unknown; } diff --git a/src/serialization/types/Page.ts b/src/serialization/types/Page.ts index 0d6d46cd..9d7b9850 100644 --- a/src/serialization/types/Page.ts +++ b/src/serialization/types/Page.ts @@ -20,6 +20,7 @@ export const Page: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string(), @@ -21,6 +22,8 @@ export const Site: core.serialization.ObjectSchema = core.serialization.enum_([ + "styles_modified", + "site_published", + "ix2_modified_on_page", + "page_dom_modified", + "cms_item", + "backup_created", + "page_custom_code_modified", + "symbols_modified", + "variable_modified", + "variables_modified", + "cms_collection", + "page_settings_modified", + "page_settings_custom_code_modified", + "ix2_modified_on_component", + "ix2_modified_on_class", + "site_custom_code_modified", + "page_duplicated", + "secondary_locale_page_content_modified", + "page_renamed", + "page_created", + "page_deleted", + "site_unpublished", + "backup_restored", + "locale_added", + "branch_created", + "locale_display_name_updated", + "locale_subdirectory_updated", + "branch_merged", + "locale_tag_updated", + "branch_deleted", + "locale_enabled", + "locale_removed", + "locale_disabled", + "library_shared", + "library_unshared", + "library_installed", + "library_uninstalled", + "library_update_shared", + "library_update_accepted", + "branch_review_created", + "branch_review_approved", + "branch_review_canceled", +]); + +export declare namespace SiteActivityLogItemEvent { + type Raw = + | "styles_modified" + | "site_published" + | "ix2_modified_on_page" + | "page_dom_modified" + | "cms_item" + | "backup_created" + | "page_custom_code_modified" + | "symbols_modified" + | "variable_modified" + | "variables_modified" + | "cms_collection" + | "page_settings_modified" + | "page_settings_custom_code_modified" + | "ix2_modified_on_component" + | "ix2_modified_on_class" + | "site_custom_code_modified" + | "page_duplicated" + | "secondary_locale_page_content_modified" + | "page_renamed" + | "page_created" + | "page_deleted" + | "site_unpublished" + | "backup_restored" + | "locale_added" + | "branch_created" + | "locale_display_name_updated" + | "locale_subdirectory_updated" + | "branch_merged" + | "locale_tag_updated" + | "branch_deleted" + | "locale_enabled" + | "locale_removed" + | "locale_disabled" + | "library_shared" + | "library_unshared" + | "library_installed" + | "library_uninstalled" + | "library_update_shared" + | "library_update_accepted" + | "branch_review_created" + | "branch_review_approved" + | "branch_review_canceled"; +} diff --git a/src/serialization/types/SiteActivityLogItemResourceOperation.ts b/src/serialization/types/SiteActivityLogItemResourceOperation.ts index 3e1a946e..c7a0f33a 100644 --- a/src/serialization/types/SiteActivityLogItemResourceOperation.ts +++ b/src/serialization/types/SiteActivityLogItemResourceOperation.ts @@ -9,8 +9,27 @@ import * as core from "../../core"; export const SiteActivityLogItemResourceOperation: core.serialization.Schema< serializers.SiteActivityLogItemResourceOperation.Raw, Webflow.SiteActivityLogItemResourceOperation -> = core.serialization.enum_(["CREATED", "MODIFIED", "PUBLISHED", "UNPUBLISHED", "DELETED"]); +> = core.serialization.enum_([ + "CREATED", + "MODIFIED", + "PUBLISHED", + "UNPUBLISHED", + "DELETED", + "GROUP_REORDERED", + "GROUP_CREATED", + "GROUP_DELETED", + "REORDERED", +]); export declare namespace SiteActivityLogItemResourceOperation { - type Raw = "CREATED" | "MODIFIED" | "PUBLISHED" | "UNPUBLISHED" | "DELETED"; + type Raw = + | "CREATED" + | "MODIFIED" + | "PUBLISHED" + | "UNPUBLISHED" + | "DELETED" + | "GROUP_REORDERED" + | "GROUP_CREATED" + | "GROUP_DELETED" + | "REORDERED"; } diff --git a/src/serialization/types/SiteDataCollectionType.ts b/src/serialization/types/SiteDataCollectionType.ts new file mode 100644 index 00000000..e0ef4635 --- /dev/null +++ b/src/serialization/types/SiteDataCollectionType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const SiteDataCollectionType: core.serialization.Schema< + serializers.SiteDataCollectionType.Raw, + Webflow.SiteDataCollectionType +> = core.serialization.enum_(["always", "optOut", "disabled"]); + +export declare namespace SiteDataCollectionType { + type Raw = "always" | "optOut" | "disabled"; +} diff --git a/src/serialization/types/TooManyRequestsErrorBody.ts b/src/serialization/types/TooManyRequestsErrorBody.ts deleted file mode 100644 index 71f75555..00000000 --- a/src/serialization/types/TooManyRequestsErrorBody.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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 TooManyRequestsErrorBody: core.serialization.ObjectSchema< - serializers.TooManyRequestsErrorBody.Raw, - Webflow.TooManyRequestsErrorBody -> = core.serialization.object({ - message: core.serialization.string().optional(), - code: core.serialization.string().optional(), - externalReference: core.serialization.string().optional(), - details: core.serialization.list(core.serialization.unknown()).optional(), -}); - -export declare namespace TooManyRequestsErrorBody { - interface Raw { - message?: string | null; - code?: string | null; - externalReference?: string | null; - details?: unknown[] | null; - } -} diff --git a/src/serialization/types/UserLimitReached.ts b/src/serialization/types/UserLimitReached.ts index 300be22a..6a5de4a3 100644 --- a/src/serialization/types/UserLimitReached.ts +++ b/src/serialization/types/UserLimitReached.ts @@ -5,23 +5,10 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; -import { ErrorDetailsItem } from "./ErrorDetailsItem"; -export const UserLimitReached: core.serialization.ObjectSchema< - serializers.UserLimitReached.Raw, - Webflow.UserLimitReached -> = core.serialization.object({ - code: core.serialization.string().optional(), - message: core.serialization.string().optional(), - externalReference: core.serialization.string().optional(), - details: core.serialization.list(ErrorDetailsItem).optional(), -}); +export const UserLimitReached: core.serialization.Schema = + core.serialization.unknown(); export declare namespace UserLimitReached { - interface Raw { - code?: string | null; - message?: string | null; - externalReference?: string | null; - details?: ErrorDetailsItem.Raw[] | null; - } + type Raw = unknown; } diff --git a/src/serialization/types/UsersNotEnabled.ts b/src/serialization/types/UsersNotEnabled.ts index 3de96c22..11ee6b7c 100644 --- a/src/serialization/types/UsersNotEnabled.ts +++ b/src/serialization/types/UsersNotEnabled.ts @@ -5,23 +5,10 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; -import { ErrorDetailsItem } from "./ErrorDetailsItem"; -export const UsersNotEnabled: core.serialization.ObjectSchema< - serializers.UsersNotEnabled.Raw, - Webflow.UsersNotEnabled -> = core.serialization.object({ - code: core.serialization.string().optional(), - message: core.serialization.string().optional(), - externalReference: core.serialization.string().optional(), - details: core.serialization.list(ErrorDetailsItem).optional(), -}); +export const UsersNotEnabled: core.serialization.Schema = + core.serialization.unknown(); export declare namespace UsersNotEnabled { - interface Raw { - code?: string | null; - message?: string | null; - externalReference?: string | null; - details?: ErrorDetailsItem.Raw[] | null; - } + type Raw = unknown; } diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 26e7ca7e..e2f02c81 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,9 +1,10 @@ -export * from "./ForbiddenErrorBody"; -export * from "./TooManyRequestsErrorBody"; export * from "./BadRequestErrorBody"; +export * from "./ForbiddenErrorBody"; export * from "./ConflictErrorBody"; -export * from "./ErrorDetailsItem"; export * from "./AuthorizedUser"; +export * from "./ErrorCode"; +export * from "./ErrorDetailsItem"; +export * from "./Error_"; export * from "./Application"; export * from "./AuthorizationAuthorizationAuthorizedTo"; export * from "./AuthorizationAuthorization"; @@ -11,18 +12,19 @@ export * from "./Authorization"; export * from "./Domain"; export * from "./Locale"; export * from "./Locales"; +export * from "./SiteDataCollectionType"; export * from "./Site"; export * from "./Sites"; export * from "./Domains"; export * from "./InvalidDomain"; export * from "./NoDomains"; +export * from "./SiteActivityLogItemEvent"; export * from "./SiteActivityLogItemResourceOperation"; export * from "./SiteActivityLogItemUser"; export * from "./SiteActivityLogItem"; export * from "./Pagination"; export * from "./SiteActivityLogResponse"; -export * from "./Error_"; -export * from "./MissingScopes"; +export * from "./InvalidScopes"; export * from "./NotEnterprisePlanSite"; export * from "./CollectionListArrayItem"; export * from "./CollectionList"; @@ -33,6 +35,9 @@ export * from "./CollectionItemFieldData"; export * from "./CollectionItem"; export * from "./CollectionItemListPagination"; export * from "./CollectionItemList"; +export * from "./CollectionItemWithIdInputFieldData"; +export * from "./CollectionItemWithIdInput"; +export * from "./CollectionItemListNoPagination"; export * from "./BulkCollectionItemFieldData"; export * from "./BulkCollectionItem"; export * from "./PageSeo"; diff --git a/src/version.ts b/src/version.ts index fd6beecb..b54c0dbf 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.4.2"; +export const SDK_VERSION = "2.5.0"; diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts index 0e14a8c7..ff804217 100644 --- a/tests/unit/fetcher/Fetcher.test.ts +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -1,5 +1,6 @@ -import fetchMock from "fetch-mock-jest"; +import fs from "fs"; import { Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; +import { join } from "path"; describe("Test fetcherImpl", () => { it("should handle successful request", async () => { @@ -12,8 +13,11 @@ describe("Test fetcherImpl", () => { requestType: "json", }; - fetchMock.mock("https://httpbin.org/post", 200, { - response: JSON.stringify({ data: "test" }), + global.fetch = jest.fn().mockResolvedValue({ + ok: true, + status: 200, + text: () => Promise.resolve(JSON.stringify({ data: "test" })), + json: () => ({ data: "test" }), }); const result = await fetcherImpl(mockArgs); @@ -21,5 +25,49 @@ describe("Test fetcherImpl", () => { if (result.ok) { expect(result.body).toEqual({ data: "test" }); } + + expect(global.fetch).toHaveBeenCalledWith( + "https://httpbin.org/post", + expect.objectContaining({ + method: "POST", + headers: expect.objectContaining({ "X-Test": "x-test-header" }), + body: JSON.stringify({ data: "test" }), + }) + ); + }); + + it("should send octet stream", async () => { + const url = "https://httpbin.org/post/file"; + const mockArgs: Fetcher.Args = { + url, + method: "POST", + headers: { "X-Test": "x-test-header" }, + contentType: "application/octet-stream", + requestType: "bytes", + duplex: "half", + body: fs.createReadStream(join(__dirname, "test-file.txt")), + }; + + global.fetch = jest.fn().mockResolvedValue({ + ok: true, + status: 200, + text: () => Promise.resolve(JSON.stringify({ data: "test" })), + json: () => Promise.resolve({ data: "test" }), + }); + + const result = await fetcherImpl(mockArgs); + + expect(global.fetch).toHaveBeenCalledWith( + url, + expect.objectContaining({ + method: "POST", + headers: expect.objectContaining({ "X-Test": "x-test-header" }), + body: expect.any(fs.ReadStream), + }) + ); + expect(result.ok).toBe(true); + if (result.ok) { + expect(result.body).toEqual({ data: "test" }); + } }); }); diff --git a/tests/unit/fetcher/getRequestBody.test.ts b/tests/unit/fetcher/getRequestBody.test.ts index 1b1462c5..919604c2 100644 --- a/tests/unit/fetcher/getRequestBody.test.ts +++ b/tests/unit/fetcher/getRequestBody.test.ts @@ -1,10 +1,6 @@ import { RUNTIME } from "../../../src/core/runtime"; import { getRequestBody } from "../../../src/core/fetcher/getRequestBody"; -if (RUNTIME.type === "browser") { - require("jest-fetch-mock").enableMocks(); -} - describe("Test getRequestBody", () => { it("should return FormData as is in Node environment", async () => { if (RUNTIME.type === "node") { diff --git a/tests/unit/fetcher/getResponseBody.test.ts b/tests/unit/fetcher/getResponseBody.test.ts index 3510779e..1030c517 100644 --- a/tests/unit/fetcher/getResponseBody.test.ts +++ b/tests/unit/fetcher/getResponseBody.test.ts @@ -2,10 +2,6 @@ import { RUNTIME } from "../../../src/core/runtime"; import { getResponseBody } from "../../../src/core/fetcher/getResponseBody"; import { chooseStreamWrapper } from "../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; -if (RUNTIME.type === "browser") { - require("jest-fetch-mock").enableMocks(); -} - describe("Test getResponseBody", () => { it("should handle blob response type", async () => { const mockBlob = new Blob(["test"], { type: "text/plain" }); diff --git a/tests/unit/fetcher/makeRequest.test.ts b/tests/unit/fetcher/makeRequest.test.ts index 5969d515..be94ab45 100644 --- a/tests/unit/fetcher/makeRequest.test.ts +++ b/tests/unit/fetcher/makeRequest.test.ts @@ -1,10 +1,6 @@ import { RUNTIME } from "../../../src/core/runtime"; import { makeRequest } from "../../../src/core/fetcher/makeRequest"; -if (RUNTIME.type === "browser") { - require("jest-fetch-mock").enableMocks(); -} - describe("Test makeRequest", () => { const mockPostUrl = "https://httpbin.org/post"; const mockGetUrl = "https://httpbin.org/get"; diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index b53e0436..6f77f093 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -1,85 +1,133 @@ import { RUNTIME } from "../../../src/core/runtime"; import { requestWithRetries } from "../../../src/core/fetcher/requestWithRetries"; -if (RUNTIME.type === "browser") { - require("jest-fetch-mock").enableMocks(); -} - -describe("Test exponential backoff", () => { +describe("requestWithRetries", () => { let mockFetch: jest.Mock; - let originalSetTimeout: typeof setTimeout; + let originalMathRandom: typeof Math.random; + let setTimeoutSpy: jest.SpyInstance; beforeEach(() => { mockFetch = jest.fn(); - originalSetTimeout = global.setTimeout; - jest.useFakeTimers(); + originalMathRandom = Math.random; + + // Mock Math.random for consistent jitter + Math.random = jest.fn(() => 0.5); + + jest.useFakeTimers({ doNotFake: ["nextTick"] }); }); afterEach(() => { - jest.useRealTimers(); - global.setTimeout = originalSetTimeout; + Math.random = originalMathRandom; + jest.clearAllMocks(); + jest.clearAllTimers(); }); - it("should retry on 408, 409, 429, 500+", async () => { - mockFetch - .mockResolvedValueOnce(new Response("", { status: 408 })) - .mockResolvedValueOnce(new Response("", { status: 409 })) - .mockResolvedValueOnce(new Response("", { status: 429 })) - .mockResolvedValueOnce(new Response("", { status: 500 })) - .mockResolvedValueOnce(new Response("", { status: 502 })) - .mockResolvedValueOnce(new Response("", { status: 200 })) - .mockResolvedValueOnce(new Response("", { status: 408 })); + it("should retry on retryable status codes", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { + process.nextTick(callback); + return null as any; + }); + + const retryableStatuses = [408, 409, 429, 500, 502]; + let callCount = 0; - const responsePromise = requestWithRetries(() => mockFetch(), 10); + mockFetch.mockImplementation(async () => { + if (callCount < retryableStatuses.length) { + return new Response("", { status: retryableStatuses[callCount++] }); + } + return new Response("", { status: 200 }); + }); - await jest.advanceTimersByTimeAsync(10000); + const responsePromise = requestWithRetries(() => mockFetch(), retryableStatuses.length); + await jest.runAllTimersAsync(); const response = await responsePromise; - expect(mockFetch).toHaveBeenCalledTimes(6); + expect(mockFetch).toHaveBeenCalledTimes(retryableStatuses.length + 1); expect(response.status).toBe(200); }); - it("should retry max 3 times", async () => { - mockFetch - .mockResolvedValueOnce(new Response("", { status: 408 })) - .mockResolvedValueOnce(new Response("", { status: 409 })) - .mockResolvedValueOnce(new Response("", { status: 429 })) - .mockResolvedValueOnce(new Response("", { status: 429 })); + it("should respect maxRetries limit", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { + process.nextTick(callback); + return null as any; + }); - const responsePromise = requestWithRetries(() => mockFetch(), 3); + const maxRetries = 2; + mockFetch.mockResolvedValue(new Response("", { status: 500 })); - await jest.advanceTimersByTimeAsync(10000); + const responsePromise = requestWithRetries(() => mockFetch(), maxRetries); + await jest.runAllTimersAsync(); const response = await responsePromise; - expect(mockFetch).toHaveBeenCalledTimes(4); - expect(response.status).toBe(429); + expect(mockFetch).toHaveBeenCalledTimes(maxRetries + 1); + expect(response.status).toBe(500); }); - it("should not retry on 200", async () => { - mockFetch - .mockResolvedValueOnce(new Response("", { status: 200 })) - .mockResolvedValueOnce(new Response("", { status: 409 })); - const responsePromise = requestWithRetries(() => mockFetch(), 3); + it("should not retry on success status codes", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { + process.nextTick(callback); + return null as any; + }); - await jest.advanceTimersByTimeAsync(10000); - const response = await responsePromise; + const successStatuses = [200, 201, 202]; - expect(mockFetch).toHaveBeenCalledTimes(1); - expect(response.status).toBe(200); + for (const status of successStatuses) { + mockFetch.mockReset(); + setTimeoutSpy.mockClear(); + mockFetch.mockResolvedValueOnce(new Response("", { status })); + + const responsePromise = requestWithRetries(() => mockFetch(), 3); + await jest.runAllTimersAsync(); + await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(1); + expect(setTimeoutSpy).not.toHaveBeenCalled(); + } }); - it("should retry with exponential backoff timing", async () => { + it("should apply correct exponential backoff with jitter", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { + process.nextTick(callback); + return null as any; + }); + mockFetch.mockResolvedValue(new Response("", { status: 500 })); - const maxRetries = 7; + const maxRetries = 3; + const expectedDelays = [1000, 2000, 4000]; + const responsePromise = requestWithRetries(() => mockFetch(), maxRetries); - expect(mockFetch).toHaveBeenCalledTimes(1); + await jest.runAllTimersAsync(); + await responsePromise; - const delays = [1, 2, 4, 8, 16, 32, 64]; - for (let i = 0; i < delays.length; i++) { - await jest.advanceTimersByTimeAsync(delays[i] as number); - expect(mockFetch).toHaveBeenCalledTimes(Math.min(i + 2, maxRetries + 1)); - } - const response = await responsePromise; - expect(response.status).toBe(500); + // Verify setTimeout calls + expect(setTimeoutSpy).toHaveBeenCalledTimes(expectedDelays.length); + + expectedDelays.forEach((delay, index) => { + expect(setTimeoutSpy).toHaveBeenNthCalledWith(index + 1, expect.any(Function), delay); + }); + + expect(mockFetch).toHaveBeenCalledTimes(maxRetries + 1); + }); + + it("should handle concurrent retries independently", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce(new Response("", { status: 500 })) + .mockResolvedValueOnce(new Response("", { status: 500 })) + .mockResolvedValueOnce(new Response("", { status: 200 })) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const promise1 = requestWithRetries(() => mockFetch(), 1); + const promise2 = requestWithRetries(() => mockFetch(), 1); + + await jest.runAllTimersAsync(); + const [response1, response2] = await Promise.all([promise1, promise2]); + + expect(response1.status).toBe(200); + expect(response2.status).toBe(200); }); }); diff --git a/tests/unit/fetcher/stream-wrappers/webpack.test.ts b/tests/unit/fetcher/stream-wrappers/webpack.test.ts index 2e827291..557db6dc 100644 --- a/tests/unit/fetcher/stream-wrappers/webpack.test.ts +++ b/tests/unit/fetcher/stream-wrappers/webpack.test.ts @@ -23,6 +23,9 @@ describe("test env compatibility", () => { (err, stats) => { try { expect(err).toBe(null); + if (stats?.hasErrors()) { + console.log(stats?.toString()); + } expect(stats?.hasErrors()).toBe(false); resolve(); } catch (error) { diff --git a/tests/unit/fetcher/test-file.txt b/tests/unit/fetcher/test-file.txt new file mode 100644 index 00000000..c66d471e --- /dev/null +++ b/tests/unit/fetcher/test-file.txt @@ -0,0 +1 @@ +This is a test file! diff --git a/tests/unit/zurg/object/passthrough.test.ts b/tests/unit/zurg/object/passthrough.test.ts new file mode 100644 index 00000000..28ce3b1f --- /dev/null +++ b/tests/unit/zurg/object/passthrough.test.ts @@ -0,0 +1,87 @@ +import { object, string, stringLiteral } from "../../../../src/core/schemas/builders"; +import { itJson, itParse, itSchema } from "../utils/itSchema"; +import { itValidate } from "../utils/itValidate"; + +describe("passthrough", () => { + const baseSchema = object({ + foo: string(), + bar: stringLiteral("bar"), + }); + + describe("parse", () => { + itParse("includes unknown values", baseSchema.passthrough(), { + raw: { + foo: "hello", + bar: "bar", + baz: "extra", + }, + parsed: { + foo: "hello", + bar: "bar", + baz: "extra", + }, + }); + + itValidate( + "preserves schema validation", + baseSchema.passthrough(), + { + foo: 123, + bar: "bar", + baz: "extra", + }, + [ + { + path: ["foo"], + message: "Expected string. Received 123.", + }, + ] + ); + }); + + describe("json", () => { + itJson("includes unknown values", baseSchema.passthrough(), { + raw: { + foo: "hello", + bar: "bar", + + baz: "extra", + }, + parsed: { + foo: "hello", + bar: "bar", + + baz: "extra", + }, + }); + + itValidate( + "preserves schema validation", + baseSchema.passthrough(), + { + foo: "hello", + bar: "wrong", + baz: "extra", + }, + [ + { + path: ["bar"], + message: 'Expected "bar". Received "wrong".', + }, + ] + ); + }); + + itSchema("preserves schema validation in both directions", baseSchema.passthrough(), { + raw: { + foo: "hello", + bar: "bar", + extra: 42, + }, + parsed: { + foo: "hello", + bar: "bar", + extra: 42, + }, + }); +}); diff --git a/yarn.lock b/yarn.lock index 592319de..502c2e2e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,131 +10,114 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" - integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" + integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== dependencies: - "@babel/highlight" "^7.24.7" + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/compat-data@^7.25.2": - version "7.25.4" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.4.tgz#7d2a80ce229890edcf4cc259d4d696cb4dae2fcb" - integrity sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ== +"@babel/compat-data@^7.25.9": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.2.tgz#278b6b13664557de95b8f35b90d96785850bb56e" + integrity sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg== -"@babel/core@^7.0.0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" - integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" + integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.25.0" - "@babel/helper-compilation-targets" "^7.25.2" - "@babel/helper-module-transforms" "^7.25.2" - "@babel/helpers" "^7.25.0" - "@babel/parser" "^7.25.0" - "@babel/template" "^7.25.0" - "@babel/traverse" "^7.25.2" - "@babel/types" "^7.25.2" + "@babel/code-frame" "^7.26.0" + "@babel/generator" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.0" + "@babel/parser" "^7.26.0" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.26.0" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.25.0", "@babel/generator@^7.25.6", "@babel/generator@^7.7.2": - version "7.25.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.6.tgz#0df1ad8cb32fe4d2b01d8bf437f153d19342a87c" - integrity sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw== +"@babel/generator@^7.25.9", "@babel/generator@^7.26.0", "@babel/generator@^7.7.2": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.26.2.tgz#87b75813bec87916210e5e01939a4c823d6bb74f" + integrity sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw== dependencies: - "@babel/types" "^7.25.6" + "@babel/parser" "^7.26.2" + "@babel/types" "^7.26.0" "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^2.5.1" + jsesc "^3.0.2" -"@babel/helper-compilation-targets@^7.25.2": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz#e1d9410a90974a3a5a66e84ff55ef62e3c02d06c" - integrity sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw== +"@babel/helper-compilation-targets@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" + integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== dependencies: - "@babel/compat-data" "^7.25.2" - "@babel/helper-validator-option" "^7.24.8" - browserslist "^4.23.1" + "@babel/compat-data" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-module-imports@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz#f2f980392de5b84c3328fc71d38bd81bbb83042b" - integrity sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA== - dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-module-transforms@^7.25.2": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz#ee713c29768100f2776edf04d4eb23b8d27a66e6" - integrity sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ== - dependencies: - "@babel/helper-module-imports" "^7.24.7" - "@babel/helper-simple-access" "^7.24.7" - "@babel/helper-validator-identifier" "^7.24.7" - "@babel/traverse" "^7.25.2" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.24.7", "@babel/helper-plugin-utils@^7.24.8", "@babel/helper-plugin-utils@^7.8.0": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" - integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== - -"@babel/helper-simple-access@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz#bcade8da3aec8ed16b9c4953b74e506b51b5edb3" - integrity sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg== - dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-string-parser@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" - integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== - -"@babel/helper-validator-identifier@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" - integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== - -"@babel/helper-validator-option@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" - integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== - -"@babel/helpers@^7.25.0": - version "7.25.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.6.tgz#57ee60141829ba2e102f30711ffe3afab357cc60" - integrity sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q== - dependencies: - "@babel/template" "^7.25.0" - "@babel/types" "^7.25.6" - -"@babel/highlight@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" - integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== - dependencies: - "@babel/helper-validator-identifier" "^7.24.7" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" +"@babel/helper-module-imports@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" + integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.25.0", "@babel/parser@^7.25.6": - version "7.25.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.6.tgz#85660c5ef388cbbf6e3d2a694ee97a38f18afe2f" - integrity sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q== +"@babel/helper-module-transforms@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" + integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== dependencies: - "@babel/types" "^7.25.6" + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" + integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== + +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + +"@babel/helper-validator-option@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" + integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== + +"@babel/helpers@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" + integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== + dependencies: + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.2": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.2.tgz#fd7b6f487cfea09889557ef5d4eeb9ff9a5abd11" + integrity sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ== + dependencies: + "@babel/types" "^7.26.0" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -165,11 +148,11 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-import-attributes@^7.24.7": - version "7.25.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.6.tgz#6d4c78f042db0e82fd6436cd65fec5dc78ad2bde" - integrity sha512-sXaDXaJN9SNLymBdlWFA+bjzBhFD617ZaFiY13dGt7TVslVvVgA6fkZOP7Ki3IGElC45lwHdOTrCtKZGVAWeLQ== + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" + integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== dependencies: - "@babel/helper-plugin-utils" "^7.24.8" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -186,11 +169,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz#39a1fa4a7e3d3d7f34e2acc6be585b718d30e02d" - integrity sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ== + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" + integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== dependencies: - "@babel/helper-plugin-utils" "^7.24.7" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" @@ -249,49 +232,41 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.25.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.4.tgz#04db9ce5a9043d9c635e75ae7969a2cd50ca97ff" - integrity sha512-uMOCoHVU52BsSWxPOMVv5qKRdeSlPuImUCB2dlPuBSU+W2/ROE7/Zg8F2Kepbk+8yBa68LlRKxO+xgEVWorsDg== - dependencies: - "@babel/helper-plugin-utils" "^7.24.8" - -"@babel/runtime@^7.0.0": - version "7.25.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2" - integrity sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/template@^7.25.0", "@babel/template@^7.3.3": - version "7.25.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.0.tgz#e733dc3134b4fede528c15bc95e89cb98c52592a" - integrity sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q== - dependencies: - "@babel/code-frame" "^7.24.7" - "@babel/parser" "^7.25.0" - "@babel/types" "^7.25.0" - -"@babel/traverse@^7.24.7", "@babel/traverse@^7.25.2": - version "7.25.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.6.tgz#04fad980e444f182ecf1520504941940a90fea41" - integrity sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ== - dependencies: - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.25.6" - "@babel/parser" "^7.25.6" - "@babel/template" "^7.25.0" - "@babel/types" "^7.25.6" + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" + integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/template@^7.25.9", "@babel/template@^7.3.3": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" + integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/traverse@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" + integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/generator" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/template" "^7.25.9" + "@babel/types" "^7.25.9" debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.24.7", "@babel/types@^7.25.0", "@babel/types@^7.25.2", "@babel/types@^7.25.6", "@babel/types@^7.3.3": - version "7.25.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.6.tgz#893942ddb858f32ae7a004ec9d3a76b3463ef8e6" - integrity sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.3.3": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" + integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== dependencies: - "@babel/helper-string-parser" "^7.24.8" - "@babel/helper-validator-identifier" "^7.24.7" - to-fast-properties "^2.0.0" + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" @@ -603,10 +578,26 @@ dependencies: "@babel/types" "^7.20.7" -"@types/estree@^1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" - integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== +"@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" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "9.6.1" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" + integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== "@types/graceful-fs@^4.1.3": version "4.1.9" @@ -651,7 +642,7 @@ "@types/tough-cookie" "*" parse5 "^7.0.0" -"@types/json-schema@^7.0.8": +"@types/json-schema@*", "@types/json-schema@^7.0.8": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -665,11 +656,11 @@ form-data "^4.0.0" "@types/node@*": - version "22.5.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.5.tgz#52f939dd0f65fc552a4ad0b392f3c466cc5d7a44" - integrity sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA== + version "22.10.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766" + integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ== dependencies: - undici-types "~6.19.2" + undici-types "~6.20.0" "@types/node@17.0.33": version "17.0.33" @@ -682,9 +673,9 @@ integrity sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg== "@types/readable-stream@^4.0.15": - version "4.0.15" - resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.15.tgz#e6ec26fe5b02f578c60baf1fa9452e90957d2bfb" - integrity sha512-oAZ3kw+kJFkEqyh7xORZOku1YAKvsFTogRY8kVl4vHpEKiDkfnSA/My8haRE7fvmix5Zyy+1pwzOi7yycGLBJw== + version "4.0.18" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.18.tgz#5d8d15d26c776500ce573cae580787d149823bfc" + integrity sha512-21jK/1j+Wg+7jVw1xnSwy/2Q1VgVjWuFssbYGTREPUBeZ+rqVFl2udq0IkxzPC0ZhOzVceUbyIACFZKLqKEBlA== dependencies: "@types/node" "*" safe-buffer "~5.1.1" @@ -716,125 +707,125 @@ dependencies: "@types/yargs-parser" "*" -"@webassemblyjs/ast@1.12.1", "@webassemblyjs/ast@^1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.12.1.tgz#bb16a0e8b1914f979f45864c23819cc3e3f0d4bb" - integrity sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg== +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== dependencies: - "@webassemblyjs/helper-numbers" "1.11.6" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-numbers" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" -"@webassemblyjs/floating-point-hex-parser@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz#dacbcb95aff135c8260f77fa3b4c5fea600a6431" - integrity sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw== +"@webassemblyjs/floating-point-hex-parser@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== -"@webassemblyjs/helper-api-error@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz#6132f68c4acd59dcd141c44b18cbebbd9f2fa768" - integrity sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q== +"@webassemblyjs/helper-api-error@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== -"@webassemblyjs/helper-buffer@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz#6df20d272ea5439bf20ab3492b7fb70e9bfcb3f6" - integrity sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw== +"@webassemblyjs/helper-buffer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== -"@webassemblyjs/helper-numbers@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz#cbce5e7e0c1bd32cf4905ae444ef64cea919f1b5" - integrity sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g== +"@webassemblyjs/helper-numbers@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + integrity sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA== dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.6" - "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/floating-point-hex-parser" "1.13.2" + "@webassemblyjs/helper-api-error" "1.13.2" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz#bb2ebdb3b83aa26d9baad4c46d4315283acd51e9" - integrity sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA== +"@webassemblyjs/helper-wasm-bytecode@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== -"@webassemblyjs/helper-wasm-section@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz#3da623233ae1a60409b509a52ade9bc22a37f7bf" - integrity sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g== +"@webassemblyjs/helper-wasm-section@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + integrity sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw== dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-buffer" "1.12.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" - "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/wasm-gen" "1.14.1" -"@webassemblyjs/ieee754@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz#bb665c91d0b14fffceb0e38298c329af043c6e3a" - integrity sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg== +"@webassemblyjs/ieee754@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + integrity sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.6.tgz#70e60e5e82f9ac81118bc25381a0b283893240d7" - integrity sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ== +"@webassemblyjs/leb128@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + integrity sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.6": - version "1.11.6" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.6.tgz#90f8bc34c561595fe156603be7253cdbcd0fab5a" - integrity sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA== - -"@webassemblyjs/wasm-edit@^1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz#9f9f3ff52a14c980939be0ef9d5df9ebc678ae3b" - integrity sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g== - dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-buffer" "1.12.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" - "@webassemblyjs/helper-wasm-section" "1.12.1" - "@webassemblyjs/wasm-gen" "1.12.1" - "@webassemblyjs/wasm-opt" "1.12.1" - "@webassemblyjs/wasm-parser" "1.12.1" - "@webassemblyjs/wast-printer" "1.12.1" - -"@webassemblyjs/wasm-gen@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz#a6520601da1b5700448273666a71ad0a45d78547" - integrity sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w== - dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" - "@webassemblyjs/ieee754" "1.11.6" - "@webassemblyjs/leb128" "1.11.6" - "@webassemblyjs/utf8" "1.11.6" - -"@webassemblyjs/wasm-opt@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz#9e6e81475dfcfb62dab574ac2dda38226c232bc5" - integrity sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg== - dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-buffer" "1.12.1" - "@webassemblyjs/wasm-gen" "1.12.1" - "@webassemblyjs/wasm-parser" "1.12.1" - -"@webassemblyjs/wasm-parser@1.12.1", "@webassemblyjs/wasm-parser@^1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz#c47acb90e6f083391e3fa61d113650eea1e95937" - integrity sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ== - dependencies: - "@webassemblyjs/ast" "1.12.1" - "@webassemblyjs/helper-api-error" "1.11.6" - "@webassemblyjs/helper-wasm-bytecode" "1.11.6" - "@webassemblyjs/ieee754" "1.11.6" - "@webassemblyjs/leb128" "1.11.6" - "@webassemblyjs/utf8" "1.11.6" - -"@webassemblyjs/wast-printer@1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz#bcecf661d7d1abdaf989d8341a4833e33e2b31ac" - integrity sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA== - dependencies: - "@webassemblyjs/ast" "1.12.1" +"@webassemblyjs/utf8@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== + +"@webassemblyjs/wasm-edit@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/helper-wasm-section" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-opt" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wast-printer" "1.14.1" + +"@webassemblyjs/wasm-gen@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + integrity sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wasm-opt@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + integrity sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-api-error" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wast-printer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + integrity sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw== + dependencies: + "@webassemblyjs/ast" "1.14.1" "@xtuc/long" "4.2.2" "@xtuc/ieee754@^1.2.0": @@ -867,11 +858,6 @@ acorn-globals@^7.0.0: acorn "^8.1.0" acorn-walk "^8.0.2" -acorn-import-attributes@^1.9.5: - version "1.9.5" - resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" - integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== - acorn-walk@^8.0.2: version "8.3.4" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" @@ -879,10 +865,10 @@ acorn-walk@^8.0.2: dependencies: acorn "^8.11.0" -acorn@^8.1.0, acorn@^8.11.0, acorn@^8.7.1, acorn@^8.8.1, acorn@^8.8.2: - version "8.12.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" - integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.14.0, acorn@^8.8.1, acorn@^8.8.2: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== agent-base@6: version "6.0.2" @@ -918,13 +904,6 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -1045,15 +1024,15 @@ braces@^3.0.3: dependencies: fill-range "^7.1.1" -browserslist@^4.21.10, browserslist@^4.23.1: - version "4.23.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.3.tgz#debb029d3c93ebc97ffbc8d9cbb03403e227c800" - integrity sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA== +browserslist@^4.24.0: + version "4.24.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== dependencies: - caniuse-lite "^1.0.30001646" - electron-to-chromium "^1.5.4" + caniuse-lite "^1.0.30001669" + electron-to-chromium "^1.5.41" node-releases "^2.0.18" - update-browserslist-db "^1.1.0" + update-browserslist-db "^1.1.1" bs-logger@0.x: version "0.2.6" @@ -1108,19 +1087,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001646: - version "1.0.30001660" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001660.tgz#31218de3463fabb44d0b7607b652e56edf2e2355" - integrity sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg== - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" +caniuse-lite@^1.0.30001669: + version "1.0.30001686" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz#0e04b8d90de8753188e93c9989d56cb19d902670" + integrity sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1169,13 +1139,6 @@ collect-v8-coverage@^1.0.0: resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -1183,11 +1146,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -1215,11 +1173,6 @@ 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== -core-js@^3.0.0: - version "3.38.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.38.1.tgz#aa375b79a286a670388a1a363363d53677c0383e" - integrity sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw== - create-jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" @@ -1234,9 +1187,9 @@ create-jest@^29.7.0: prompts "^2.0.1" cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -1321,10 +1274,10 @@ domexception@^4.0.0: dependencies: webidl-conversions "^7.0.0" -electron-to-chromium@^1.5.4: - version "1.5.23" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.23.tgz#6dabd8f7fec5cbf618b732ff4c42950dcc7a3be5" - integrity sha512-mBhODedOXg4v5QWwl21DjM5amzjmI1zw9EPrPK/5Wx7C8jt33bpZNrC7OhHUG3pxRtbLpr3W2dXT+Ph1SsfRZA== +electron-to-chromium@^1.5.41: + version "1.5.68" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.68.tgz#4f46be4d465ef00e2100d5557b66f4af70e3ce6c" + integrity sha512-FgMdJlma0OzUYlbrtZ4AeXjKxKPk6KT8WOP8BjcqxWtlg8qyJQjRzPJzUtUn5GBg1oQ26hFs7HOOHJMYiJRnvQ== emittery@^0.13.1: version "0.13.1" @@ -1344,7 +1297,7 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.1: graceful-fs "^4.2.4" tapable "^2.2.0" -entities@^4.4.0: +entities@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== @@ -1373,16 +1326,11 @@ es-module-lexer@^1.2.1: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.4.tgz#a8efec3a3da991e60efa6b633a7cad6ab8d26b78" integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== -escalade@^3.1.1, escalade@^3.1.2: +escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - escape-string-regexp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" @@ -1492,29 +1440,6 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fetch-mock-jest@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/fetch-mock-jest/-/fetch-mock-jest-1.5.1.tgz#0e13df990d286d9239e284f12b279ed509bf53cd" - integrity sha512-+utwzP8C+Pax1GSka3nFXILWMY3Er2L+s090FOgqVNrNCPp0fDqgXnAHAJf12PLHi0z4PhcTaZNTz8e7K3fjqQ== - dependencies: - fetch-mock "^9.11.0" - -fetch-mock@^9.11.0: - version "9.11.0" - resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-9.11.0.tgz#371c6fb7d45584d2ae4a18ee6824e7ad4b637a3f" - integrity sha512-PG1XUv+x7iag5p/iNHD4/jdpxL9FtVSqRMUQhPab4hVDt80T1MH5ehzVrL2IdXO9Q2iBggArFvPqjUbHFuI58Q== - dependencies: - "@babel/core" "^7.0.0" - "@babel/runtime" "^7.0.0" - core-js "^3.0.0" - debug "^4.1.1" - glob-to-regexp "^0.4.0" - is-subset "^0.1.1" - lodash.isequal "^4.5.0" - path-to-regexp "^2.2.1" - querystring "^0.2.0" - whatwg-url "^6.5.0" - fill-range@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -1531,9 +1456,9 @@ find-up@^4.0.0, find-up@^4.1.0: path-exists "^4.0.0" form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + version "4.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" + integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -1569,7 +1494,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: +get-intrinsic@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== @@ -1590,7 +1515,7 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-to-regexp@^0.4.0, glob-to-regexp@^0.4.1: +glob-to-regexp@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== @@ -1613,22 +1538,17 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.1.0.tgz#df8f0839c2d48caefc32a025a49294d39606c912" + integrity sha512-FQoVQnqcdk4hVM4JN1eromaun4iuS34oStkdlLENLdpULsuQcTyXj8w7ayhuUfPwEYZ1ZOooOTT6fdA9Vmx/RA== dependencies: - get-intrinsic "^1.1.3" + get-intrinsic "^1.2.4" graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1642,14 +1562,16 @@ has-property-descriptors@^1.0.2: es-define-property "^1.0.0" has-proto@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" - integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.1.0.tgz#deb10494cbbe8809bce168a3b961f42969f5ed43" + integrity sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q== + dependencies: + call-bind "^1.0.7" has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== hasown@^2.0.0, hasown@^2.0.2: version "2.0.2" @@ -1767,11 +1689,6 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-subset@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" - integrity sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw== - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -2261,10 +2178,10 @@ jsdom@^20.0.0: ws "^8.11.0" xml-name-validator "^4.0.0" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: version "2.3.1" @@ -2308,21 +2225,11 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.isequal@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== - lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -2431,14 +2338,14 @@ npm-run-path@^4.0.1: path-key "^3.0.0" nwsapi@^2.2.2: - version "2.2.12" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.12.tgz#fb6af5c0ec35b27b4581eb3bbad34ec9e5c696f8" - integrity sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w== + version "2.2.16" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.16.tgz#177760bba02c351df1d2644e220c31dfec8cdb43" + integrity sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ== object-inspect@^1.13.1: - version "1.13.2" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" - integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== + version "1.13.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== once@^1.3.0: version "1.4.0" @@ -2491,11 +2398,11 @@ parse-json@^5.2.0: lines-and-columns "^1.1.6" parse5@^7.0.0, parse5@^7.1.1: - version "7.1.2" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" - integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + version "7.2.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a" + integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ== dependencies: - entities "^4.4.0" + entities "^4.5.0" path-exists@^4.0.0: version "4.0.0" @@ -2517,15 +2424,10 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-to-regexp@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704" - integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== - -picocolors@^1.0.0, picocolors@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.0.tgz#5358b76a78cde483ba5cef6a9dc9671440b27d59" - integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw== +picocolors@^1.0.0, picocolors@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" @@ -2572,11 +2474,13 @@ prompts@^2.0.1: sisteransi "^1.0.5" psl@^1.1.33: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + version "1.15.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" + integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== + dependencies: + punycode "^2.3.1" -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== @@ -2593,11 +2497,6 @@ qs@6.11.2: dependencies: side-channel "^1.0.4" -querystring@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" - integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== - querystringify@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" @@ -2626,11 +2525,6 @@ readable-stream@^4.5.2: process "^0.11.10" string_decoder "^1.3.0" -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -2654,9 +2548,9 @@ resolve-from@^5.0.0: integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve.exports@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" - integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== + version "2.0.3" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.3.tgz#41955e6f1b4013b7586f873749a635dea07ebe3f" + integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== resolve@^1.20.0: version "1.22.8" @@ -2848,13 +2742,6 @@ strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -2896,9 +2783,9 @@ terser-webpack-plugin@^5.3.10: terser "^5.26.0" terser@^5.26.0: - version "5.32.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.32.0.tgz#ee811c0d2d6b741c1cc34a2bc5bcbfc1b5b1f96c" - integrity sha512-v3Gtw3IzpBJ0ugkxEX8U0W6+TnPKRRCWGh1jC/iM/e3Ki5+qvO1L1EAZ56bZasc64aXHwRHNIQEzm6//i5cemQ== + version "5.36.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.36.0.tgz#8b0dbed459ac40ff7b4c9fd5a3a2029de105180e" + integrity sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -2919,11 +2806,6 @@ tmpl@1.0.5: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -2941,13 +2823,6 @@ tough-cookie@^4.1.2: universalify "^0.2.0" url-parse "^1.5.3" -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== - dependencies: - punycode "^2.1.0" - tr46@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" @@ -3000,23 +2875,23 @@ typescript@4.6.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== -undici-types@~6.19.2: - version "6.19.8" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" - integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== universalify@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -update-browserslist-db@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" - integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== +update-browserslist-db@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" + integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== dependencies: - escalade "^3.1.2" - picocolors "^1.0.1" + escalade "^3.2.0" + picocolors "^1.1.0" uri-js@^4.2.2: version "4.4.1" @@ -3074,11 +2949,6 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - webidl-conversions@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" @@ -3090,17 +2960,17 @@ webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5.94.0: - version "5.94.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f" - integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg== - dependencies: - "@types/estree" "^1.0.5" - "@webassemblyjs/ast" "^1.12.1" - "@webassemblyjs/wasm-edit" "^1.12.1" - "@webassemblyjs/wasm-parser" "^1.12.1" - acorn "^8.7.1" - acorn-import-attributes "^1.9.5" - browserslist "^4.21.10" + version "5.97.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.97.0.tgz#1c5e3b9319f8c6decb19b142e776d90e629d5c40" + integrity sha512-CWT8v7ShSfj7tGs4TLRtaOLmOCPWhoKEvp+eA7FVx8Xrjb3XfT0aXdxDItnRZmE8sHcH+a8ayDrJCOjXKxVFfQ== + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" + "@webassemblyjs/ast" "^1.14.1" + "@webassemblyjs/wasm-edit" "^1.14.1" + "@webassemblyjs/wasm-parser" "^1.14.1" + acorn "^8.14.0" + browserslist "^4.24.0" chrome-trace-event "^1.0.2" enhanced-resolve "^5.17.1" es-module-lexer "^1.2.1" @@ -3146,15 +3016,6 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -whatwg-url@^6.5.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" - integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"