-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathClient.ts
133 lines (99 loc) · 4.12 KB
/
Client.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/**
* This file was auto-generated by Fern from our API Definition.
*/
import * as environments from "./environments";
import * as core from "./core";
import { Token } from "./api/resources/token/client/Client";
import { Sites } from "./api/resources/sites/client/Client";
import { Collections } from "./api/resources/collections/client/Client";
import { Pages } from "./api/resources/pages/client/Client";
import { Components } from "./api/resources/components/client/Client";
import { Scripts } from "./api/resources/scripts/client/Client";
import { Assets } from "./api/resources/assets/client/Client";
import { Webhooks } from "./api/resources/webhooks/client/Client";
import { Forms } from "./api/resources/forms/client/Client";
import { Users } from "./api/resources/users/client/Client";
import { AccessGroups } from "./api/resources/accessGroups/client/Client";
import { Products } from "./api/resources/products/client/Client";
import { Orders } from "./api/resources/orders/client/Client";
import { Inventory } from "./api/resources/inventory/client/Client";
import { Ecommerce } from "./api/resources/ecommerce/client/Client";
export declare namespace WebflowClient {
interface Options {
environment?: core.Supplier<environments.WebflowEnvironment | environments.WebflowEnvironmentUrls>;
accessToken: core.Supplier<core.BearerToken>;
}
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;
/** Additional headers to include in the request. */
headers?: Record<string, string>;
}
}
export class WebflowClient {
constructor(protected readonly _options: WebflowClient.Options) {}
protected _token: Token | undefined;
public get token(): Token {
return (this._token ??= new Token(this._options));
}
protected _sites: Sites | undefined;
public get sites(): Sites {
return (this._sites ??= new Sites(this._options));
}
protected _collections: Collections | undefined;
public get collections(): Collections {
return (this._collections ??= new Collections(this._options));
}
protected _pages: Pages | undefined;
public get pages(): Pages {
return (this._pages ??= new Pages(this._options));
}
protected _components: Components | undefined;
public get components(): Components {
return (this._components ??= new Components(this._options));
}
protected _scripts: Scripts | undefined;
public get scripts(): Scripts {
return (this._scripts ??= new Scripts(this._options));
}
protected _assets: Assets | undefined;
public get assets(): Assets {
return (this._assets ??= new Assets(this._options));
}
protected _webhooks: Webhooks | undefined;
public get webhooks(): Webhooks {
return (this._webhooks ??= new Webhooks(this._options));
}
protected _forms: Forms | undefined;
public get forms(): Forms {
return (this._forms ??= new Forms(this._options));
}
protected _users: Users | undefined;
public get users(): Users {
return (this._users ??= new Users(this._options));
}
protected _accessGroups: AccessGroups | undefined;
public get accessGroups(): AccessGroups {
return (this._accessGroups ??= new AccessGroups(this._options));
}
protected _products: Products | undefined;
public get products(): Products {
return (this._products ??= new Products(this._options));
}
protected _orders: Orders | undefined;
public get orders(): Orders {
return (this._orders ??= new Orders(this._options));
}
protected _inventory: Inventory | undefined;
public get inventory(): Inventory {
return (this._inventory ??= new Inventory(this._options));
}
protected _ecommerce: Ecommerce | undefined;
public get ecommerce(): Ecommerce {
return (this._ecommerce ??= new Ecommerce(this._options));
}
}