webflow-api 1.1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +41 -17
  2. package/dist/api/collection.d.ts +86 -25
  3. package/dist/api/collection.js +88 -29
  4. package/dist/api/index.d.ts +7 -7
  5. package/dist/api/index.js +9 -19
  6. package/dist/api/item.d.ts +141 -107
  7. package/dist/api/item.js +145 -125
  8. package/dist/api/meta.d.ts +16 -14
  9. package/dist/api/meta.js +20 -19
  10. package/dist/api/oauth.d.ts +38 -36
  11. package/dist/api/oauth.js +59 -59
  12. package/dist/api/site.d.ts +118 -43
  13. package/dist/api/site.js +131 -53
  14. package/dist/api/user.d.ts +143 -0
  15. package/dist/api/user.js +119 -0
  16. package/dist/api/webhook.d.ts +77 -55
  17. package/dist/api/webhook.js +74 -61
  18. package/dist/core/error.d.ts +2 -0
  19. package/dist/core/error.js +8 -1
  20. package/dist/core/index.d.ts +2 -2
  21. package/dist/core/index.js +2 -2
  22. package/dist/core/response.d.ts +32 -0
  23. package/dist/core/response.js +26 -0
  24. package/dist/{webflow.d.ts → core/webflow.d.ts} +66 -54
  25. package/dist/{webflow.js → core/webflow.js} +114 -65
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +2 -2
  28. package/package.json +12 -8
  29. package/src/api/collection.ts +103 -36
  30. package/src/api/index.ts +7 -7
  31. package/src/api/item.ts +217 -176
  32. package/src/api/meta.ts +19 -18
  33. package/src/api/oauth.ts +71 -74
  34. package/src/api/site.ts +161 -55
  35. package/src/api/user.ts +192 -0
  36. package/src/api/webhook.ts +103 -80
  37. package/src/core/error.ts +8 -0
  38. package/src/core/index.ts +2 -2
  39. package/src/core/response.ts +50 -0
  40. package/src/{webflow.ts → core/webflow.ts} +153 -125
  41. package/src/index.ts +1 -1
  42. package/yarn.lock +4 -9
  43. package/dist/api/membership.d.ts +0 -114
  44. package/dist/api/membership.js +0 -96
  45. package/dist/core/client.d.ts +0 -27
  46. package/dist/core/client.js +0 -60
  47. package/dist/core/options.d.ts +0 -8
  48. package/dist/core/options.js +0 -5
  49. package/dist/wrapper/collection.d.ts +0 -85
  50. package/dist/wrapper/collection.js +0 -94
  51. package/dist/wrapper/index.d.ts +0 -6
  52. package/dist/wrapper/index.js +0 -22
  53. package/dist/wrapper/item.d.ts +0 -140
  54. package/dist/wrapper/item.js +0 -153
  55. package/dist/wrapper/membership.d.ts +0 -105
  56. package/dist/wrapper/membership.js +0 -123
  57. package/dist/wrapper/response.d.ts +0 -16
  58. package/dist/wrapper/response.js +0 -17
  59. package/dist/wrapper/site.d.ts +0 -168
  60. package/dist/wrapper/site.js +0 -191
  61. package/dist/wrapper/webhook.d.ts +0 -78
  62. package/dist/wrapper/webhook.js +0 -82
  63. package/src/api/membership.ts +0 -155
  64. package/src/core/client.ts +0 -82
  65. package/src/core/options.ts +0 -9
  66. package/src/wrapper/collection.ts +0 -115
  67. package/src/wrapper/index.ts +0 -6
  68. package/src/wrapper/item.ts +0 -218
  69. package/src/wrapper/membership.ts +0 -163
  70. package/src/wrapper/response.ts +0 -25
  71. package/src/wrapper/site.ts +0 -228
  72. package/src/wrapper/webhook.ts +0 -116
