Skip to content

Commit 2e0d0d7

Browse files
(fix): support pagination for list endpoints
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 93760e1 commit 2e0d0d7

File tree

24 files changed

+134
-84
lines changed

24 files changed

+134
-84
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.0",
3+
"version": "v2.1.1",
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.0",
68+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
49+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
132+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
208+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
283+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
358+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
434+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
516+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
595+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
51+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
134+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
210+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
285+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
358+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
58+
"X-Fern-SDK-Version": "v2.1.1",
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.0",
143+
"X-Fern-SDK-Version": "v2.1.1",
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: 9 additions & 9 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.0",
71+
"X-Fern-SDK-Version": "v2.1.1",
7272
"X-Fern-Runtime": core.RUNTIME.type,
7373
"X-Fern-Runtime-Version": core.RUNTIME.version,
7474
},
@@ -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.0",
161+
"X-Fern-SDK-Version": "v2.1.1",
162162
"X-Fern-Runtime": core.RUNTIME.type,
163163
"X-Fern-Runtime-Version": core.RUNTIME.version,
164164
},
@@ -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.0",
245+
"X-Fern-SDK-Version": "v2.1.1",
246246
"X-Fern-Runtime": core.RUNTIME.type,
247247
"X-Fern-Runtime-Version": core.RUNTIME.version,
248248
},
@@ -323,7 +323,7 @@ export class Items {
323323
Authorization: await this._getAuthorizationHeader(),
324324
"X-Fern-Language": "JavaScript",
325325
"X-Fern-SDK-Name": "webflow-api",
326-
"X-Fern-SDK-Version": "v2.1.0",
326+
"X-Fern-SDK-Version": "v2.1.1",
327327
"X-Fern-Runtime": core.RUNTIME.type,
328328
"X-Fern-Runtime-Version": core.RUNTIME.version,
329329
},
@@ -414,7 +414,7 @@ export class Items {
414414
Authorization: await this._getAuthorizationHeader(),
415415
"X-Fern-Language": "JavaScript",
416416
"X-Fern-SDK-Name": "webflow-api",
417-
"X-Fern-SDK-Version": "v2.1.0",
417+
"X-Fern-SDK-Version": "v2.1.1",
418418
"X-Fern-Runtime": core.RUNTIME.type,
419419
"X-Fern-Runtime-Version": core.RUNTIME.version,
420420
},
@@ -499,7 +499,7 @@ export class Items {
499499
Authorization: await this._getAuthorizationHeader(),
500500
"X-Fern-Language": "JavaScript",
501501
"X-Fern-SDK-Name": "webflow-api",
502-
"X-Fern-SDK-Version": "v2.1.0",
502+
"X-Fern-SDK-Version": "v2.1.1",
503503
"X-Fern-Runtime": core.RUNTIME.type,
504504
"X-Fern-Runtime-Version": core.RUNTIME.version,
505505
},
@@ -579,7 +579,7 @@ export class Items {
579579
Authorization: await this._getAuthorizationHeader(),
580580
"X-Fern-Language": "JavaScript",
581581
"X-Fern-SDK-Name": "webflow-api",
582-
"X-Fern-SDK-Version": "v2.1.0",
582+
"X-Fern-SDK-Version": "v2.1.1",
583583
"X-Fern-Runtime": core.RUNTIME.type,
584584
"X-Fern-Runtime-Version": core.RUNTIME.version,
585585
},
@@ -663,7 +663,7 @@ export class Items {
663663
Authorization: await this._getAuthorizationHeader(),
664664
"X-Fern-Language": "JavaScript",
665665
"X-Fern-SDK-Name": "webflow-api",
666-
"X-Fern-SDK-Version": "v2.1.0",
666+
"X-Fern-SDK-Version": "v2.1.1",
667667
"X-Fern-Runtime": core.RUNTIME.type,
668668
"X-Fern-Runtime-Version": core.RUNTIME.version,
669669
},
@@ -745,7 +745,7 @@ export class Items {
745745
Authorization: await this._getAuthorizationHeader(),
746746
"X-Fern-Language": "JavaScript",
747747
"X-Fern-SDK-Name": "webflow-api",
748-
"X-Fern-SDK-Version": "v2.1.0",
748+
"X-Fern-SDK-Version": "v2.1.1",
749749
"X-Fern-Runtime": core.RUNTIME.type,
750750
"X-Fern-Runtime-Version": core.RUNTIME.version,
751751
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class Ecommerce {
5353
Authorization: await this._getAuthorizationHeader(),
5454
"X-Fern-Language": "JavaScript",
5555
"X-Fern-SDK-Name": "webflow-api",
56-
"X-Fern-SDK-Version": "v2.1.0",
56+
"X-Fern-SDK-Version": "v2.1.1",
5757
"X-Fern-Runtime": core.RUNTIME.type,
5858
"X-Fern-Runtime-Version": core.RUNTIME.version,
5959
},

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,23 @@ export class Forms {
3535
* @throws {@link Webflow.InternalServerError}
3636
*
3737
* @example
38-
* await webflow.forms.list("site_id")
38+
* await webflow.forms.list("site_id", {})
3939
*/
40-
public async list(siteId: string, requestOptions?: Forms.RequestOptions): Promise<Webflow.FormList> {
40+
public async list(
41+
siteId: string,
42+
request: Webflow.FormsListRequest = {},
43+
requestOptions?: Forms.RequestOptions
44+
): Promise<Webflow.FormList> {
45+
const { limit, offset } = request;
46+
const _queryParams: Record<string, string | string[] | object | object[]> = {};
47+
if (limit != null) {
48+
_queryParams["limit"] = limit.toString();
49+
}
50+
51+
if (offset != null) {
52+
_queryParams["offset"] = offset.toString();
53+
}
54+
4155
const _response = await core.fetcher({
4256
url: urlJoin(
4357
(await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default,
@@ -48,11 +62,12 @@ export class Forms {
4862
Authorization: await this._getAuthorizationHeader(),
4963
"X-Fern-Language": "JavaScript",
5064
"X-Fern-SDK-Name": "webflow-api",
51-
"X-Fern-SDK-Version": "v2.1.0",
65+
"X-Fern-SDK-Version": "v2.1.1",
5266
"X-Fern-Runtime": core.RUNTIME.type,
5367
"X-Fern-Runtime-Version": core.RUNTIME.version,
5468
},
5569
contentType: "application/json",
70+
queryParameters: _queryParams,
5671
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
5772
maxRetries: requestOptions?.maxRetries,
5873
});
@@ -128,7 +143,7 @@ export class Forms {
128143
Authorization: await this._getAuthorizationHeader(),
129144
"X-Fern-Language": "JavaScript",
130145
"X-Fern-SDK-Name": "webflow-api",
131-
"X-Fern-SDK-Version": "v2.1.0",
146+
"X-Fern-SDK-Version": "v2.1.1",
132147
"X-Fern-Runtime": core.RUNTIME.type,
133148
"X-Fern-Runtime-Version": core.RUNTIME.version,
134149
},
@@ -209,7 +224,7 @@ export class Forms {
209224
Authorization: await this._getAuthorizationHeader(),
210225
"X-Fern-Language": "JavaScript",
211226
"X-Fern-SDK-Name": "webflow-api",
212-
"X-Fern-SDK-Version": "v2.1.0",
227+
"X-Fern-SDK-Version": "v2.1.1",
213228
"X-Fern-Runtime": core.RUNTIME.type,
214229
"X-Fern-Runtime-Version": core.RUNTIME.version,
215230
},
@@ -290,7 +305,7 @@ export class Forms {
290305
Authorization: await this._getAuthorizationHeader(),
291306
"X-Fern-Language": "JavaScript",
292307
"X-Fern-SDK-Name": "webflow-api",
293-
"X-Fern-SDK-Version": "v2.1.0",
308+
"X-Fern-SDK-Version": "v2.1.1",
294309
"X-Fern-Runtime": core.RUNTIME.type,
295310
"X-Fern-Runtime-Version": core.RUNTIME.version,
296311
},
@@ -373,7 +388,7 @@ export class Forms {
373388
Authorization: await this._getAuthorizationHeader(),
374389
"X-Fern-Language": "JavaScript",
375390
"X-Fern-SDK-Name": "webflow-api",
376-
"X-Fern-SDK-Version": "v2.1.0",
391+
"X-Fern-SDK-Version": "v2.1.1",
377392
"X-Fern-Runtime": core.RUNTIME.type,
378393
"X-Fern-Runtime-Version": core.RUNTIME.version,
379394
},
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
/**
6+
* @example
7+
* {}
8+
*/
9+
export interface FormsListRequest {
10+
/**
11+
* Maximum number of records to be returned (max limit: 100)
12+
*/
13+
limit?: number;
14+
/**
15+
* Offset used for pagination if the results have more than limit records
16+
*/
17+
offset?: number;
18+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export { FormsListRequest } from "./FormsListRequest";
12
export { FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest";

0 commit comments

Comments
 (0)