Skip to content

Commit

Permalink
Merge pull request #153 from webflow/fern-bot/06-27-2024-0921PM
Browse files Browse the repository at this point in the history
🌿 Fern Regeneration -- June 27, 2024
  • Loading branch information
jtoceflow authored Jul 11, 2024
2 parents 21c2b0f + 8ea015b commit ed20f14
Show file tree
Hide file tree
Showing 342 changed files with 3,136 additions and 1,843 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Compile
run: yarn && yarn build

test:
runs-on: ubuntu-latest

Expand All @@ -27,23 +27,19 @@ jobs:
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn test
run: yarn && yarn test

publish:
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v3

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

Expand Down
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
node_modules
.DS_Store
/dist
/Client.d.ts
/Client.js
/environments.d.ts
/environments.js
/index.d.ts
/index.js
/api
/core
/errors
/serialization
/dist
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
src
tests
.gitignore
.github
.fernignore
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
/** @type {import('jest').Config} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
};
19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "webflow-api",
"version": "2.3.2",
"version": "2.3.5",
"private": false,
"repository": "https://github.com/webflow/js-webflow-api",
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"format": "prettier . --write --ignore-unknown",
"build": "tsc",
"prepack": "cp -rv dist/. .",
"test": "jest"
},
"dependencies": {
"url-join": "4.0.1",
"form-data": "4.0.0",
"formdata-node": "^6.0.3",
"node-fetch": "2.7.0",
"qs": "6.11.2",
"js-base64": "3.7.2"
Expand All @@ -22,11 +23,17 @@
"@types/url-join": "4.0.1",
"@types/qs": "6.9.8",
"@types/node-fetch": "2.6.9",
"jest": "^29.7.0",
"@types/jest": "^29.5.5",
"ts-jest": "^29.1.1",
"jest": "29.7.0",
"@types/jest": "29.5.5",
"ts-jest": "29.1.1",
"jest-environment-jsdom": "29.7.0",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4"
},
"browser": {
"fs": false,
"os": false,
"path": false
}
}
}
4 changes: 4 additions & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ export declare namespace WebflowClient {
}

interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/errors/BadRequestError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors";
import * as errors from "../../errors/index";

export class BadRequestError extends errors.WebflowError {
constructor(body?: unknown) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/errors/ConflictError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors";
import * as errors from "../../errors/index";

export class ConflictError extends errors.WebflowError {
constructor(body?: unknown) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/errors/ForbiddenError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors";
import * as errors from "../../errors/index";

export class ForbiddenError extends errors.WebflowError {
constructor(body?: unknown) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/errors/InternalServerError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors";
import * as errors from "../../errors/index";

export class InternalServerError extends errors.WebflowError {
constructor(body?: unknown) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/errors/NotFoundError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors";
import * as errors from "../../errors/index";

export class NotFoundError extends errors.WebflowError {
constructor(body?: unknown) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/errors/TooManyRequestsError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors";
import * as errors from "../../errors/index";

export class TooManyRequestsError extends errors.WebflowError {
constructor(body?: unknown) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/errors/UnauthorizedError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors";
import * as errors from "../../errors/index";

export class UnauthorizedError extends errors.WebflowError {
constructor(body?: unknown) {
Expand Down
4 changes: 2 additions & 2 deletions src/api/errors/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from "./BadRequestError";
export * from "./UnauthorizedError";
export * from "./ForbiddenError";
export * from "./BadRequestError";
export * from "./NotFoundError";
export * from "./ConflictError";
export * from "./TooManyRequestsError";
export * from "./InternalServerError";
export * from "./ConflictError";
24 changes: 17 additions & 7 deletions src/api/resources/accessGroups/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Webflow from "../../..";
import * as Webflow from "../../../index";
import urlJoin from "url-join";
import * as serializers from "../../../../serialization";
import * as errors from "../../../../errors";
import * as serializers from "../../../../serialization/index";
import * as errors from "../../../../errors/index";

export declare namespace AccessGroups {
interface Options {
Expand All @@ -16,8 +16,12 @@ export declare namespace AccessGroups {
}

interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
}
}

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

/**
* Get a list of access groups for a site <br><br> Required scope | `users:read`
*
* @param {string} siteId - Unique identifier for a Site
* @param {Webflow.AccessGroupsListRequest} request
* @param {AccessGroups.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
* @throws {@link Webflow.ForbiddenError}
Expand All @@ -34,7 +43,7 @@ export class AccessGroups {
* @throws {@link Webflow.InternalServerError}
*
* @example
* await webflow.accessGroups.list("site_id", {})
* await client.accessGroups.list("site_id")
*/
public async list(
siteId: string,
Expand All @@ -58,21 +67,22 @@ export class AccessGroups {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default,
`sites/${siteId}/accessgroups`
`sites/${encodeURIComponent(siteId)}/accessgroups`
),
method: "GET",
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
return await serializers.AccessGroupList.parseOrThrow(_response.body, {
Expand Down Expand Up @@ -121,7 +131,7 @@ export class AccessGroups {
}
}

protected async _getAuthorizationHeader() {
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.accessToken)}`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

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

/**
* @example
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/accessGroups/client/requests/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { AccessGroupsListRequest } from "./AccessGroupsListRequest";
export { type AccessGroupsListRequest } from "./AccessGroupsListRequest";
Loading

0 comments on commit ed20f14

Please sign in to comment.