Skip to content

Commit 4acf657

Browse files
(chore): disable response validation
1 parent 2e0d0d7 commit 4acf657

File tree

29 files changed

+293
-100
lines changed

29 files changed

+293
-100
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webflow-api",
3-
"version": "v2.1.1",
3+
"version": "2.1.2",
44
"private": false,
55
"repository": "https://github.com/webflow/js-webflow-api",
66
"main": "./index.js",

src/api/resources/accessGroups/client/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class AccessGroups {
6565
Authorization: await this._getAuthorizationHeader(),
6666
"X-Fern-Language": "JavaScript",
6767
"X-Fern-SDK-Name": "webflow-api",
68-
"X-Fern-SDK-Version": "v2.1.1",
68+
"X-Fern-SDK-Version": "2.1.2",
6969
"X-Fern-Runtime": core.RUNTIME.type,
7070
"X-Fern-Runtime-Version": core.RUNTIME.version,
7171
},

src/api/resources/assets/client/Client.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class Assets {
4646
Authorization: await this._getAuthorizationHeader(),
4747
"X-Fern-Language": "JavaScript",
4848
"X-Fern-SDK-Name": "webflow-api",
49-
"X-Fern-SDK-Version": "v2.1.1",
49+
"X-Fern-SDK-Version": "2.1.2",
5050
"X-Fern-Runtime": core.RUNTIME.type,
5151
"X-Fern-Runtime-Version": core.RUNTIME.version,
5252
},
@@ -129,7 +129,7 @@ export class Assets {
129129
Authorization: await this._getAuthorizationHeader(),
130130
"X-Fern-Language": "JavaScript",
131131
"X-Fern-SDK-Name": "webflow-api",
132-
"X-Fern-SDK-Version": "v2.1.1",
132+
"X-Fern-SDK-Version": "2.1.2",
133133
"X-Fern-Runtime": core.RUNTIME.type,
134134
"X-Fern-Runtime-Version": core.RUNTIME.version,
135135
},
@@ -205,7 +205,7 @@ export class Assets {
205205
Authorization: await this._getAuthorizationHeader(),
206206
"X-Fern-Language": "JavaScript",
207207
"X-Fern-SDK-Name": "webflow-api",
208-
"X-Fern-SDK-Version": "v2.1.1",
208+
"X-Fern-SDK-Version": "2.1.2",
209209
"X-Fern-Runtime": core.RUNTIME.type,
210210
"X-Fern-Runtime-Version": core.RUNTIME.version,
211211
},
@@ -280,7 +280,7 @@ export class Assets {
280280
Authorization: await this._getAuthorizationHeader(),
281281
"X-Fern-Language": "JavaScript",
282282
"X-Fern-SDK-Name": "webflow-api",
283-
"X-Fern-SDK-Version": "v2.1.1",
283+
"X-Fern-SDK-Version": "2.1.2",
284284
"X-Fern-Runtime": core.RUNTIME.type,
285285
"X-Fern-Runtime-Version": core.RUNTIME.version,
286286
},
@@ -355,7 +355,7 @@ export class Assets {
355355
Authorization: await this._getAuthorizationHeader(),
356356
"X-Fern-Language": "JavaScript",
357357
"X-Fern-SDK-Name": "webflow-api",
358-
"X-Fern-SDK-Version": "v2.1.1",
358+
"X-Fern-SDK-Version": "2.1.2",
359359
"X-Fern-Runtime": core.RUNTIME.type,
360360
"X-Fern-Runtime-Version": core.RUNTIME.version,
361361
},
@@ -431,7 +431,7 @@ export class Assets {
431431
Authorization: await this._getAuthorizationHeader(),
432432
"X-Fern-Language": "JavaScript",
433433
"X-Fern-SDK-Name": "webflow-api",
434-
"X-Fern-SDK-Version": "v2.1.1",
434+
"X-Fern-SDK-Version": "2.1.2",
435435
"X-Fern-Runtime": core.RUNTIME.type,
436436
"X-Fern-Runtime-Version": core.RUNTIME.version,
437437
},
@@ -513,7 +513,7 @@ export class Assets {
513513
Authorization: await this._getAuthorizationHeader(),
514514
"X-Fern-Language": "JavaScript",
515515
"X-Fern-SDK-Name": "webflow-api",
516-
"X-Fern-SDK-Version": "v2.1.1",
516+
"X-Fern-SDK-Version": "2.1.2",
517517
"X-Fern-Runtime": core.RUNTIME.type,
518518
"X-Fern-Runtime-Version": core.RUNTIME.version,
519519
},
@@ -592,7 +592,7 @@ export class Assets {
592592
Authorization: await this._getAuthorizationHeader(),
593593
"X-Fern-Language": "JavaScript",
594594
"X-Fern-SDK-Name": "webflow-api",
595-
"X-Fern-SDK-Version": "v2.1.1",
595+
"X-Fern-SDK-Version": "2.1.2",
596596
"X-Fern-Runtime": core.RUNTIME.type,
597597
"X-Fern-Runtime-Version": core.RUNTIME.version,
598598
},