@@ -1,4 +1,5 @@
1
- import { Client, PaginatedData } from "../core";
1
+ import { AxiosInstance } from "axios";
2
+ import { PaginatedData, WebflowRecord } from "../core";
2
3
  /**************************************************************
3
4
  * Interfaces
4
5
  **************************************************************/
@@ -34,110 +35,143 @@ export declare type PageinatedItems = PaginatedData & {
34
35
  items: IItem[];
35
36
  };
36
37
  /**************************************************************
37
- * Functions
38
+ * Class
38
39
  **************************************************************/
39
- /**
40
- * Get a single Item
41
- * @param client The Webflow client
42
- * @param params The params for the request
43
- * @param params.collectionId The Collection ID
44
- * @param params.itemId The Item ID
45
- * @returns A single Item
46
- */
47
- export declare function getOne(client: Client, { collectionId, itemId }: {
48
- collectionId: string;
49
- itemId: string;
50
- }): Promise<import("axios").AxiosResponse<PageinatedItems, any>>;
51
- /**
52
- * Get a list of Items
53
- * @param client The Webflow client
54
- * @param params The params for the request
55
- * @param params.collectionId The Collection ID
56
- * @param params.limit The number of items to return (optional)
57
- * @param params.offset The number of items to skip (optional)
58
- * @returns A list of Items
59
- */
60
- export declare function list(client: Client, { collectionId, limit, offset, }: {
61
- collectionId: string;
62
- limit?: number;
63
- offset?: number;
64
- }): Promise<import("axios").AxiosResponse<PageinatedItems, any>>;
65
- /**
66
- * Create a new Item
67
- * @param client The Webflow client
68
- * @param params The params for the request
69
- * @param params.collectionId The Collection ID
70
- * @param params.fields The Item fields to create
71
- * @returns The created Item
72
- */
73
- export declare function create(client: Client, { collectionId, fields }: {
74
- fields: any;
75
- collectionId: string;
76
- }): Promise<import("axios").AxiosResponse<IItem, any>>;
77
- /**
78
- * Update a single Item
79
- * @param client The Webflow client
80
- * @param params The params for the request
81
- * @param params.collectionId The Collection ID
82
- * @param params.itemId The Item ID
83
- * @param params.fields The fields to update
84
- * @returns The updated Item
85
- */
86
- export declare function update(client: Client, { collectionId, itemId, fields, }: {
87
- fields: any;
88
- itemId: string;
89
- collectionId: string;
90
- }): Promise<import("axios").AxiosResponse<IItem, any>>;
91
- /**
92
- * Patch a single Item
93
- * @param client The Webflow client
94
- * @param params The params for the request
95
- * @param params.collectionId The Collection ID
96
- * @param params.itemId The Item ID
97
- * @param params.fields The fields to patch
98
- * @returns The patched Item
99
- */
100
- export declare function patch(client: Client, { collectionId, itemId, fields, }: {
101
- fields: any;
102
- itemId: string;
103
- collectionId: string;
104
- }): Promise<import("axios").AxiosResponse<IItem, any>>;
105
- /**
106
- * Remove a single Item
107
- * @param client The Webflow client
108
- * @param params The params for the request
109
- * @param params.collectionId The Collection ID
110
- * @param params.itemId The Item ID
111
- * @returns The result from the removal
112
- */
113
- export declare function remove(client: Client, { collectionId, itemId, }: {
114
- itemId: string;
115
- collectionId: string;
116
- }): Promise<import("axios").AxiosResponse<IItemDelete, any>>;
117
- /**
118
- * Unpublishes a list of Items
119
- * @param client The Webflow client
120
- * @param params The params for the request
121
- * @param params.collectionId The Collection ID
122
- * @param params.live Unpublish from the live site
123
- * @returns The result of the unpublish
124
- */
125
- export declare function unpublish(client: Client, { collectionId, itemIds, live, }: {
126
- live?: boolean;
127
- itemIds: string[];
128
- collectionId: string;
129
- }): Promise<import("axios").AxiosResponse<IDeletedItems, any>>;
130
- /**
131
- * Publishes a list of Items
132
- * @param client The Webflow client
133
- * @param params The request parameters
134
- * @param params.collectionId The Collection ID
135
- * @param params.itemIds The list of Item IDs to publish
136
- * @param params.live Publish to live site
137
- * @returns The result of the publish
138
- */
139
- export declare function publish(client: Client, { itemIds, live, collectionId, }: {
140
- live?: boolean;
141
- itemIds: string[];
142
- collectionId: string;
143
- }): Promise<import("axios").AxiosResponse<IPublishItems, any>>;
40
+ export declare class Item extends WebflowRecord<IItem> implements IItem {
41
+ "published-on"?: string | null;
42
+ "published-by"?: string | null;
43
+ "updated-on": string;
44
+ "created-on": string;
45
+ "updated-by": string;
46
+ "created-by": string;
47
+ _archived: boolean;
48
+ _draft: boolean;
49
+ _cid: string;
50
+ name: string;
51
+ slug: string;
52
+ _id: string;
53
+ /**************************************************************
54
+ * Static Methods
55
+ **************************************************************/
56
+ /**
57
+ * Get a single Item
58
+ * @param params The params for the request
59
+ * @param params.collectionId The Collection ID
60
+ * @param params.itemId The Item ID
61
+ * @param client The Axios client instance
62
+ * @returns A single Item
63
+ */
64
+ static getOne({ collectionId, itemId }: {
65
+ collectionId: string;
66
+ itemId: string;
67
+ }, client: AxiosInstance): Promise<import("axios").AxiosResponse<PageinatedItems, any>>;
68
+ /**
69
+ * Get a list of Items
70
+ * @param params The params for the request
71
+ * @param params.collectionId The Collection ID
72
+ * @param params.limit The number of items to return (optional)
73
+ * @param params.offset The number of items to skip (optional)
74
+ * @param client The Axios client instance
75
+ * @returns A list of Items
76
+ */
77
+ static list({ collectionId, limit, offset }: {
78
+ collectionId: string;
79
+ limit?: number;
80
+ offset?: number;
81
+ }, client: AxiosInstance): Promise<import("axios").AxiosResponse<PageinatedItems, any>>;
82
+ /**
83
+ * Create a new Item
84
+ * @param params The params for the request
85
+ * @param params.collectionId The Collection ID
86
+ * @param params.fields The Item fields to create
87
+ * @param client The Axios client instance
88
+ * @returns The created Item
89
+ */
90
+ static create({ collectionId, fields }: {
91
+ fields: any;
92
+ collectionId: string;
93
+ }, client: AxiosInstance): Promise<import("axios").AxiosResponse<IItem, any>>;
94
+ /**
95
+ * Update a single Item
96
+ * @param params The params for the request
97
+ * @param params.collectionId The Collection ID
98
+ * @param params.itemId The Item ID
99
+ * @param params.fields The fields to update
100
+ * @param client The Axios client instance
101
+ * @returns The updated Item
102
+ */
103
+ static update({ collectionId, itemId, fields, }: {
104
+ fields: any;
105
+ itemId: string;
106
+ collectionId: string;
107
+ }, client: AxiosInstance): Promise<import("axios").AxiosResponse<IItem, any>>;
108
+ /**
109
+ * Patch a single Item
110
+ * @param params The params for the request
111
+ * @param params.collectionId The Collection ID
112
+ * @param params.itemId The Item ID
113
+ * @param params.fields The fields to patch
114
+ * @param client The Axios client instance
115
+ * @returns The patched Item
116
+ */
117
+ static patch({ collectionId, itemId, fields, }: {
118
+ fields: any;
119
+ itemId: string;
120
+ collectionId: string;
121
+ }, client: AxiosInstance): Promise<import("axios").AxiosResponse<IItem, any>>;
122
+ /**
123
+ * Remove a single Item
124
+ * @param params The params for the request
125
+ * @param params.collectionId The Collection ID
126
+ * @param params.itemId The Item ID
127
+ * @param client The Axios client instance
128
+ * @returns The result from the removal
129
+ */
130
+ static remove({ collectionId, itemId, }: {
131
+ itemId: string;
132
+ collectionId: string;
133
+ }, client: AxiosInstance): Promise<import("axios").AxiosResponse<IItemDelete, any>>;
134
+ /**
135
+ * Unpublishes a list of Items
136
+ * @param params The params for the request
137
+ * @param params.collectionId The Collection ID
138
+ * @param params.live Unpublish from the live site
139
+ * @param client The Axios client instance
140
+ * @returns The result of the unpublish
141
+ */
142
+ static unpublish({ collectionId, itemIds, live, }: {
143
+ live?: boolean;
144
+ itemIds: string[];
145
+ collectionId: string;
146
+ }, client: AxiosInstance): Promise<import("axios").AxiosResponse<IDeletedItems, any>>;
147
+ /**
148
+ * Publishes a list of Items
149
+ * @param params The request parameters
150
+ * @param params.collectionId The Collection ID
151
+ * @param params.itemIds The list of Item IDs to publish
152
+ * @param params.live Publish to live site
153
+ * @param client The Axios client instance
154
+ * @returns The result of the publish
155
+ */
156
+ static publish({ itemIds, live, collectionId, }: {
157
+ live?: boolean;
158
+ itemIds: string[];
159
+ collectionId: string;
160
+ }, client: AxiosInstance): Promise<import("axios").AxiosResponse<IPublishItems, any>>;
161
+ /**************************************************************
162
+ * Instance Methods
163
+ **************************************************************/
164
+ /**
165
+ * Update a single Item
166
+ * @param fields The fields to update
167
+ * @returns The updated Item
168
+ */
169
+ update({ ...fields }: {
170
+ [x: string]: any;
171
+ }): Promise<Item>;
172
+ /**
173
+ * Remove a single Item
174
+ * @returns The result from the removal
175
+ */
176
+ remove(): Promise<IItemDelete>;
177
+ }
package/dist/api/item.js CHANGED
@@ -1,131 +1,151 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.publish = exports.unpublish = exports.remove = exports.patch = exports.update = exports.create = exports.list = exports.getOne = void 0;
3
+ exports.Item = void 0;
4
4
  const core_1 = require("../core");
