-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathClient.ts
More file actions
116 lines (97 loc) · 4.03 KB
/
Client.ts
File metadata and controls
116 lines (97 loc) · 4.03 KB
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
// This file was auto-generated by Fern from our API Definition.
import { Assets } from "./api/resources/assets/client/Client";
import { Collections } from "./api/resources/collections/client/Client";
import { Components } from "./api/resources/components/client/Client";
import { Ecommerce } from "./api/resources/ecommerce/client/Client";
import { Forms } from "./api/resources/forms/client/Client";
import { Inventory } from "./api/resources/inventory/client/Client";
import { Orders } from "./api/resources/orders/client/Client";
import { Pages } from "./api/resources/pages/client/Client";
import { Products } from "./api/resources/products/client/Client";
import { Scripts } from "./api/resources/scripts/client/Client";
import { Sites } from "./api/resources/sites/client/Client";
import { Token } from "./api/resources/token/client/Client";
import { Webhooks } from "./api/resources/webhooks/client/Client";
import { Workspaces } from "./api/resources/workspaces/client/Client";
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient";
import * as core from "./core";
import { mergeHeaders } from "./core/headers";
export declare namespace WebflowClient {
export interface Options extends BaseClientOptions {}
export interface RequestOptions extends BaseRequestOptions {}
}
export class WebflowClient {
protected readonly _options: WebflowClient.Options;
protected _token: Token | undefined;
protected _sites: Sites | undefined;
protected _collections: Collections | undefined;
protected _pages: Pages | undefined;
protected _components: Components | undefined;
protected _scripts: Scripts | undefined;
protected _assets: Assets | undefined;
protected _webhooks: Webhooks | undefined;
protected _forms: Forms | undefined;
protected _products: Products | undefined;
protected _orders: Orders | undefined;
protected _inventory: Inventory | undefined;
protected _ecommerce: Ecommerce | undefined;
protected _workspaces: Workspaces | undefined;
constructor(_options: WebflowClient.Options) {
this._options = {
..._options,
headers: mergeHeaders(
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "3.3.2",
"User-Agent": "webflow-api/3.3.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
_options?.headers,
),
};
}
public get token(): Token {
return (this._token ??= new Token(this._options));
}
public get sites(): Sites {
return (this._sites ??= new Sites(this._options));
}
public get collections(): Collections {
return (this._collections ??= new Collections(this._options));
}
public get pages(): Pages {
return (this._pages ??= new Pages(this._options));
}
public get components(): Components {
return (this._components ??= new Components(this._options));
}
public get scripts(): Scripts {
return (this._scripts ??= new Scripts(this._options));
}
public get assets(): Assets {
return (this._assets ??= new Assets(this._options));
}
public get webhooks(): Webhooks {
return (this._webhooks ??= new Webhooks(this._options));
}
public get forms(): Forms {
return (this._forms ??= new Forms(this._options));
}
public get products(): Products {
return (this._products ??= new Products(this._options));
}
public get orders(): Orders {
return (this._orders ??= new Orders(this._options));
}
public get inventory(): Inventory {
return (this._inventory ??= new Inventory(this._options));
}
public get ecommerce(): Ecommerce {
return (this._ecommerce ??= new Ecommerce(this._options));
}
public get workspaces(): Workspaces {
return (this._workspaces ??= new Workspaces(this._options));
}
}