src/api/resources/collections/client/Client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class Collections {
4848
Authorization: await this._getAuthorizationHeader(),
4949
"X-Fern-Language": "JavaScript",
5050
"X-Fern-SDK-Name": "webflow-api",
51-
"X-Fern-SDK-Version": "v2.1.1",
51+
"X-Fern-SDK-Version": "2.1.2",
5252
"X-Fern-Runtime": core.RUNTIME.type,
5353
"X-Fern-Runtime-Version": core.RUNTIME.version,
5454
},
@@ -131,7 +131,7 @@ export class Collections {
131131
Authorization: await this._getAuthorizationHeader(),
132132
"X-Fern-Language": "JavaScript",
133133
"X-Fern-SDK-Name": "webflow-api",
134-
"X-Fern-SDK-Version": "v2.1.1",
134+
"X-Fern-SDK-Version": "2.1.2",
135135
"X-Fern-Runtime": core.RUNTIME.type,
136136
"X-Fern-Runtime-Version": core.RUNTIME.version,
137137
},
@@ -207,7 +207,7 @@ export class Collections {
207207
Authorization: await this._getAuthorizationHeader(),
208208
"X-Fern-Language": "JavaScript",
209209
"X-Fern-SDK-Name": "webflow-api",
210-
"X-Fern-SDK-Version": "v2.1.1",
210+
"X-Fern-SDK-Version": "2.1.2",
211211
"X-Fern-Runtime": core.RUNTIME.type,
212212
"X-Fern-Runtime-Version": core.RUNTIME.version,
213213
},
@@ -282,7 +282,7 @@ export class Collections {
282282
Authorization: await this._getAuthorizationHeader(),
283283
"X-Fern-Language": "JavaScript",
284284
"X-Fern-SDK-Name": "webflow-api",
285-
"X-Fern-SDK-Version": "v2.1.1",
285+
"X-Fern-SDK-Version": "2.1.2",
286286
"X-Fern-Runtime": core.RUNTIME.type,
287287
"X-Fern-Runtime-Version": core.RUNTIME.version,
288288
},
@@ -355,7 +355,7 @@ export class Collections {
355355
Authorization: await this._getAuthorizationHeader(),
356356
"X-Fern-Language": "JavaScript",
357357
"X-Fern-SDK-Name": "webflow-api",
358-
"X-Fern-SDK-Version": "v2.1.1",
358+
"X-Fern-SDK-Version": "2.1.2",
359359
"X-Fern-Runtime": core.RUNTIME.type,
360360
"X-Fern-Runtime-Version": core.RUNTIME.version,
361361
},