5
5
  /**************************************************************
6
- * Functions
6
+ * Class
7
7
  **************************************************************/
8
- /**
9
- * Get a single Item
10
- * @param client The Webflow client
11
- * @param params The params for the request
12
- * @param params.collectionId The Collection ID
13
- * @param params.itemId The Item ID
14
- * @returns A single Item
15
- */
16
- function getOne(client, { collectionId, itemId }) {
17
- (0, core_1.requireArgs)({ collectionId, itemId });
18
- const path = `/collections/${collectionId}/items/${itemId}`;
19
- // The API returns a paginated list with one record :(
20
- return client.get(path);
8
+ class Item extends core_1.WebflowRecord {
9
+ /**************************************************************
10
+ * Static Methods
11
+ **************************************************************/
12
+ /**
13
+ * Get a single Item
14
+ * @param params The params for the request
15
+ * @param params.collectionId The Collection ID
16
+ * @param params.itemId The Item ID
17
+ * @param client The Axios client instance
18
+ * @returns A single Item
19
+ */
20
+ static getOne({ collectionId, itemId }, client) {
21
+ (0, core_1.requireArgs)({ collectionId, itemId });
22
+ const path = `/collections/${collectionId}/items/${itemId}`;
23
+ // The API returns a paginated list with one record :(
24
+ return client.get(path);
25
+ }
26
+ /**
27
+ * Get a list of Items
28
+ * @param params The params for the request
29
+ * @param params.collectionId The Collection ID
30
+ * @param params.limit The number of items to return (optional)
31
+ * @param params.offset The number of items to skip (optional)
32
+ * @param client The Axios client instance
33
+ * @returns A list of Items
34
+ */
35
+ static list({ collectionId, limit, offset }, client) {
36
+ (0, core_1.requireArgs)({ collectionId });
37
+ const params = { limit, offset };
38
+ const path = `/collections/${collectionId}/items`;
39
+ return client.get(path, { params });
40
+ }
41
+ /**
42
+ * Create a new Item
43
+ * @param params The params for the request
44
+ * @param params.collectionId The Collection ID
45
+ * @param params.fields The Item fields to create
46
+ * @param client The Axios client instance
47
+ * @returns The created Item
48
+ */
49
+ static create({ collectionId, fields }, client) {
50
+ (0, core_1.requireArgs)({ collectionId });
51
+ const path = `/collections/${collectionId}/items`;
52
+ return client.post(path, { fields });
53
+ }
54
+ /**
55
+ * Update a single Item
56
+ * @param params The params for the request
57
+ * @param params.collectionId The Collection ID
58
+ * @param params.itemId The Item ID
59
+ * @param params.fields The fields to update
60
+ * @param client The Axios client instance
61
+ * @returns The updated Item
62
+ */
63
+ static update({ collectionId, itemId, fields, }, client) {
64
+ (0, core_1.requireArgs)({ collectionId, itemId });
65
+ const path = `/collections/${collectionId}/items/${itemId}`;
66
+ return client.put(path, { fields });
67
+ }
68
+ /**
69
+ * Patch a single Item
70
+ * @param params The params for the request
71
+ * @param params.collectionId The Collection ID
72
+ * @param params.itemId The Item ID
73
+ * @param params.fields The fields to patch
74
+ * @param client The Axios client instance
75
+ * @returns The patched Item
76
+ */
77
+ static patch({ collectionId, itemId, fields, }, client) {
78
+ (0, core_1.requireArgs)({ collectionId, itemId });
79
+ const path = `/collections/${collectionId}/items/${itemId}`;
80
+ return client.patch(path, { fields });
81
+ }
82
+ /**
83
+ * Remove a single Item
84
+ * @param params The params for the request
85
+ * @param params.collectionId The Collection ID
86
+ * @param params.itemId The Item ID
87
+ * @param client The Axios client instance
88
+ * @returns The result from the removal
89
+ */
90
+ static remove({ collectionId, itemId, }, client) {
91
+ (0, core_1.requireArgs)({ collectionId, itemId });
92
+ const path = `/collections/${collectionId}/items/${itemId}`;
93
+ return client.delete(path);
94
+ }
95
+ /**
96
+ * Unpublishes a list of Items
97
+ * @param params The params for the request
98
+ * @param params.collectionId The Collection ID
99
+ * @param params.live Unpublish from the live site
100
+ * @param client The Axios client instance
101
+ * @returns The result of the unpublish
102
+ */
103
+ static unpublish({ collectionId, itemIds, live = false, }, client) {
104
+ (0, core_1.requireArgs)({ collectionId, itemIds });
105
+ const params = { live };
106
+ const data = { itemIds };
107
+ const url = `/collections/${collectionId}/items`;
108
+ const _params = { method: "DELETE", url, data, params };
109
+ // DELETE spec doesn't support body in delete
110
+ // RFC-9110 https://tools.ietf.org/html/rfc9110
111
+ return client.request(_params);
112
+ }
113
+ /**
114
+ * Publishes a list of Items
115
+ * @param params The request parameters
116
+ * @param params.collectionId The Collection ID
117
+ * @param params.itemIds The list of Item IDs to publish
118
+ * @param params.live Publish to live site
119
+ * @param client The Axios client instance
120
+ * @returns The result of the publish
121
+ */
122
+ static publish({ itemIds, live = false, collectionId, }, client) {
123
+ (0, core_1.requireArgs)({ collectionId, itemIds });
124
+ const params = { live };
125
+ const path = `/collections/${collectionId}/items/publish`;
126
+ return client.put(path, { itemIds }, { params });
127
+ }
128
+ /**************************************************************
129
+ * Instance Methods
130
+ **************************************************************/
131
+ /**
132
+ * Update a single Item
133
+ * @param fields The fields to update
134
+ * @returns The updated Item
135
+ */
136
+ async update({ ...fields }) {
137
+ const params = { collectionId: this._cid, itemId: this._id, fields };
138
+ const res = await Item.update(params, this.client);
139
+ return new Item(this.client, res);
140
+ }
141
+ /**
142
+ * Remove a single Item
143
+ * @returns The result from the removal
144
+ */
145
+ async remove() {
146
+ const params = { collectionId: this._cid, itemId: this._id };
147
+ const res = await Item.remove(params, this.client);
148
+ return res.data;
149
+ }
21
150
  }
22
- exports.getOne = getOne;
23
- /**
24
- * Get a list of Items
25
- * @param client The Webflow client
26
- * @param params The params for the request
27
- * @param params.collectionId The Collection ID
28
- * @param params.limit The number of items to return (optional)
29
- * @param params.offset The number of items to skip (optional)
30
- * @returns A list of Items
31
- */
32
- function list(client, { collectionId, limit, offset, }) {
33
- (0, core_1.requireArgs)({ collectionId });
34
- const params = { limit, offset };
35
- const path = `/collections/${collectionId}/items`;
36
- return client.get(path, { params });
37
- }
38
- exports.list = list;
39
- /**
40
- * Create a new Item
41
- * @param client The Webflow client
42
- * @param params The params for the request
43
- * @param params.collectionId The Collection ID
44
- * @param params.fields The Item fields to create
45
- * @returns The created Item
46
- */
47
- function create(client, { collectionId, fields }) {
48
- (0, core_1.requireArgs)({ collectionId });
49
- const path = `/collections/${collectionId}/items`;
50
- return client.post(path, { fields });
51
- }
52
- exports.create = create;
53
- /**
54
- * Update a single Item
55
- * @param client The Webflow client
56
- * @param params The params for the request
57
- * @param params.collectionId The Collection ID
58
- * @param params.itemId The Item ID
59
- * @param params.fields The fields to update
60
- * @returns The updated Item
61
- */
62
- function update(client, { collectionId, itemId, fields, }) {
63
- (0, core_1.requireArgs)({ collectionId, itemId });
64
- const path = `/collections/${collectionId}/items/${itemId}`;
65
- return client.put(path, { fields });
66
- }
67
- exports.update = update;
68
- /**
69
- * Patch a single Item
70
- * @param client The Webflow client
71
- * @param params The params for the request
72
- * @param params.collectionId The Collection ID
73
- * @param params.itemId The Item ID
74
- * @param params.fields The fields to patch
75
- * @returns The patched Item
76
- */
77
- function patch(client, { collectionId, itemId, fields, }) {
78
- (0, core_1.requireArgs)({ collectionId, itemId });
79
- const path = `/collections/${collectionId}/items/${itemId}`;
80
- return client.patch(path, { fields });
81
- }
82
- exports.patch = patch;
83
- /**
84
- * Remove a single Item
85
- * @param client The Webflow client
86
- * @param params The params for the request
87
- * @param params.collectionId The Collection ID
88
- * @param params.itemId The Item ID
89
- * @returns The result from the removal
90
- */
91
- function remove(client, { collectionId, itemId, }) {
92
- (0, core_1.requireArgs)({ collectionId, itemId });
93
- const path = `/collections/${collectionId}/items/${itemId}`;
94
- return client.delete(path);
95
- }
96
- exports.remove = remove;
97
- /**
98
- * Unpublishes a list of Items
99
- * @param client The Webflow client
100
- * @param params The params for the request
101
- * @param params.collectionId The Collection ID
102
- * @param params.live Unpublish from the live site
103
- * @returns The result of the unpublish
104
- */
105
- function unpublish(client, { collectionId, itemIds, live = false, }) {
106
- (0, core_1.requireArgs)({ collectionId, itemIds });
107
- const params = { live };
108
- const data = { itemIds };
109
- const url = `/collections/${collectionId}/items`;
110
- const _params = { method: "DELETE", url, data, params };
111
- // DELETE spec doesn't support body in delete
112
- // RFC-9110 https://tools.ietf.org/html/rfc9110
113
- return client.request(_params);
114
- }
115
- exports.unpublish = unpublish;
116
- /**
117
- * Publishes a list of Items
118
- * @param client The Webflow client
119
- * @param params The request parameters
120
- * @param params.collectionId The Collection ID
121
- * @param params.itemIds The list of Item IDs to publish
122
- * @param params.live Publish to live site
123
- * @returns The result of the publish
124
- */
125
- function publish(client, { itemIds, live = false, collectionId, }) {
126
- (0, core_1.requireArgs)({ collectionId, itemIds });
127
- const params = { live };
128
- const path = `/collections/${collectionId}/items/publish`;
129
- return client.put(path, { itemIds }, { params });
130
- }
131
- exports.publish = publish;
151
+ exports.Item = Item;
@@ -1,4 +1,4 @@
1
- import { Client } from "../core";
1
+ import { AxiosInstance } from "axios";
2
2
  /**************************************************************
3
3
  * Types
4
4
  **************************************************************/
@@ -35,17 +35,19 @@ export interface IAuthentiationInfo {
35
35
  _id: string;
36
36
  }
37
37
  /**************************************************************
38
- * Functions
38
+ * Class
39
39
  **************************************************************/
40
- /**
41
- * Get the authentication info for the current token
42
- * @param client The Webflow client
43
- * @returns The authentication info
44
- */
45
- export declare function info(client: Client): Promise<import("axios").AxiosResponse<IAuthentiationInfo, any>>;
46
- /**
47
- * Get the authenticated user
48
- * @param client The Webflow client
49
- * @returns The authenticated user
50
- */
51
- export declare function user(client: Client): Promise<import("axios").AxiosResponse<IAuthenticatedUser, any>>;
40
+ export declare class Meta {
41
+ /**
42
+ * Get the authentication info for the current token
43
+ * @param client The Axios client instance
44
+ * @returns The authentication info
45
+ */
46
+ static info(client: AxiosInstance): Promise<import("axios").AxiosResponse<IAuthentiationInfo, any>>;
47
+ /**
48
+ * Get the authenticated user
49
+ * @param client The Axios client instance
50
+ * @returns The authenticated user
51
+ */
52
+ static user(client: AxiosInstance): Promise<import("axios").AxiosResponse<IAuthenticatedUser, any>>;
53
+ }
package/dist/api/meta.js CHANGED
@@ -1,24 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.user = exports.info = void 0;
3
+ exports.Meta = void 0;
4
4
  /**************************************************************
5
- * Functions
5
+ * Class
6
6
  **************************************************************/
7
- /**
8
- * Get the authentication info for the current token
9
- * @param client The Webflow client
10
- * @returns The authentication info
11
- */
12
- function info(client) {
13
- return client.get("/info");
7
+ class Meta {
8
+ /**
9
+ * Get the authentication info for the current token
10
+ * @param client The Axios client instance
11
+ * @returns The authentication info
12
+ */
13
+ static info(client) {
14
+ return client.get("/info");
15
+ }
16
+ /**
17
+ * Get the authenticated user
18
+ * @param client The Axios client instance
19
+ * @returns The authenticated user
20
+ */
21
+ static user(client) {
22
+ return client.get("/user");
23
+ }
14
24
  }
15
- exports.info = info;
16
- /**
17
- * Get the authenticated user
18
- * @param client The Webflow client
19
- * @returns The authenticated user
20
- */
21
- function user(client) {
22
- return client.get("/user");
23
- }
24
- exports.user = user;
25
+ exports.Meta = Meta;