@zitadel/sdk-svelte 0.1.0-alpha.16 → 0.1.0-alpha.18
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 +8 -20
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32 -31
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -29,26 +29,14 @@ The widget's flow events are also surfaced as optional callbacks:
|
|
|
29
29
|
## Proxying to the backend (deployment)
|
|
30
30
|
|
|
31
31
|
The widgets call `${proxyPath}/…` same-origin (default `/__nextgen`). A SPA has no
|
|
32
|
-
server, so
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
export default (req: Request) => handleProxy(req, proxyConfig);
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
// vercel.json
|
|
46
|
-
{
|
|
47
|
-
"rewrites": [
|
|
48
|
-
{ "source": "/__nextgen/(.*)", "destination": "/api/__nextgen/$1" }
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
```
|
|
32
|
+
server, so in production the path comes from your hosting platform — a
|
|
33
|
+
`vercel.json` rewrite, a `netlify.toml` redirect, or a minimal Cloudflare
|
|
34
|
+
worker — with no secrets on the platform, per
|
|
35
|
+
[ADR 036](https://github.com/zitadel/nextgen/blob/main/docs/adrs/036-api-credential-planes.md).
|
|
36
|
+
CLI scaffolding for these configs is tracked in
|
|
37
|
+
[zitadel/nextgen#560](https://github.com/zitadel/nextgen/issues/560). **Until
|
|
38
|
+
that work lands, production SPA deployment is not yet supported** — the CLI dev
|
|
39
|
+
proxy covers local development.
|
|
52
40
|
|
|
53
41
|
For local development you can skip the proxy and point `proxyPath` straight at the
|
|
54
42
|
backend (cross-origin), e.g. `proxyPath: "http://localhost:4000"`.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { default as ZitadelSession } from "./ZitadelSession.svelte";
|
|
|
4
4
|
export { configureZitadel, getApi, getZitadelConfig } from "@zitadel/api/config";
|
|
5
5
|
export type { ZitadelConfig, ZitadelProject } from "@zitadel/api/config";
|
|
6
6
|
export * from "./types";
|
|
7
|
+
export { businessLocales } from "@zitadel/components";
|
package/dist/index.js
CHANGED
|
@@ -1,69 +1,70 @@
|
|
|
1
1
|
import "svelte/internal/disclose-version";
|
|
2
2
|
import * as e from "svelte/internal/client";
|
|
3
|
-
import "@zitadel/components";
|
|
4
|
-
import { configureZitadel as
|
|
3
|
+
import { businessLocales as j } from "@zitadel/components";
|
|
4
|
+
import { configureZitadel as S, getApi as b, getZitadelConfig as y } from "@zitadel/api/config";
|
|
5
5
|
var f = e.from_html("<zitadel-login></zitadel-login>", 2);
|
|
6
|
-
function h(
|
|
6
|
+
function h(s, t) {
|
|
7
7
|
e.push(t, !0);
|
|
8
8
|
let l = e.prop(t, "purpose", 3, "login"), i = e.state(void 0);
|
|
9
|
-
function
|
|
9
|
+
function r() {
|
|
10
10
|
return e.get(i);
|
|
11
11
|
}
|
|
12
12
|
e.user_effect(() => {
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
13
|
+
const o = e.get(i);
|
|
14
|
+
if (!o)
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
|
|
16
|
+
const m = (_) => t.onFlowStep?.(_.detail), d = (_) => t.onFlowInput?.(_.detail), c = (_) => t.onFlowComplete?.(_.detail), u = (_) => t.onFlowError?.(_.detail);
|
|
17
|
+
return o.addEventListener("zitadel-flow-step", m), o.addEventListener("zitadel-flow-input", d), o.addEventListener("zitadel-flow-complete", c), o.addEventListener("zitadel-flow-error", u), () => {
|
|
18
|
+
o.removeEventListener("zitadel-flow-step", m), o.removeEventListener("zitadel-flow-input", d), o.removeEventListener("zitadel-flow-complete", c), o.removeEventListener("zitadel-flow-error", u);
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
|
-
var n = { getElement:
|
|
22
|
-
return e.template_effect(() => e.set_custom_element_data(
|
|
21
|
+
var n = { getElement: r }, a = f();
|
|
22
|
+
return e.template_effect(() => e.set_custom_element_data(a, "project", t.project)), e.template_effect(() => e.set_custom_element_data(a, "purpose", l())), e.template_effect(() => e.set_custom_element_data(a, "locales", t.locales)), e.template_effect(() => e.set_custom_element_data(a, "lang", t.lang)), e.template_effect(() => e.set_custom_element_data(a, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(a, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(a, "post-sign-in-url", t.postSignInUrl)), e.template_effect(() => e.set_custom_element_data(a, "flow-name", t.flowName)), e.template_effect(() => e.set_custom_element_data(a, "variant", t.variant)), e.template_effect(() => e.set_custom_element_data(a, "theme", t.theme)), e.bind_this(a, (o) => e.set(i, o), () => e.get(i)), e.append(s, a), e.pop(n);
|
|
23
23
|
}
|
|
24
24
|
var g = e.from_html("<zitadel-logout></zitadel-logout>", 2);
|
|
25
|
-
function
|
|
25
|
+
function z(s, t) {
|
|
26
26
|
e.push(t, !0);
|
|
27
27
|
let l = e.state(void 0);
|
|
28
28
|
function i() {
|
|
29
29
|
return e.get(l);
|
|
30
30
|
}
|
|
31
31
|
e.user_effect(() => {
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
32
|
+
const a = e.get(l);
|
|
33
|
+
if (!a)
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
|
|
35
|
+
const o = (m) => t.onSignout?.(m.detail);
|
|
36
|
+
return a.addEventListener("zitadel-signout", o), () => {
|
|
37
|
+
a.removeEventListener("zitadel-signout", o);
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
|
-
var
|
|
41
|
-
return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.bind_this(n, (
|
|
40
|
+
var r = { getElement: i }, n = g();
|
|
41
|
+
return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.bind_this(n, (a) => e.set(l, a), () => e.get(l)), e.append(s, n), e.pop(r);
|
|
42
42
|
}
|
|
43
43
|
var p = e.from_html("<zitadel-session></zitadel-session>", 2);
|
|
44
|
-
function
|
|
44
|
+
function E(s, t) {
|
|
45
45
|
e.push(t, !0);
|
|
46
46
|
let l = e.state(void 0);
|
|
47
47
|
function i() {
|
|
48
48
|
return e.get(l);
|
|
49
49
|
}
|
|
50
50
|
e.user_effect(() => {
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
51
|
+
const a = e.get(l);
|
|
52
|
+
if (!a)
|
|
53
53
|
return;
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
|
|
54
|
+
const o = (m) => t.onSignout?.(m.detail);
|
|
55
|
+
return a.addEventListener("zitadel-signout", o), () => {
|
|
56
|
+
a.removeEventListener("zitadel-signout", o);
|
|
57
57
|
};
|
|
58
58
|
});
|
|
59
|
-
var
|
|
60
|
-
return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.template_effect(() => e.set_custom_element_data(n, "heading", t.heading)), e.template_effect(() => e.set_custom_element_data(n, "logout-label", t.logoutLabel)), e.bind_this(n, (
|
|
59
|
+
var r = { getElement: i }, n = p();
|
|
60
|
+
return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.template_effect(() => e.set_custom_element_data(n, "heading", t.heading)), e.template_effect(() => e.set_custom_element_data(n, "logout-label", t.logoutLabel)), e.template_effect(() => e.set_custom_element_data(n, "variant", t.variant)), e.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.bind_this(n, (a) => e.set(l, a), () => e.get(l)), e.append(s, n), e.pop(r);
|
|
61
61
|
}
|
|
62
62
|
export {
|
|
63
63
|
h as ZitadelLogin,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
S as
|
|
64
|
+
z as ZitadelLogout,
|
|
65
|
+
E as ZitadelSession,
|
|
66
|
+
j as businessLocales,
|
|
67
|
+
S as configureZitadel,
|
|
68
|
+
b as getApi,
|
|
68
69
|
y as getZitadelConfig
|
|
69
70
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zitadel/sdk-svelte",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.18",
|
|
4
4
|
"description": "Svelte components for the Zitadel auth UI (client-side SPA).",
|
|
5
5
|
"homepage": "https://github.com/zitadel/nextgen/tree/main/packages/sdk-svelte#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zitadel/
|
|
33
|
-
"@zitadel/
|
|
34
|
-
"@zitadel/sdk-core": "0.1.0-alpha.
|
|
32
|
+
"@zitadel/components": "0.1.0-alpha.18",
|
|
33
|
+
"@zitadel/api": "0.1.0-alpha.18",
|
|
34
|
+
"@zitadel/sdk-core": "0.1.0-alpha.18"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"svelte": "^5.0.0"
|