src/api/resources/collections/resources/fields/client/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class Fields {
5555
Authorization: await this._getAuthorizationHeader(),
5656
"X-Fern-Language": "JavaScript",
5757
"X-Fern-SDK-Name": "webflow-api",
58-
"X-Fern-SDK-Version": "v2.1.1",
58+
"X-Fern-SDK-Version": "2.1.2",
5959
"X-Fern-Runtime": core.RUNTIME.type,
6060
"X-Fern-Runtime-Version": core.RUNTIME.version,
6161
},
@@ -140,7 +140,7 @@ export class Fields {
140140
Authorization: await this._getAuthorizationHeader(),
141141
"X-Fern-Language": "JavaScript",
142142
"X-Fern-SDK-Name": "webflow-api",
143-
"X-Fern-SDK-Version": "v2.1.1",
143+
"X-Fern-SDK-Version": "2.1.2",
144144
"X-Fern-Runtime": core.RUNTIME.type,
145145
"X-Fern-Runtime-Version": core.RUNTIME.version,
146146
},

src/api/resources/collections/resources/items/client/Client.ts

Lines changed: 96 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class Items {
6868
Authorization: await this._getAuthorizationHeader(),
6969
"X-Fern-Language": "JavaScript",
7070
"X-Fern-SDK-Name": "webflow-api",
71-
"X-Fern-SDK-Version": "v2.1.1",
71+
"X-Fern-SDK-Version": "2.1.2",
7272
"X-Fern-Runtime": core.RUNTIME.type,
7373
"X-Fern-Runtime-Version": core.RUNTIME.version,
7474
},
@@ -123,7 +123,7 @@ export class Items {
123123
}
124124

