diff --git a/package.json b/package.json index 4d45d2bb..935f0d14 100644 --- a/package.json +++ b/package.json @@ -12,30 +12,29 @@ "test": "jest" }, "dependencies": { - "crypto-browserify": "^3.12.0", + "url-join": "4.0.1", "form-data": "^4.0.0", "formdata-node": "^6.0.3", - "js-base64": "3.7.2", "node-fetch": "2.7.0", "qs": "6.11.2", "readable-stream": "^4.5.2", - "url-join": "4.0.1" + "js-base64": "3.7.2", + "crypto-browserify": "^3.12.0" }, "devDependencies": { - "@types/jest": "29.5.5", - "@types/node": "17.0.33", - "@types/node-fetch": "2.6.9", + "@types/url-join": "4.0.1", "@types/qs": "6.9.8", + "@types/node-fetch": "2.6.9", "@types/readable-stream": "^4.0.15", - "@types/url-join": "4.0.1", + "webpack": "^5.94.0", + "ts-loader": "^9.3.1", "jest": "29.7.0", + "@types/jest": "29.5.5", + "ts-jest": "29.1.1", "jest-environment-jsdom": "29.7.0", - "jest-fetch-mock": "^3.0.3", + "@types/node": "17.0.33", "prettier": "2.7.1", - "ts-jest": "29.1.1", - "ts-loader": "^9.3.1", - "typescript": "4.6.4", - "webpack": "^5.94.0" + "typescript": "4.6.4" }, "browser": { "fs": false, diff --git a/reference.md b/reference.md index e42db5f3..84b5c97f 100644 --- a/reference.md +++ b/reference.md @@ -5192,6 +5192,7 @@ Required scope | `cms:write` ```typescript await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + id: "562ac0395358780a1f5e6fbc", isEditable: true, isRequired: false, type: "RichText", @@ -5859,6 +5860,9 @@ Required scope | `CMS:write` ```typescript await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", isArchived: false, isDraft: false, fieldData: { diff --git a/src/api/resources/collections/resources/fields/client/Client.ts b/src/api/resources/collections/resources/fields/client/Client.ts index e7a7198e..8f8fac40 100644 --- a/src/api/resources/collections/resources/fields/client/Client.ts +++ b/src/api/resources/collections/resources/fields/client/Client.ts @@ -53,6 +53,7 @@ export class Fields { * * @example * await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + * id: "562ac0395358780a1f5e6fbc", * isEditable: true, * isRequired: false, * type: "RichText", @@ -62,6 +63,7 @@ export class Fields { * * @example * await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + * id: "562ac0395358780a1f5e6fbc", * isEditable: true, * isRequired: false, * type: "Option", @@ -80,6 +82,7 @@ export class Fields { * * @example * await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { + * id: "562ac0395358780a1f5e6fbd", * isEditable: true, * isRequired: false, * type: "Reference", diff --git a/src/api/resources/collections/resources/items/client/Client.ts b/src/api/resources/collections/resources/items/client/Client.ts index 75ef8ec9..c01b0df9 100644 --- a/src/api/resources/collections/resources/items/client/Client.ts +++ b/src/api/resources/collections/resources/items/client/Client.ts @@ -841,6 +841,9 @@ export class Items { * * @example * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + * lastPublished: "2023-03-17T18:47:35.560Z", + * lastUpdated: "2023-03-17T18:47:35.560Z", + * createdOn: "2023-03-17T18:47:35.560Z", * isArchived: false, * isDraft: false, * fieldData: { @@ -852,6 +855,9 @@ export class Items { * @example * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { * items: [{ + * lastPublished: "2023-03-17T18:47:35.560Z", + * lastUpdated: "2023-03-17T18:47:35.560Z", + * createdOn: "2023-03-17T18:47:35.560Z", * isArchived: false, * isDraft: false, * fieldData: { @@ -859,6 +865,9 @@ export class Items { * slug: "senior-data-analyst" * } * }, { + * lastPublished: "2023-03-17T18:47:35.560Z", + * lastUpdated: "2023-03-17T18:47:35.560Z", + * createdOn: "2023-03-17T18:47:35.560Z", * isArchived: false, * isDraft: false, * fieldData: { diff --git a/src/api/resources/products/types/ProductsCreateSkuResponse.ts b/src/api/resources/products/types/ProductsCreateSkuResponse.ts index 0f1f0c50..c0a565fa 100644 --- a/src/api/resources/products/types/ProductsCreateSkuResponse.ts +++ b/src/api/resources/products/types/ProductsCreateSkuResponse.ts @@ -5,5 +5,5 @@ import * as Webflow from "../../../index"; export interface ProductsCreateSkuResponse { - skus?: Webflow.Sku[]; + skus: Webflow.Sku[]; } diff --git a/src/api/types/Asset.ts b/src/api/types/Asset.ts index 3b875559..54c7a8b0 100644 --- a/src/api/types/Asset.ts +++ b/src/api/types/Asset.ts @@ -9,25 +9,25 @@ import * as Webflow from "../index"; */ export interface Asset { /** Unique identifier for this asset */ - id?: string; + id: string; /** File format type */ - contentType?: string; + contentType: string; /** size in bytes */ - size?: number; + size: number; /** Unique identifier for the site that hosts this asset */ - siteId?: string; + siteId: string; /** Link to the asset */ - hostedUrl?: string; + hostedUrl: string; /** Original file name at the time of upload */ - originalFileName?: string; + originalFileName: string; /** Display name of the asset */ - displayName?: string; + displayName: string; /** Date the asset metadata was last updated */ - lastUpdated?: Date; + lastUpdated: Date; /** Date the asset metadata was created */ - createdOn?: Date; + createdOn: Date; /** A list of [asset variants](https://help.webflow.com/hc/en-us/articles/33961378697107-Responsive-images) created by Webflow to serve your site responsively. */ - variants?: Webflow.AssetVariant[]; + variants: Webflow.AssetVariant[]; /** The visual description of the asset */ altText?: string; } diff --git a/src/api/types/AssetVariant.ts b/src/api/types/AssetVariant.ts index 2f5052d8..7d2c25c8 100644 --- a/src/api/types/AssetVariant.ts +++ b/src/api/types/AssetVariant.ts @@ -7,19 +7,19 @@ */ export interface AssetVariant { /** URL of where the asset variant is hosted */ - hostedUrl?: string; + hostedUrl: string; /** Original file name of the variant */ - originalFileName?: string; + originalFileName: string; /** Display name of the variant */ - displayName?: string; + displayName: string; /** format of the variant */ - format?: string; + format: string; /** Width in pixels */ - width?: number; + width: number; /** Height in pixels */ - height?: number; + height: number; /** Value between 0 and 100 representing the image quality */ - quality?: number; + quality: number; /** Any associated validation errors */ error?: string; } diff --git a/src/api/types/Collection.ts b/src/api/types/Collection.ts index 1dba545f..5214eec9 100644 --- a/src/api/types/Collection.ts +++ b/src/api/types/Collection.ts @@ -11,9 +11,9 @@ export interface Collection { /** Unique identifier for a Collection */ id: string; /** Name given to the Collection */ - displayName?: string; + displayName: string; /** The name of one Item in Collection (e.g. ”Blog Post” if the Collection is called “Blog Posts”) */ - singularName?: string; + singularName: string; /** Slug of Collection in Site URL structure */ slug?: string; /** The date the collection was created */ diff --git a/src/api/types/CollectionItem.ts b/src/api/types/CollectionItem.ts index 2783d84b..67536fe9 100644 --- a/src/api/types/CollectionItem.ts +++ b/src/api/types/CollectionItem.ts @@ -17,11 +17,11 @@ export interface CollectionItem { /** Identifier for the locale of the CMS item */ cmsLocaleId?: string; /** The date the item was last published */ - lastPublished?: string; + lastPublished: string; /** The date the item was last updated */ - lastUpdated?: string; + lastUpdated: string; /** The date the item was created */ - createdOn?: string; + createdOn: string; /** Boolean determining if the Item is set to archived */ isArchived?: boolean; /** Boolean determining if the Item is set to draft */ diff --git a/src/api/types/ComponentNode.ts b/src/api/types/ComponentNode.ts index 33b9349c..6b1d4a62 100644 --- a/src/api/types/ComponentNode.ts +++ b/src/api/types/ComponentNode.ts @@ -9,9 +9,9 @@ import * as Webflow from "../index"; */ export interface ComponentNode { /** The unique identifier of the component instance node */ - id?: string; + id: string; /** The unique identifier of the component */ - componentId?: string; + componentId: string; /** List of component properties with overrides for a component instance. */ - propertyOverrides?: Webflow.ComponentProperty[]; + propertyOverrides: Webflow.ComponentProperty[]; } diff --git a/src/api/types/ImageNode.ts b/src/api/types/ImageNode.ts index fa70785b..8134be46 100644 --- a/src/api/types/ImageNode.ts +++ b/src/api/types/ImageNode.ts @@ -9,9 +9,9 @@ import * as Webflow from "../index"; */ export interface ImageNode { /** Node UUID */ - id?: string; + id: string; /** The image details of the node */ - image?: Webflow.ImageNodeImage; + image: Webflow.ImageNodeImage; /** The custom attributes of the node */ attributes?: Record; } diff --git a/src/api/types/Pagination.ts b/src/api/types/Pagination.ts index 1ee7cd06..3f34a0c1 100644 --- a/src/api/types/Pagination.ts +++ b/src/api/types/Pagination.ts @@ -7,9 +7,9 @@ */ export interface Pagination { /** The limit used for pagination */ - limit?: number; + limit: number; /** The offset used for pagination */ - offset?: number; + offset: number; /** The total number of records */ - total?: number; + total: number; } diff --git a/src/api/types/TextNode.ts b/src/api/types/TextNode.ts index cbd68242..13015905 100644 --- a/src/api/types/TextNode.ts +++ b/src/api/types/TextNode.ts @@ -9,9 +9,9 @@ import * as Webflow from "../index"; */ export interface TextNode { /** Node UUID */ - id?: string; + id: string; /** The text content of the node */ - text?: Webflow.TextNodeText; + text: Webflow.TextNodeText; /** The custom attributes of the node */ attributes?: Record; } diff --git a/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts b/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts index 4ca5e4a7..c92b5e4e 100644 --- a/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts +++ b/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts @@ -11,11 +11,11 @@ export const ProductsCreateSkuResponse: core.serialization.ObjectSchema< serializers.ProductsCreateSkuResponse.Raw, Webflow.ProductsCreateSkuResponse > = core.serialization.object({ - skus: core.serialization.list(Sku).optional(), + skus: core.serialization.list(Sku), }); export declare namespace ProductsCreateSkuResponse { interface Raw { - skus?: Sku.Raw[] | null; + skus: Sku.Raw[]; } } diff --git a/src/serialization/types/Asset.ts b/src/serialization/types/Asset.ts index 12f39e6a..7a3f5c8d 100644 --- a/src/serialization/types/Asset.ts +++ b/src/serialization/types/Asset.ts @@ -8,31 +8,31 @@ import * as core from "../../core"; import { AssetVariant } from "./AssetVariant"; export const Asset: core.serialization.ObjectSchema = core.serialization.object({ - id: core.serialization.string().optional(), - contentType: core.serialization.string().optional(), - size: core.serialization.number().optional(), - siteId: core.serialization.string().optional(), - hostedUrl: core.serialization.string().optional(), - originalFileName: core.serialization.string().optional(), - displayName: core.serialization.string().optional(), - lastUpdated: core.serialization.date().optional(), - createdOn: core.serialization.date().optional(), - variants: core.serialization.list(AssetVariant).optional(), + id: core.serialization.string(), + contentType: core.serialization.string(), + size: core.serialization.number(), + siteId: core.serialization.string(), + hostedUrl: core.serialization.string(), + originalFileName: core.serialization.string(), + displayName: core.serialization.string(), + lastUpdated: core.serialization.date(), + createdOn: core.serialization.date(), + variants: core.serialization.list(AssetVariant), altText: core.serialization.string().optional(), }); export declare namespace Asset { interface Raw { - id?: string | null; - contentType?: string | null; - size?: number | null; - siteId?: string | null; - hostedUrl?: string | null; - originalFileName?: string | null; - displayName?: string | null; - lastUpdated?: string | null; - createdOn?: string | null; - variants?: AssetVariant.Raw[] | null; + id: string; + contentType: string; + size: number; + siteId: string; + hostedUrl: string; + originalFileName: string; + displayName: string; + lastUpdated: string; + createdOn: string; + variants: AssetVariant.Raw[]; altText?: string | null; } } diff --git a/src/serialization/types/AssetVariant.ts b/src/serialization/types/AssetVariant.ts index 094173b7..64b5f71a 100644 --- a/src/serialization/types/AssetVariant.ts +++ b/src/serialization/types/AssetVariant.ts @@ -8,25 +8,25 @@ import * as core from "../../core"; export const AssetVariant: core.serialization.ObjectSchema = core.serialization.object({ - hostedUrl: core.serialization.string().optional(), - originalFileName: core.serialization.string().optional(), - displayName: core.serialization.string().optional(), - format: core.serialization.string().optional(), - width: core.serialization.number().optional(), - height: core.serialization.number().optional(), - quality: core.serialization.number().optional(), + hostedUrl: core.serialization.string(), + originalFileName: core.serialization.string(), + displayName: core.serialization.string(), + format: core.serialization.string(), + width: core.serialization.number(), + height: core.serialization.number(), + quality: core.serialization.number(), error: core.serialization.string().optional(), }); export declare namespace AssetVariant { interface Raw { - hostedUrl?: string | null; - originalFileName?: string | null; - displayName?: string | null; - format?: string | null; - width?: number | null; - height?: number | null; - quality?: number | null; + hostedUrl: string; + originalFileName: string; + displayName: string; + format: string; + width: number; + height: number; + quality: number; error?: string | null; } } diff --git a/src/serialization/types/Collection.ts b/src/serialization/types/Collection.ts index 5e5b5e66..fd55335c 100644 --- a/src/serialization/types/Collection.ts +++ b/src/serialization/types/Collection.ts @@ -10,8 +10,8 @@ import { Field } from "./Field"; export const Collection: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string(), - displayName: core.serialization.string().optional(), - singularName: core.serialization.string().optional(), + displayName: core.serialization.string(), + singularName: core.serialization.string(), slug: core.serialization.string().optional(), createdOn: core.serialization.date().optional(), lastUpdated: core.serialization.date().optional(), @@ -21,8 +21,8 @@ export const Collection: core.serialization.ObjectSchema = core.serialization.object({ - id: core.serialization.string().optional(), - componentId: core.serialization.string().optional(), - propertyOverrides: core.serialization.list(ComponentProperty).optional(), + id: core.serialization.string(), + componentId: core.serialization.string(), + propertyOverrides: core.serialization.list(ComponentProperty), }); export declare namespace ComponentNode { interface Raw { - id?: string | null; - componentId?: string | null; - propertyOverrides?: ComponentProperty.Raw[] | null; + id: string; + componentId: string; + propertyOverrides: ComponentProperty.Raw[]; } } diff --git a/src/serialization/types/ImageNode.ts b/src/serialization/types/ImageNode.ts index b83e26f9..f08975ab 100644 --- a/src/serialization/types/ImageNode.ts +++ b/src/serialization/types/ImageNode.ts @@ -9,15 +9,15 @@ import { ImageNodeImage } from "./ImageNodeImage"; export const ImageNode: core.serialization.ObjectSchema = core.serialization.object({ - id: core.serialization.string().optional(), - image: ImageNodeImage.optional(), + id: core.serialization.string(), + image: ImageNodeImage, attributes: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), }); export declare namespace ImageNode { interface Raw { - id?: string | null; - image?: ImageNodeImage.Raw | null; + id: string; + image: ImageNodeImage.Raw; attributes?: Record | null; } } diff --git a/src/serialization/types/Pagination.ts b/src/serialization/types/Pagination.ts index 4d81b8f8..cd186256 100644 --- a/src/serialization/types/Pagination.ts +++ b/src/serialization/types/Pagination.ts @@ -8,15 +8,15 @@ import * as core from "../../core"; export const Pagination: core.serialization.ObjectSchema = core.serialization.object({ - limit: core.serialization.number().optional(), - offset: core.serialization.number().optional(), - total: core.serialization.number().optional(), + limit: core.serialization.number(), + offset: core.serialization.number(), + total: core.serialization.number(), }); export declare namespace Pagination { interface Raw { - limit?: number | null; - offset?: number | null; - total?: number | null; + limit: number; + offset: number; + total: number; } } diff --git a/src/serialization/types/TextNode.ts b/src/serialization/types/TextNode.ts index b97e6956..4da979ac 100644 --- a/src/serialization/types/TextNode.ts +++ b/src/serialization/types/TextNode.ts @@ -9,15 +9,15 @@ import { TextNodeText } from "./TextNodeText"; export const TextNode: core.serialization.ObjectSchema = core.serialization.object({ - id: core.serialization.string().optional(), - text: TextNodeText.optional(), + id: core.serialization.string(), + text: TextNodeText, attributes: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), }); export declare namespace TextNode { interface Raw { - id?: string | null; - text?: TextNodeText.Raw | null; + id: string; + text: TextNodeText.Raw; attributes?: Record | null; } } diff --git a/yarn.lock b/yarn.lock index 2aa2fd18..f64da0bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1329,13 +1329,6 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -cross-fetch@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.2.0.tgz#34e9192f53bc757d6614304d9e5e6fb4edb782e3" - integrity sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q== - dependencies: - node-fetch "^2.7.0" - cross-spawn@^7.0.3: version "7.0.6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" @@ -1460,9 +1453,9 @@ dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.149: - version "1.5.152" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.152.tgz#bcdd39567e291b930ec26b930031137a05593695" - integrity sha512-xBOfg/EBaIlVsHipHl2VdTPJRSvErNUaqW8ejTq5OlOlIYx1wOllCHsAvAIrr55jD1IYEfdR86miUEt8H5IeJg== + version "1.5.154" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.154.tgz#82430d66848efef703a3b643fb2a682bd08ae26b" + integrity sha512-G4VCFAyKbp1QJ+sWdXYIRYsPGvlV5sDACfCmoMFog3rjm1syLhI41WXm/swZypwCIWIm4IFLWzHY14joWMQ5Fw== elliptic@^6.5.3, elliptic@^6.5.5: version "6.6.1" @@ -2151,14 +2144,6 @@ jest-environment-node@^29.7.0: jest-mock "^29.7.0" jest-util "^29.7.0" -jest-fetch-mock@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/jest-fetch-mock/-/jest-fetch-mock-3.0.3.tgz#31749c456ae27b8919d69824f1c2bd85fe0a1f3b" - integrity sha512-Ux1nWprtLrdrH4XwE7O7InRY6psIi3GOsqNESJgMJ+M5cv4A8Lh7SN9d2V2kKRZ8ebAfcd1LNyZguAOb6JiDqw== - dependencies: - cross-fetch "^3.0.4" - promise-polyfill "^8.1.3" - jest-get-type@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" @@ -2618,7 +2603,7 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -node-fetch@2.7.0, node-fetch@^2.7.0: +node-fetch@2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -2803,11 +2788,6 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== -promise-polyfill@^8.1.3: - version "8.3.0" - resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.3.0.tgz#9284810268138d103807b11f4e23d5e945a4db63" - integrity sha512-H5oELycFml5yto/atYqmjyigJoAo3+OXwolYiH7OfQuYlAqhxNvTfiNMbV9hsC6Yp83yE5r2KTVmtrG6R9i6Pg== - prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069"