Skip to content

Commit ed20f14

Browse files
authored
Merge pull request #153 from webflow/fern-bot/06-27-2024-0921PM
🌿 Fern Regeneration -- June 27, 2024
2 parents 21c2b0f + 8ea015b commit ed20f14

File tree

342 files changed

+3136
-1843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+3136
-1843
lines changed

.github/workflows/ci.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
- name: Compile
1717
run: yarn && yarn build
18-
18+
1919
test:
2020
runs-on: ubuntu-latest
2121

@@ -27,23 +27,19 @@ jobs:
2727
uses: actions/setup-node@v3
2828

2929
- name: Compile
30-
run: yarn && yarn test
31-
30+
run: yarn && yarn test
31+
3232
publish:
3333
needs: [ compile, test ]
3434
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
3535
runs-on: ubuntu-latest
36-
3736
steps:
3837
- name: Checkout repo
3938
uses: actions/checkout@v3
40-
4139
- name: Set up node
4240
uses: actions/setup-node@v3
43-
4441
- name: Install dependencies
4542
run: yarn install
46-
4743
- name: Build
4844
run: yarn build
4945

.gitignore

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
node_modules
22
.DS_Store
3-
/dist
4-
/Client.d.ts
5-
/Client.js
6-
/environments.d.ts
7-
/environments.js
8-
/index.d.ts
9-
/index.js
10-
/api
11-
/core
12-
/errors
13-
/serialization
3+
/dist

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
src
3+
tests
34
.gitignore
45
.github
56
.fernignore

jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/** @type {import('ts-jest').JestConfigWithTsJest} */
1+
/** @type {import('jest').Config} */
22
module.exports = {
33
preset: "ts-jest",
44
testEnvironment: "node",
5-
};
5+
};

package.json

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"name": "webflow-api",
3-
"version": "2.3.2",
3+
"version": "2.3.5",
44
"private": false,
55
"repository": "https://github.com/webflow/js-webflow-api",
66
"main": "./index.js",
77
"types": "./index.d.ts",
88
"scripts": {
9-
"format": "prettier --write 'src/**/*.ts'",
9+
"format": "prettier . --write --ignore-unknown",
1010
"build": "tsc",
1111
"prepack": "cp -rv dist/. .",
1212
"test": "jest"
1313
},
1414
"dependencies": {
1515
"url-join": "4.0.1",
1616
"form-data": "4.0.0",
17+
"formdata-node": "^6.0.3",
1718
"node-fetch": "2.7.0",
1819
"qs": "6.11.2",
1920
"js-base64": "3.7.2"
@@ -22,11 +23,17 @@
2223
"@types/url-join": "4.0.1",
2324
"@types/qs": "6.9.8",
2425
"@types/node-fetch": "2.6.9",
25-
"jest": "^29.7.0",
26-
"@types/jest": "^29.5.5",
27-
"ts-jest": "^29.1.1",
26+
"jest": "29.7.0",
27+
"@types/jest": "29.5.5",
28+
"ts-jest": "29.1.1",
29+
"jest-environment-jsdom": "29.7.0",
2830
"@types/node": "17.0.33",
2931
"prettier": "2.7.1",
3032
"typescript": "4.6.4"
33+
},
34+
"browser": {
35+
"fs": false,
36+
"os": false,
37+
"path": false
3138
}
32-
}
39+
}

src/Client.ts

+4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ export declare namespace WebflowClient {
2626
}
2727

2828
interface RequestOptions {
29+
/** The maximum time to wait for a response in seconds. */
2930
timeoutInSeconds?: number;
31+
/** The number of times to retry the request. Defaults to 2. */
3032
maxRetries?: number;
33+
/** A hook to abort the request. */
34+
abortSignal?: AbortSignal;
3135
}
3236
}
3337

src/api/errors/BadRequestError.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as errors from "../../errors";
5+
import * as errors from "../../errors/index";
66

