webflow-api 1.0.1 → 1.0.3
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.
- package/README.md +5 -5
- package/dist/Webflow.js +2 -2
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/Webflow.js +2 -2
package/README.md
CHANGED
|
@@ -131,8 +131,8 @@ const auth = await webflow.accessToken({
|
|
|
131
131
|
// you now have the user's access token to make API requests with
|
|
132
132
|
const userWF = new Webflow({ token: auth.access_token });
|
|
133
133
|
|
|
134
|
-
// pull information for the
|
|
135
|
-
const
|
|
134
|
+
// pull information for the user
|
|
135
|
+
const authenticatedUser = await userWF.authenticatedUser();
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
### Revoke Token
|
|
@@ -233,10 +233,10 @@ const webhook = await site.createWebhook({
|
|
|
233
233
|
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
-
###
|
|
236
|
+
### Authenticated User
|
|
237
237
|
```javascript
|
|
238
|
-
// pull information for the
|
|
239
|
-
const
|
|
238
|
+
// pull information for the authenticated user
|
|
239
|
+
const authenticatedUser = await webflow.authenticatedUser();
|
|
240
240
|
```
|
|
241
241
|
|
|
242
242
|
|
package/dist/Webflow.js
CHANGED
|
@@ -51,7 +51,7 @@ class Webflow {
|
|
|
51
51
|
info() {
|
|
52
52
|
return this.get("/info");
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
authenticatedUser() {
|
|
55
55
|
return this.get("/user");
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -303,7 +303,7 @@ class Webflow {
|
|
|
303
303
|
if (redirect_uri) query.set("redirect_uri", redirect_uri);
|
|
304
304
|
if (state) query.set("state", state);
|
|
305
305
|
if (scope) query.set("scope", scope);
|
|
306
|
-
return `https://${this.host}/oauth/authorize?${query}`;
|
|
306
|
+
return `https://${this.client.host}/oauth/authorize?${query}`;
|
|
307
307
|
}
|
|
308
308
|
accessToken({
|
|
309
309
|
client_id,
|
package/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare class Webflow {
|
|
|
28
28
|
|
|
29
29
|
// meta
|
|
30
30
|
info(): Promise<Webflow.ApiModel.Info>;
|
|
31
|
-
|
|
31
|
+
authenticatedUser(): Promise<Webflow.ApiModel.AuthenticatedUser>;
|
|
32
32
|
|
|
33
33
|
// oauth
|
|
34
34
|
authorizeUrl(params: {
|
|
@@ -209,7 +209,7 @@ declare namespace Webflow {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
namespace ApiModel {
|
|
212
|
-
interface
|
|
212
|
+
interface AuthenticatedUser {
|
|
213
213
|
user: {
|
|
214
214
|
_id: string;
|
|
215
215
|
email: string;
|
package/package.json
CHANGED
package/src/Webflow.js
CHANGED
|
@@ -45,7 +45,7 @@ export class Webflow {
|
|
|
45
45
|
return this.get("/info");
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
authenticatedUser() {
|
|
49
49
|
return this.get("/user");
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -265,7 +265,7 @@ export class Webflow {
|
|
|
265
265
|
if (state) query.set("state", state);
|
|
266
266
|
if (scope) query.set("scope", scope);
|
|
267
267
|
|
|
268
|
-
return `https://${this.host}/oauth/authorize?${query}`;
|
|
268
|
+
return `https://${this.client.host}/oauth/authorize?${query}`;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
accessToken({
|