Skip to content

Commit

Permalink
(chore): disable response validation
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] authored Mar 13, 2024
1 parent 2e0d0d7 commit 4acf657
Show file tree
Hide file tree
Showing 29 changed files with 293 additions and 100 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webflow-api",
"version": "v2.1.1",
"version": "2.1.2",
"private": false,
"repository": "https://github.com/webflow/js-webflow-api",
"main": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/accessGroups/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class AccessGroups {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
16 changes: 8 additions & 8 deletions src/api/resources/assets/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -129,7 +129,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -205,7 +205,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -280,7 +280,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -355,7 +355,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -431,7 +431,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -513,7 +513,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -592,7 +592,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/collections/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -131,7 +131,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -207,7 +207,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -282,7 +282,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -355,7 +355,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Fields {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -140,7 +140,7 @@ export class Fields {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
107 changes: 96 additions & 11 deletions src/api/resources/collections/resources/items/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -123,7 +123,7 @@ export class Items {
}

/**
* Create Item in a Collection. </br></br> Required scope | `CMS:write`
* Create Item in a Collection.</br></br> To create items across multiple locales, <a href="https://developers.webflow.com/data/reference/create-item-for-multiple-locales"> please use this endpoint.</a> </br></br> Required scope | `CMS:write`
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
* @throws {@link Webflow.NotFoundError}
Expand Down Expand Up @@ -158,7 +158,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -207,7 +207,7 @@ export class Items {
}

/**
* Create live Item in a Collection. This Item will be published to the live site. </br></br> Required scope | `CMS:write`
* Create live Item in a Collection. This Item will be published to the live site. </br></br> To create items across multiple locales, <a href="https://developers.webflow.com/data/reference/create-item-for-multiple-locales"> please use this endpoint.</a> </br></br> Required scope | `CMS:write`
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
* @throws {@link Webflow.NotFoundError}
Expand Down Expand Up @@ -242,7 +242,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -290,6 +290,91 @@ export class Items {
}
}

/**
* Create single Item in a Collection with multiple corresponding locales. </br></br> Required scope | `CMS:write`
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
* @throws {@link Webflow.NotFoundError}
* @throws {@link Webflow.TooManyRequestsError}
* @throws {@link Webflow.InternalServerError}
*
* @example
* await webflow.collections.items.createItemForMultipleLocales("collection_id", {
* id: "580e64008c9a982ac9b8b754",
* lastPublished: "2023-03-17T18:47:35.560Z",
* lastUpdated: "2023-03-17T18:47:35.560Z",
* createdOn: "2023-03-17T18:47:35.560Z",
* fieldData: {
* name: "My new item",
* slug: "my-new-item"
* }
* })
*/
public async createItemForMultipleLocales(
collectionId: string,
request: Webflow.collections.BulkCollectionItem,
requestOptions?: Items.RequestOptions
): Promise<void> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default,
`collections/${collectionId}/items/bulk`
),
method: "POST",
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.collections.BulkCollectionItem.jsonOrThrow(request, {
unrecognizedObjectKeys: "strip",
}),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
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);
case 429:
throw new Webflow.TooManyRequestsError(_response.error.body);
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,
});
}
}

/**
* Get details of a selected Collection Item. </br></br> Required scope | `CMS:read`
* @throws {@link Webflow.BadRequestError}
Expand Down Expand Up @@ -323,7 +408,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -414,7 +499,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -499,7 +584,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -579,7 +664,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -663,7 +748,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -745,7 +830,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.1.1",
"X-Fern-SDK-Version": "2.1.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Webflow from "../../../../../..";

/**
* @example
* {
* id: "580e64008c9a982ac9b8b754",
* lastPublished: "2023-03-17T18:47:35.560Z",
* lastUpdated: "2023-03-17T18:47:35.560Z",
* createdOn: "2023-03-17T18:47:35.560Z",
* fieldData: {
* name: "My new item",
* slug: "my-new-item"
* }
* }
*/
export interface BulkCollectionItem {
/** Unique identifier for the Item */
id: string;
/** Array of identifiers for the locales where the item will be crated */
cmsLocaleIds?: 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.collections.BulkCollectionItemFieldData;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { ItemsListItemsRequest } from "./ItemsListItemsRequest";
export { BulkCollectionItem } from "./BulkCollectionItem";
export { ItemsGetItemRequest } from "./ItemsGetItemRequest";
export { ItemsDeleteItemRequest } from "./ItemsDeleteItemRequest";
export { ItemsPublishItemRequest } from "./ItemsPublishItemRequest";
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface BulkCollectionItemFieldData {
/** 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;
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./BulkCollectionItemFieldData";
export * from "./ItemsPublishItemResponse";
Loading

0 comments on commit 4acf657

Please sign in to comment.