/** * This file was auto-generated by openapi-typescript and ts-morph. * Do not make direct changes to the file. */ export interface paths { readonly "/content/scripts": { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; /** * Get All Scripts * @description Returns a list of *Scripts*. Optional parameters can be passed in. * * This operation will only return scripts generated by the API key and password used to create the script originally. */ readonly get: operations["getScripts"]; /** * Create a Script * @description Creates a *Script*. * * **Required Fields** * * name * * **Read Only Fields** * * uuid * * **Limits** * * 50 scripts per channel. * * **Notes** * * If the `kind` is `src`: * * Specify the `src` property. * * Optionally, you can supply a `load_method`. * * Do not specify the `html` field. * * If the `kind` is `script_tag`: * * Specify the `html` property. * * Do not specify the `src` field. * * Each app can have 10 scripts installed. * * Multiple scripts can be created [per call](/docs/integrations/scripts#notes). */ readonly post: operations["createScript"]; }; readonly "/content/scripts/{uuid}": { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: components["parameters"]["Accept"]; }; readonly path: { /** @description The identifier for a specific script. */ readonly uuid: components["parameters"]["ScriptUUID"]; }; readonly cookie?: never; }; /** * Get a Script * @description Returns a single *Script*. */ readonly get: operations["getScript"]; /** * Update a Script * @description Updates a *Script*. */ readonly put: operations["updateScript"]; /** * Delete a Script * @description Deletes a *Script*. */ readonly delete: operations["deleteScript"]; }; } export type webhooks = Record; export interface components { schemas: { /** * Collection Meta * @description Data about the response, including pagination and collection totals. */ readonly CollectionMeta: { /** * Pagination * @description Data about the response, including pagination and collection totals. */ readonly pagination?: { /** * @description Total number of items in the result set. * * @example 36 */ readonly total?: number; /** * @description Total number of items in the collection response. * * @example 36 */ readonly count?: number; /** * @description The amount of items returned in the collection per page, controlled by the limit parameter. * * @example 50 */ readonly per_page?: number; /** * @description The page you are currently on within the collection. * * @example 1 */ readonly current_page?: number; /** * @description The total number of pages in the collection. * * @example 1 */ readonly total_pages?: number; /** @description Pagination links for the previous and next parts of the whole collection. * */ readonly links?: { /** @description Link to the previous page returned in the response. * */ readonly previous?: string; /** * @description Link to the current page returned in the response. * * @example ?page=1&limit=50 */ readonly current?: string; /** @description Link to the next page returned in the response. * */ readonly next?: string; }; }; }; /** * Pagination * @description Data about the response, including pagination and collection totals. */ readonly Pagination: { /** * @description Total number of items in the result set. * * @example 36 */ readonly total?: number; /** * @description Total number of items in the collection response. * * @example 36 */ readonly count?: number; /** * @description The amount of items returned in the collection per page, controlled by the limit parameter. * * @example 50 */ readonly per_page?: number; /** * @description The page you are currently on within the collection. * * @example 1 */ readonly current_page?: number; /** * @description The total number of pages in the collection. * * @example 1 */ readonly total_pages?: number; /** @description Pagination links for the previous and next parts of the whole collection. * */ readonly links?: { /** @description Link to the previous page returned in the response. * */ readonly previous?: string; /** * @description Link to the current page returned in the response. * * @example ?page=1&limit=50 */ readonly current?: string; /** @description Link to the next page returned in the response. * */ readonly next?: string; }; }; /** * Meta * @description Response metadata. */ readonly Meta: { readonly [key: string]: unknown; }; /** Error Response */ readonly ErrorResponse: { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { /** DetailedErrors */ readonly errors?: { readonly [key: string]: unknown; }; }; /** * Base Error * @description Error payload for the BigCommerce API. * */ readonly BaseError: { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; }; /** DetailedErrors */ readonly DetailedErrors: { readonly [key: string]: unknown; }; /** * Not Found * @description Error payload for the BigCommerce API. */ readonly NotFound: { /** @description 404 HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. */ readonly title?: string; readonly type?: string; readonly instance?: string; }; /** * No Content * @description No-content response for the BigCommerce API. */ readonly NoContent: { /** * @description 204 HTTP status code. * * @example 204 */ readonly status?: number; /** @description The error title describing the situation. */ readonly title?: string; readonly type?: string; readonly instance?: string; }; /** script_Full */ readonly script_Full: { /** @description The user-friendly name. */ readonly name?: string; /** * Format: uuid * @description The primary identifier. */ readonly uuid?: string; /** * Format: date-time * @description The date on which this object was initially created. */ readonly date_created?: string; /** * Format: date-time * @description The date on which this object was last updated. */ readonly date_modified?: string; } & components["schemas"]["script_Base"]; /** script_Post */ readonly script_Post: { /** @description The user-friendly name. */ readonly name: string; } & components["schemas"]["script_Base"]; readonly script_Put: { /** @description The user-friendly name. */ readonly name?: string; } & components["schemas"]["script_Base"]; /** * script_Response * @description For a list of all locations visit [Scripts Visibility](/docs/integrations/scripts#script-visibility-locations). */ readonly script_Response: { readonly data?: components["schemas"]["script_Full"]; readonly meta?: components["schemas"]["Meta"]; }; /** * script_responseCollection * @description For a list of all locations visit [Scripts Visibility](/docs/integrations/scripts#script-visibility-locations). */ readonly script_responseCollection: { readonly data?: readonly components["schemas"]["script_Full"][]; readonly meta?: components["schemas"]["CollectionMeta"]; }; /** * script_Base * @description Script properties common to `post`, `put`, and `get` requests. */ readonly script_Base: { /** @description The user-friendly description. */ readonly description?: string; /** @description An HTML string containing exactly one `script` tag. Present when the script `kind` is `script_tag`. */ readonly html?: string; /** * @description The `src` attribute of the script to load. Only present if `kind` is `src`. * @example https://code.jquery.com/jquery-3.2.1.min.js */ readonly src?: string; /** @description It will enable automatic cleanup of the script when the single click app is uninstalled or OAuth token is revoked. */ readonly auto_uninstall?: boolean; /** * @description The load method to use for the script. Values are `default`, `async`, or `defer`. It determines how the script should be loaded into the page. * @enum {string} */ readonly load_method?: "default" | "async" | "defer"; /** * @description Where on the page to place the script. Values are `head` or `footer`. * @enum {string} */ readonly location?: "head" | "footer"; /** * @description Which set of pages the script should load on. * * Please note that you need to have `Checkout content` scope to use `all_pages` and `checkout`. * * - The current visibility options are `storefront`, `checkout`, `all_pages` and `order_confirmation`. * * `storefront`: All pages that are not `checkout` or `order_confirmation`. * * * For a list of all locations visit [Scripts Visibility](/docs/integrations/scripts#script-visibility-locations). * @enum {string} */ readonly visibility?: "storefront" | "all_pages" | "checkout" | "order_confirmation"; /** * @description What type of script this is. * * `src` - For scripts that use the src URL. A `script` tag will be generated with its `src` attribute set to the value of the `src` property. When your app provides a path to the script, we can optimize and add the script automatically for you. The load_method can vary. * * `script_tag` - For scripts that include a raw HTML `script` tag-enclosed block of JavaScript. The value of `html` is added directly to the page. The load_method must be default. * @example src * @enum {string} */ readonly kind?: "src" | "script_tag"; /** @description The client id of the API user that created this script, or blank if created by other means. */ readonly api_client_id?: string; /** * @description Consent category for GDPR and CCPA compliance. Defaults to `unknown` when not specified. Scripts with an `unknown` consent category do not display on stores with customer cookie consent banners enabled. * @example essential * @enum {string} */ readonly consent_category?: "essential" | "functional" | "analytics" | "targeting"; /** @description Whether the script is enabled or disabled on the storefront. */ readonly enabled?: boolean; /** @example 1 */ readonly channel_id?: number; /** * @description Array of [Subresource integrity (SRI) hashes](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) for external SRC scripts that lets browsers validate the contents of the script. * * The hash is the `integrity` attribute on the `script` tag. You can add up to five hashes for a script and generate them using any SRI standard-supported algorithm, including SHA-256, SHA-384, and SHA-512. If you provide more than one hash, they will all be added to the `integrity` attribute in order, separated by whitespace. * * @example [ * "sha384-DgtwqxoPLKnJSER+TUmSPIpE6ZbVb2ZZwR241HHiqJipLiZQPN/JkKX5xxrEHUTt", * "sha384-UiwrqEuzfCtJKLI+dXmPNOpE6ZvBh2IIqT371rJiqJxyKjZ6PP/JmSD5hdsEUPOl" * ] */ readonly integrity_hashes?: readonly string[]; }; }; responses: never; parameters: { /** @description The identifier for a specific widget template. */ readonly FilterWidgetTemplateUUIDParam: string; /** @description The kind of widget template. */ readonly FilterWidgetTemplateKindParam: string; /** @description The identifier for a specific placement. */ readonly PlacementUUID: string; /** @description The identifier for a specific widget. */ readonly WidgetUUID: string; /** @description The identifier for a specific script. */ readonly ScriptUUID: string; /** @description The identifier for a specific widget. */ readonly FilterWidgetUUIDParam: string; /** @description Fields to include, in a comma-separated list. The ID and the specified fields will be returned. */ readonly FilterIncludeFieldsParam: readonly string[]; /** @description Fields to exclude, in a comma-separated list. The specified fields will be excluded from a response. The ID cannot be excluded. */ readonly FilterExcludeFieldsParam: readonly string[]; /** @description Specifies the page number in a limited (paginated) list of products. */ readonly PageParam: number; /** @description Controls the number of items per page in a limited (paginated) list of products. */ readonly LimitParam: number; /** @description Scripts field name to sort by. * */ readonly ScriptsSortKeyParam: "name" | "description" | "date_created" | "date_modified"; /** @description Sort direction. Acceptable values are: `asc`, `desc`. * */ readonly DirectionParam: "asc" | "desc"; /** @description The identifier for a specific template. */ readonly TemplateUUID: string; /** @description The template file, for example: `pages/home`. */ readonly RequiredTemplateFile: string; /** @description The query string associated with a widget's name and description. * */ readonly QueryWidgetsParam: string; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: string; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly ContentType: string; }; requestBodies: never; headers: never; pathItems: never; } export type $defs = Record; export interface operations { readonly getScripts: { readonly parameters: { readonly query?: { /** @description Specifies the page number in a limited (paginated) list of products. */ readonly page?: number; /** @description Controls the number of items per page in a limited (paginated) list of products. */ readonly limit?: number; /** @description Field name to sort the scripts by. Note: Since `id` increments when new scripts are added, you can use that field to sort by script create date. * */ readonly sort?: "name" | "description" | "date_created" | "date_modified"; /** @description Sort direction. Acceptable values are: `asc`, `desc`. * */ readonly direction?: "asc" | "desc"; /** @description Filters list of scripts by the associated channel ID. */ readonly "channel_id:in"?: readonly number[]; }; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { readonly 200: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { readonly data?: readonly components["schemas"]["script_Full"][]; readonly meta?: components["schemas"]["CollectionMeta"]; }; }; }; /** @description This is the result of missing required fields, or of invalid data. See the response for more details. * */ readonly 422: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { readonly errors?: { readonly [key: string]: unknown; }; }; }; }; }; }; readonly createScript: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly "Content-Type"?: components["parameters"]["ContentType"]; }; readonly path?: never; readonly cookie?: never; }; readonly requestBody: { readonly content: { readonly "application/json": components["schemas"]["script_Post"]; }; }; readonly responses: { readonly 200: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["script_Response"]; }; }; /** @description This is the result of missing required fields, or of invalid data. See the response for more details. * */ readonly 422: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { /** DetailedErrors */ readonly errors?: { readonly [key: string]: unknown; }; }; }; }; }; }; readonly getScript: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path: { /** @description The identifier for a specific script. */ readonly uuid: components["parameters"]["ScriptUUID"]; }; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { /** @description Success */ readonly 200: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["script_Response"]; }; }; /** @description The resource was not found. * */ readonly 404: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { /** DetailedErrors */ readonly errors?: { readonly [key: string]: unknown; }; }; }; }; /** @description This is the result of missing required fields, or of invalid data. See the response for more details. * */ readonly 422: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { /** DetailedErrors */ readonly errors?: { readonly [key: string]: unknown; }; }; }; }; }; }; readonly updateScript: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly "Content-Type"?: components["parameters"]["ContentType"]; }; readonly path: { /** @description The identifier for a specific script. */ readonly uuid: components["parameters"]["ScriptUUID"]; }; readonly cookie?: never; }; readonly requestBody: { readonly content: { readonly "application/json": components["schemas"]["script_Put"]; }; }; readonly responses: { readonly 200: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["script_Response"]; }; }; /** @description The resource was not found. * */ readonly 404: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { /** DetailedErrors */ readonly errors?: { readonly [key: string]: unknown; }; }; }; }; /** @description This is the result of missing required fields, or of invalid data. See the response for more details. * */ readonly 422: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { /** DetailedErrors */ readonly errors?: { readonly [key: string]: unknown; }; }; }; }; }; }; readonly deleteScript: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path: { /** @description The identifier for a specific script. */ readonly uuid: components["parameters"]["ScriptUUID"]; }; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { readonly 204: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["NoContent"]; }; }; /** @description The resource was not found. */ readonly 404: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { /** DetailedErrors */ readonly errors?: { readonly [key: string]: unknown; }; }; }; }; /** @description This is the result of missing required fields, or of invalid data. See the response for more details. */ readonly 422: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; readonly instance?: string; } & { /** DetailedErrors */ readonly errors?: { readonly [key: string]: unknown; }; }; }; }; }; }; }