@wervt/client 0.0.3 → 0.0.5
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/dist/feedback.d.ts +1 -0
- package/dist/feedback.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/user.d.ts +5 -0
- package/dist/user.js +6 -1
- package/package.json +2 -2
package/dist/feedback.d.ts
CHANGED
package/dist/feedback.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FeedbackOptions, feedback, loadFeedback } from "./feedback.js";
|
|
2
2
|
import { track, trackPageView } from "./track.js";
|
|
3
|
-
import { fetchUser, loginUrl, logoutUrl } from "./user.js";
|
|
3
|
+
import { accountUrl, fetchUser, loginUrl, logoutUrl } from "./user.js";
|
|
4
4
|
import { ToolInfo, callTool, hasWebMcp, registerTools } from "./webmcp.js";
|
|
5
5
|
import { WervtRole, WervtUser } from "@wervt/core";
|
|
6
|
-
export { type FeedbackOptions, type ToolInfo, type WervtRole, type WervtUser, callTool, feedback, fetchUser, hasWebMcp, loadFeedback, loginUrl, logoutUrl, registerTools, track, trackPageView };
|
|
6
|
+
export { type FeedbackOptions, type ToolInfo, type WervtRole, type WervtUser, accountUrl, callTool, feedback, fetchUser, hasWebMcp, loadFeedback, loginUrl, logoutUrl, registerTools, track, trackPageView };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { feedback, loadFeedback } from "./feedback.js";
|
|
2
|
-
import { fetchUser, loginUrl, logoutUrl } from "./user.js";
|
|
2
|
+
import { accountUrl, fetchUser, loginUrl, logoutUrl } from "./user.js";
|
|
3
3
|
import { track, trackPageView } from "./track.js";
|
|
4
4
|
import { callTool, hasWebMcp, registerTools } from "./webmcp.js";
|
|
5
|
-
export { callTool, feedback, fetchUser, hasWebMcp, loadFeedback, loginUrl, logoutUrl, registerTools, track, trackPageView };
|
|
5
|
+
export { accountUrl, callTool, feedback, fetchUser, hasWebMcp, loadFeedback, loginUrl, logoutUrl, registerTools, track, trackPageView };
|
package/dist/user.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ import { WervtUser } from "@wervt/core";
|
|
|
3
3
|
export declare const loginUrl: (redirect?: string) => string;
|
|
4
4
|
/** Sign out of wervt (all apps), then come back to `redirect`. */
|
|
5
5
|
export declare const logoutUrl: (redirect?: string) => string;
|
|
6
|
+
/**
|
|
7
|
+
* The wervt account page (name, picture, email) in this app's look, with a button back to
|
|
8
|
+
* `redirect`. Open it with a full page load, like the login.
|
|
9
|
+
*/
|
|
10
|
+
export declare const accountUrl: (redirect?: string) => string;
|
|
6
11
|
/**
|
|
7
12
|
* The signed-in user from the app's `/_wervt/user` route, `null` when nobody is signed in or the
|
|
8
13
|
* route can't be reached. For pages the server didn't render with the user in them.
|
package/dist/user.js
CHANGED
|
@@ -4,6 +4,11 @@ const loginUrl = (redirect = "/") => `/_wervt/login?redirect=${encodeURIComponen
|
|
|
4
4
|
/** Sign out of wervt (all apps), then come back to `redirect`. */
|
|
5
5
|
const logoutUrl = (redirect = "/") => `/_wervt/logout?redirect=${encodeURIComponent(redirect)}`;
|
|
6
6
|
/**
|
|
7
|
+
* The wervt account page (name, picture, email) in this app's look, with a button back to
|
|
8
|
+
* `redirect`. Open it with a full page load, like the login.
|
|
9
|
+
*/
|
|
10
|
+
const accountUrl = (redirect = "/") => `/_wervt/account?redirect=${encodeURIComponent(redirect)}`;
|
|
11
|
+
/**
|
|
7
12
|
* The signed-in user from the app's `/_wervt/user` route, `null` when nobody is signed in or the
|
|
8
13
|
* route can't be reached. For pages the server didn't render with the user in them.
|
|
9
14
|
*/
|
|
@@ -19,4 +24,4 @@ async function fetchUser(options = {}) {
|
|
|
19
24
|
function trimBase(base = "") {
|
|
20
25
|
return base.replace(/\/$/, "");
|
|
21
26
|
}
|
|
22
|
-
export { fetchUser, loginUrl, logoutUrl, trimBase };
|
|
27
|
+
export { accountUrl, fetchUser, loginUrl, logoutUrl, trimBase };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wervt/client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Browser SDK for apps on wervt, for any framework: the signed-in user, live data from shapes, analytics events, the feedback widget and WebMCP tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"electric",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@wervt/core": "^0.0.
|
|
34
|
+
"@wervt/core": "^0.0.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@electric-sql/client": "^1.5.28"
|