77
export class BadRequestError extends errors.WebflowError {
88
constructor(body?: unknown) {

src/api/errors/ConflictError.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as errors from "../../errors";
5+
import * as errors from "../../errors/index";
66

77
export class ConflictError extends errors.WebflowError {
88
constructor(body?: unknown) {

src/api/errors/ForbiddenError.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as errors from "../../errors";
5+
import * as errors from "../../errors/index";
66

77
export class ForbiddenError extends errors.WebflowError {
88
constructor(body?: unknown) {

src/api/errors/InternalServerError.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as errors from "../../errors";
5+
import * as errors from "../../errors/index";
66

77
export class InternalServerError extends errors.WebflowError {
88
constructor(body?: unknown) {

src/api/errors/NotFoundError.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as errors from "../../errors";
5+
import * as errors from "../../errors/index";
66

77
export class NotFoundError extends errors.WebflowError {
88
constructor(body?: unknown) {

src/api/errors/TooManyRequestsError.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as errors from "../../errors";
5+
import * as errors from "../../errors/index";
66

77
export class TooManyRequestsError extends errors.WebflowError {
88
constructor(body?: unknown) {

src/api/errors/UnauthorizedError.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as errors from "../../errors";
5+
import * as errors from "../../errors/index";
66

77
export class UnauthorizedError extends errors.WebflowError {
88
constructor(body?: unknown) {

src/api/errors/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export * from "./BadRequestError";
21
export * from "./UnauthorizedError";
32
export * from "./ForbiddenError";
3+
export * from "./BadRequestError";
44
export * from "./NotFoundError";
5-
export * from "./ConflictError";
65
export * from "./TooManyRequestsError";
76
export * from "./InternalServerError";
7+
export * from "./ConflictError";

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

+17-7
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
import * as environments from "../../../../environments";
66
import * as core from "../../../../core";
7-
import * as Webflow from "../../..";
7+
import * as Webflow from "../../../index";
88
import urlJoin from "url-join";
9-
import * as serializers from "../../../../serialization";
10-
import * as errors from "../../../../errors";
9+
import * as serializers from "../../../../serialization/index";
10+
import * as errors from "../../../../errors/index";
1111

1212
export declare namespace AccessGroups {
1313
interface Options {
@@ -16,8 +16,12 @@ export declare namespace AccessGroups {
1616
}
1717

1818
interface RequestOptions {
19+
/** The maximum time to wait for a response in seconds. */
1920
timeoutInSeconds?: number;
21+
/** The number of times to retry the request. Defaults to 2. */
2022
maxRetries?: number;
23+
/** A hook to abort the request. */
24+
abortSignal?: AbortSignal;
2125
}
2226
}
2327

@@ -26,6 +30,11 @@ export class AccessGroups {
2630

2731
/**
2832
* Get a list of access groups for a site <br><br> Required scope | `users:read`
33+
*
34+
* @param {string} siteId - Unique identifier for a Site
35+
* @param {Webflow.AccessGroupsListRequest} request
36+
* @param {AccessGroups.RequestOptions} requestOptions - Request-specific configuration.
37+
*
2938
* @throws {@link Webflow.BadRequestError}
3039
* @throws {@link Webflow.UnauthorizedError}
3140
* @throws {@link Webflow.ForbiddenError}
@@ -34,7 +43,7 @@ export class AccessGroups {
3443
* @throws {@link Webflow.InternalServerError}
3544
*
3645
* @example
37-
* await webflow.accessGroups.list("site_id", {})
46+
* await client.accessGroups.list("site_id")
3847
*/
3948
public async list(
4049
siteId: string,
@@ -58,21 +67,22 @@ export class AccessGroups {
5867
const _response = await core.fetcher({
5968
url: urlJoin(
6069
(await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default,
61-
`sites/${siteId}/accessgroups`
70+
`sites/${encodeURIComponent(siteId)}/accessgroups`
6271
),
6372
method: "GET",
6473
headers: {
6574
Authorization: await this._getAuthorizationHeader(),
6675
"X-Fern-Language": "JavaScript",
6776
"X-Fern-SDK-Name": "webflow-api",
68-
"X-Fern-SDK-Version": "2.3.2",
77+
"X-Fern-SDK-Version": "2.3.5",
6978
"X-Fern-Runtime": core.RUNTIME.type,
7079
"X-Fern-Runtime-Version": core.RUNTIME.version,
7180
},
7281
contentType: "application/json",
7382
queryParameters: _queryParams,
7483
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
7584
maxRetries: requestOptions?.maxRetries,
85+
abortSignal: requestOptions?.abortSignal,
7686
});
7787
if (_response.ok) {
7888
return await serializers.AccessGroupList.parseOrThrow(_response.body, {
@@ -121,7 +131,7 @@ export class AccessGroups {
121131
}
122132
}
123133

124-
protected async _getAuthorizationHeader() {
134+
protected async _getAuthorizationHeader(): Promise<string> {
125135
return `Bearer ${await core.Supplier.get(this._options.accessToken)}`;
126136
}
127137
}

src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as Webflow from "../../../..";
5+
import * as Webflow from "../../../../index";
66

77
/**
88
* @example
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { AccessGroupsListRequest } from "./AccessGroupsListRequest";
1+
export { type AccessGroupsListRequest } from "./AccessGroupsListRequest";

0 commit comments

Comments
 (0)