125125
/**
126-
* Create Item in a Collection. </br></br> Required scope | `CMS:write`
126+
* 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`
127127
* @throws {@link Webflow.BadRequestError}
128128
* @throws {@link Webflow.UnauthorizedError}
129129
* @throws {@link Webflow.NotFoundError}
@@ -158,7 +158,7 @@ export class Items {
158158
Authorization: await this._getAuthorizationHeader(),
159159
"X-Fern-Language": "JavaScript",
160160
"X-Fern-SDK-Name": "webflow-api",
161-
"X-Fern-SDK-Version": "v2.1.1",
161+
"X-Fern-SDK-Version": "2.1.2",
162162
"X-Fern-Runtime": core.RUNTIME.type,
163163
"X-Fern-Runtime-Version": core.RUNTIME.version,
164164
},
@@ -207,7 +207,7 @@ export class Items {
207207
}
208208

209209
/**
210-
* Create live Item in a Collection. This Item will be published to the live site. </br></br> Required scope | `CMS:write`
210+
* 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`
211211
* @throws {@link Webflow.BadRequestError}
212212
* @throws {@link Webflow.UnauthorizedError}
213213
* @throws {@link Webflow.NotFoundError}
@@ -242,7 +242,7 @@ export class Items {
242242
Authorization: await this._getAuthorizationHeader(),
243243
"X-Fern-Language": "JavaScript",
244244
"X-Fern-SDK-Name": "webflow-api",
245-
"X-Fern-SDK-Version": "v2.1.1",
245+
"X-Fern-SDK-Version": "2.1.2",
246246
"X-Fern-Runtime": core.RUNTIME.type,
247247
"X-Fern-Runtime-Version": core.RUNTIME.version,
248248
},
@@ -290,6 +290,91 @@ export class Items {
290290
}
291291
}
292292

293+
/**
294+
* Create single Item in a Collection with multiple corresponding locales. </br></br> Required scope | `CMS:write`
295+
* @throws {@link Webflow.BadRequestError}
296+
* @throws {@link Webflow.UnauthorizedError}
297+
* @throws {@link Webflow.NotFoundError}
298+
* @throws {@link Webflow.TooManyRequestsError}
299+
* @throws {@link Webflow.InternalServerError}
300+
*
301+
* @example
302+
* await webflow.collections.items.createItemForMultipleLocales("collection_id", {
303+
* id: "580e64008c9a982ac9b8b754",
304+
* lastPublished: "2023-03-17T18:47:35.560Z",
305+
* lastUpdated: "2023-03-17T18:47:35.560Z",
306+
* createdOn: "2023-03-17T18:47:35.560Z",
307+
* fieldData: {
308+
* name: "My new item",
309+
* slug: "my-new-item"
310+
* }
311+
* })
312+
*/
313+
public async createItemForMultipleLocales(
314+
collectionId: string,
315+
request: Webflow.collections.BulkCollectionItem,
316+
requestOptions?: Items.RequestOptions
317+
): Promise<void> {
318+
const _response = await core.fetcher({
319+
url: urlJoin(
320+
(await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default,
321+
`collections/${collectionId}/items/bulk`
322+
),
323+
method: "POST",
324+
headers: {
325+
Authorization: await this._getAuthorizationHeader(),
326+
"X-Fern-Language": "JavaScript",
327+
"X-Fern-SDK-Name": "webflow-api",
328+
"X-Fern-SDK-Version": "2.1.2",
329+
"X-Fern-Runtime": core.RUNTIME.type,
330+
"X-Fern-Runtime-Version": core.RUNTIME.version,
331+
},
332+
contentType: "application/json",
333+
body: await serializers.collections.BulkCollectionItem.jsonOrThrow(request, {
334+
unrecognizedObjectKeys: "strip",
335+
}),
336+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
337+
maxRetries: requestOptions?.maxRetries,
338+
});
339+
if (_response.ok) {
340+
return;
341+
}
342+
343+
if (_response.error.reason === "status-code") {
344+
switch (_response.error.statusCode) {
345+
case 400:
346+
throw new Webflow.BadRequestError(_response.error.body);
347+
case 401:
348+
throw new Webflow.UnauthorizedError(_response.error.body);
349+
case 404:
350+
throw new Webflow.NotFoundError(_response.error.body);
351+
case 429:
352+
throw new Webflow.TooManyRequestsError(_response.error.body);
353+
case 500:
354+
throw new Webflow.InternalServerError(_response.error.body);
355+
default:
356+
throw new errors.WebflowError({
357+
statusCode: _response.error.statusCode,
358+
body: _response.error.body,
359+
});
360+
}
361+
}
362+
363+
switch (_response.error.reason) {
364+
case "non-json":
365+
throw new errors.WebflowError({
366+
statusCode: _response.error.statusCode,
367+
body: _response.error.rawBody,
368+
});
369+
case "timeout":
370+
throw new errors.WebflowTimeoutError();
371+
case "unknown":
372+
throw new errors.WebflowError({
373+
message: _response.error.errorMessage,
374+
});
375+
}
376+
}
377+
293378
/**
294379
* Get details of a selected Collection Item. </br></br> Required scope | `CMS:read`
295380
* @throws {@link Webflow.BadRequestError}
@@ -323,7 +408,7 @@ export class Items {
323408
Authorization: await this._getAuthorizationHeader(),
324409
"X-Fern-Language": "JavaScript",
325410
"X-Fern-SDK-Name": "webflow-api",
326-
"X-Fern-SDK-Version": "v2.1.1",
411+
"X-Fern-SDK-Version": "2.1.2",
327412
"X-Fern-Runtime": core.RUNTIME.type,
328413
"X-Fern-Runtime-Version": core.RUNTIME.version,
329414
},
@@ -414,7 +499,7 @@ export class Items {
414499
Authorization: await this._getAuthorizationHeader(),
415500
"X-Fern-Language": "JavaScript",
416501
"X-Fern-SDK-Name": "webflow-api",
417-
"X-Fern-SDK-Version": "v2.1.1",
502+
"X-Fern-SDK-Version": "2.1.2",
418503
"X-Fern-Runtime": core.RUNTIME.type,
419504
"X-Fern-Runtime-Version": core.RUNTIME.version,
420505
},
@@ -499,7 +584,7 @@ export class Items {
499584
Authorization: await this._getAuthorizationHeader(),
500585
"X-Fern-Language": "JavaScript",
501586
"X-Fern-SDK-Name": "webflow-api",
502-
"X-Fern-SDK-Version": "v2.1.1",
587+
"X-Fern-SDK-Version": "2.1.2",
503588
"X-Fern-Runtime": core.RUNTIME.type,
504589
"X-Fern-Runtime-Version": core.RUNTIME.version,
505590
},
@@ -579,7 +664,7 @@ export class Items {
579664
Authorization: await this._getAuthorizationHeader(),
580665
"X-Fern-Language": "JavaScript",
581666
"X-Fern-SDK-Name": "webflow-api",
582-
"X-Fern-SDK-Version": "v2.1.1",
667+
"X-Fern-SDK-Version": "2.1.2",
583668
"X-Fern-Runtime": core.RUNTIME.type,
584669
"X-Fern-Runtime-Version": core.RUNTIME.version,
585670
},
@@ -663,7 +748,7 @@ export class Items {
663748
Authorization: await this._getAuthorizationHeader(),
664749
"X-Fern-Language": "JavaScript",
665750
"X-Fern-SDK-Name": "webflow-api",
666-
"X-Fern-SDK-Version": "v2.1.1",
751+
"X-Fern-SDK-Version": "2.1.2",
667752
"X-Fern-Runtime": core.RUNTIME.type,
668753
"X-Fern-Runtime-Version": core.RUNTIME.version,
669754
},
@@ -745,7 +830,7 @@ export class Items {
745830
Authorization: await this._getAuthorizationHeader(),
746831
"X-Fern-Language": "JavaScript",
747832
"X-Fern-SDK-Name": "webflow-api",
748-
"X-Fern-SDK-Version": "v2.1.1",
833+
"X-Fern-SDK-Version": "2.1.2",
749834
"X-Fern-Runtime": core.RUNTIME.type,
750835
"X-Fern-Runtime-Version": core.RUNTIME.version,
751836
},
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as Webflow from "../../../../../..";
6+
7+
/**
8+
* @example
9+
* {
10+
* id: "580e64008c9a982ac9b8b754",
11+
* lastPublished: "2023-03-17T18:47:35.560Z",
12+
* lastUpdated: "2023-03-17T18:47:35.560Z",
13+
* createdOn: "2023-03-17T18:47:35.560Z",
14+
* fieldData: {
15+
* name: "My new item",
16+
* slug: "my-new-item"
17+
* }
18+
* }
19+
*/
20+
export interface BulkCollectionItem {
21+
/** Unique identifier for the Item */
22+
id: string;
23+
/** Array of identifiers for the locales where the item will be crated */
24+
cmsLocaleIds?: string[];
25+
/** The date the item was last published */
26+
lastPublished?: string;
27+
/** The date the item was last updated */
28+
lastUpdated?: string;
29+
/** The date the item was created */
30+
createdOn?: string;
31+
/** Boolean determining if the Item is set to archived */
32+
isArchived?: boolean;
33+
/** Boolean determining if the Item is set to draft */
34+
isDraft?: boolean;
35+
fieldData?: Webflow.collections.BulkCollectionItemFieldData;
36+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export { ItemsListItemsRequest } from "./ItemsListItemsRequest";
2+
export { BulkCollectionItem } from "./BulkCollectionItem";
23
export { ItemsGetItemRequest } from "./ItemsGetItemRequest";
34
export { ItemsDeleteItemRequest } from "./ItemsDeleteItemRequest";
45
export { ItemsPublishItemRequest } from "./ItemsPublishItemRequest";
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
export interface BulkCollectionItemFieldData {
6+
/** Name of the Item */
7+
name?: string;
8+
/** URL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug. */
9+
slug?: string;
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from "./BulkCollectionItemFieldData";
12
export * from "./ItemsPublishItemResponse";

0 commit comments

Comments
 (0)