@zitadel/components 0.0.0
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/LICENSE +21 -0
- package/README.md +346 -0
- package/dist/atoms/index.d.mts +2 -0
- package/dist/atoms/index.d.ts +9 -0
- package/dist/atoms/index.d.ts.map +1 -0
- package/dist/atoms/index.mjs +2 -0
- package/dist/atoms/zl-alert.d.ts +56 -0
- package/dist/atoms/zl-alert.d.ts.map +1 -0
- package/dist/atoms/zl-button.d.ts +83 -0
- package/dist/atoms/zl-button.d.ts.map +1 -0
- package/dist/atoms/zl-card.d.ts +46 -0
- package/dist/atoms/zl-card.d.ts.map +1 -0
- package/dist/atoms/zl-field.d.ts +73 -0
- package/dist/atoms/zl-field.d.ts.map +1 -0
- package/dist/atoms/zl-icon.d.ts +48 -0
- package/dist/atoms/zl-icon.d.ts.map +1 -0
- package/dist/atoms/zl-page-shell.d.ts +42 -0
- package/dist/atoms/zl-page-shell.d.ts.map +1 -0
- package/dist/atoms/zl-passkey.d.ts +118 -0
- package/dist/atoms/zl-passkey.d.ts.map +1 -0
- package/dist/atoms/zl-pill.d.ts +55 -0
- package/dist/atoms/zl-pill.d.ts.map +1 -0
- package/dist/atoms-CmOTltTH.mjs +1311 -0
- package/dist/atoms-CmOTltTH.mjs.map +1 -0
- package/dist/index-7FDHEpv5.d.mts +996 -0
- package/dist/index-7FDHEpv5.d.mts.map +1 -0
- package/dist/index-DIUFZjXw.d.mts +6696 -0
- package/dist/index-DIUFZjXw.d.mts.map +1 -0
- package/dist/index-DaOSCm0T.d.mts +249 -0
- package/dist/index-DaOSCm0T.d.mts.map +1 -0
- package/dist/index-bZEvwHtq.d.mts +996 -0
- package/dist/index-bZEvwHtq.d.mts.map +1 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +6 -0
- package/dist/internal/base64url.d.ts +18 -0
- package/dist/internal/base64url.d.ts.map +1 -0
- package/dist/internal/unique-id.d.ts +2 -0
- package/dist/internal/unique-id.d.ts.map +1 -0
- package/dist/manifest-DCC2FxCE.d.mts +39 -0
- package/dist/manifest-DCC2FxCE.d.mts.map +1 -0
- package/dist/manifest.d.ts +36 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifests.d.mts +9 -0
- package/dist/manifests.d.mts.map +1 -0
- package/dist/manifests.d.ts +6 -0
- package/dist/manifests.d.ts.map +1 -0
- package/dist/manifests.mjs +30 -0
- package/dist/manifests.mjs.map +1 -0
- package/dist/orchestrator/api-client.d.ts +33 -0
- package/dist/orchestrator/api-client.d.ts.map +1 -0
- package/dist/orchestrator/branding-to-tokens.d.ts +28 -0
- package/dist/orchestrator/branding-to-tokens.d.ts.map +1 -0
- package/dist/orchestrator/branding-validator.d.ts +7 -0
- package/dist/orchestrator/branding-validator.d.ts.map +1 -0
- package/dist/orchestrator/branding.d.ts +76 -0
- package/dist/orchestrator/branding.d.ts.map +1 -0
- package/dist/orchestrator/font-loader.d.ts +2 -0
- package/dist/orchestrator/font-loader.d.ts.map +1 -0
- package/dist/orchestrator/index.d.mts +2 -0
- package/dist/orchestrator/index.d.ts +25 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.mjs +2 -0
- package/dist/orchestrator/liquid.d.ts +28 -0
- package/dist/orchestrator/liquid.d.ts.map +1 -0
- package/dist/orchestrator/locales/de.d.ts +9 -0
- package/dist/orchestrator/locales/de.d.ts.map +1 -0
- package/dist/orchestrator/locales/en.d.ts +13 -0
- package/dist/orchestrator/locales/en.d.ts.map +1 -0
- package/dist/orchestrator/locales/index.d.ts +12 -0
- package/dist/orchestrator/locales/index.d.ts.map +1 -0
- package/dist/orchestrator/mandatory-gates.d.ts +26 -0
- package/dist/orchestrator/mandatory-gates.d.ts.map +1 -0
- package/dist/orchestrator/sanitiser.d.ts +6 -0
- package/dist/orchestrator/sanitiser.d.ts.map +1 -0
- package/dist/orchestrator/template-context.d.ts +55 -0
- package/dist/orchestrator/template-context.d.ts.map +1 -0
- package/dist/orchestrator/template-names.d.ts +16 -0
- package/dist/orchestrator/template-names.d.ts.map +1 -0
- package/dist/orchestrator/templates/auth-form.liquid.d.ts +14 -0
- package/dist/orchestrator/templates/auth-form.liquid.d.ts.map +1 -0
- package/dist/orchestrator/templates/default.liquid.d.ts +23 -0
- package/dist/orchestrator/templates/default.liquid.d.ts.map +1 -0
- package/dist/orchestrator/templates/passkey-upsell.liquid.d.ts +15 -0
- package/dist/orchestrator/templates/passkey-upsell.liquid.d.ts.map +1 -0
- package/dist/orchestrator/templates/signed-in.liquid.d.ts +20 -0
- package/dist/orchestrator/templates/signed-in.liquid.d.ts.map +1 -0
- package/dist/orchestrator/theme-controller.d.ts +30 -0
- package/dist/orchestrator/theme-controller.d.ts.map +1 -0
- package/dist/orchestrator/zitadel-login.d.ts +182 -0
- package/dist/orchestrator/zitadel-login.d.ts.map +1 -0
- package/dist/orchestrator/zitadel-logout.d.ts +86 -0
- package/dist/orchestrator/zitadel-logout.d.ts.map +1 -0
- package/dist/orchestrator-CNKo2WQG.mjs +3336 -0
- package/dist/orchestrator-CNKo2WQG.mjs.map +1 -0
- package/dist/styles/base.d.ts +7 -0
- package/dist/styles/base.d.ts.map +1 -0
- package/dist/styles/focus-ring.d.ts +7 -0
- package/dist/styles/focus-ring.d.ts.map +1 -0
- package/dist/styles/index.d.ts +5 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/surface.d.ts +8 -0
- package/dist/styles/surface.d.ts.map +1 -0
- package/dist/styles/tokens.d.ts +11 -0
- package/dist/styles/tokens.d.ts.map +1 -0
- package/dist/tokens/index.d.mts +2 -0
- package/dist/tokens/index.d.ts +9 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.mjs +2 -0
- package/dist/tokens-TXmurodq.mjs +244 -0
- package/dist/tokens-TXmurodq.mjs.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `{% mandatory_gates %}` runtime patcher.
|
|
3
|
+
*
|
|
4
|
+
* Per `docs/design/branding/validator.md` §Runtime safety net:
|
|
5
|
+
*
|
|
6
|
+
* "After the template finishes rendering, the tag inspects the produced DOM
|
|
7
|
+
* and appends:
|
|
8
|
+
* - Any required `fields[*]` without a matching `<zl-field>`.
|
|
9
|
+
* - Any required `gates[*]` without a matching consumer.
|
|
10
|
+
* - A primary `<zl-button type="submit">` if none was reached."
|
|
11
|
+
*
|
|
12
|
+
* Implementation: the LiquidJS `{% mandatory_gates %}` tag emits a unique
|
|
13
|
+
* marker comment. After Liquid renders, this patcher parses the produced
|
|
14
|
+
* HTML into a `<template>`, builds any missing atoms as real DOM elements,
|
|
15
|
+
* replaces the marker with them, and serialises back to a string.
|
|
16
|
+
*
|
|
17
|
+
* Building elements via the DOM (`document.createElement` + `setAttribute`)
|
|
18
|
+
* delegates HTML attribute escaping to the browser's serialiser — no manual
|
|
19
|
+
* string-escaping in this module.
|
|
20
|
+
*/
|
|
21
|
+
import type { CreateFlow201Step } from "@zitadel/api/generated/model";
|
|
22
|
+
import type { Locale } from "./locales/en.js";
|
|
23
|
+
export declare const MANDATORY_GATES_MARKER = "ZL_MANDATORY_GATES";
|
|
24
|
+
export declare const mandatoryGatesMarkerComment = "<!--ZL_MANDATORY_GATES-->";
|
|
25
|
+
export declare function patchMandatoryGates(html: string, step: CreateFlow201Step, locale: Locale): string;
|
|
26
|
+
//# sourceMappingURL=mandatory-gates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mandatory-gates.d.ts","sourceRoot":"","sources":["../../src/orchestrator/mandatory-gates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D,eAAO,MAAM,2BAA2B,8BAAqC,CAAC;AAE9E,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,MAAM,GACb,MAAM,CAoBR"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a sanitiser bound to the current manifest registry. Callers should
|
|
3
|
+
* cache the result; rebuilding is cheap but allocates a fresh DOMPurify config.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createSanitiser(): (html: string) => string;
|
|
6
|
+
//# sourceMappingURL=sanitiser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitiser.d.ts","sourceRoot":"","sources":["../../src/orchestrator/sanitiser.ts"],"names":[],"mappings":"AAyGA;;;GAGG;AACH,wBAAgB,eAAe,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAsB1D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Liquid template context contract.
|
|
3
|
+
*
|
|
4
|
+
* The orchestrator feeds tenant Liquid templates a stable, renderer-friendly
|
|
5
|
+
* projection of the wire `CreateFlow201` shape. Capability dictionaries
|
|
6
|
+
* (`fields`, `actions`, `gates`, `sso_providers`) are typed straight from
|
|
7
|
+
* the orval-generated wire so templates iterate over the same schema the
|
|
8
|
+
* server promises.
|
|
9
|
+
*
|
|
10
|
+
* The orchestrator owns three projections that don't exist on the wire:
|
|
11
|
+
*
|
|
12
|
+
* 1. `errors` — lifted from `step.error: string | null` so templates iterate
|
|
13
|
+
* uniformly even though the wire only carries one error string.
|
|
14
|
+
* 2. `messages` — populated by orchestrator decoration hooks (info banners,
|
|
15
|
+
* sticky notices); not on the wire.
|
|
16
|
+
* 3. `identity` — resolved client-side for greet-by-name; not on the wire.
|
|
17
|
+
*/
|
|
18
|
+
import type { CreateFlow201Step, CreateFlow201StepActions, CreateFlow201StepChallenge, CreateFlow201StepFields, CreateFlow201StepGates, CreateFlow201StepSsoProvidersItem } from "@zitadel/api/generated/model";
|
|
19
|
+
import type { Branding } from "./branding.js";
|
|
20
|
+
export type FlowMessage = {
|
|
21
|
+
level: "info" | "warning";
|
|
22
|
+
text_key: string;
|
|
23
|
+
};
|
|
24
|
+
export type FlowError = {
|
|
25
|
+
code?: string;
|
|
26
|
+
text_key?: string;
|
|
27
|
+
message?: string;
|
|
28
|
+
};
|
|
29
|
+
export type FlowIdentity = {
|
|
30
|
+
display_name?: string;
|
|
31
|
+
email_address?: string;
|
|
32
|
+
avatar_url?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Liquid render context. The orchestrator builds this from the wire
|
|
36
|
+
* `CreateFlow201` payload before invoking the engine.
|
|
37
|
+
*
|
|
38
|
+
* Capability dictionaries point at the orval wire shapes directly. The only
|
|
39
|
+
* client-only pieces are `messages`, `identity`, `errors`, the resolved
|
|
40
|
+
* `branding` (v2 superset), and `loading`.
|
|
41
|
+
*/
|
|
42
|
+
export type LiquidContext = {
|
|
43
|
+
step: Pick<CreateFlow201Step, "name" | "complete" | "texts">;
|
|
44
|
+
fields: CreateFlow201StepFields;
|
|
45
|
+
actions: CreateFlow201StepActions;
|
|
46
|
+
gates: CreateFlow201StepGates;
|
|
47
|
+
sso_providers: readonly CreateFlow201StepSsoProvidersItem[];
|
|
48
|
+
challenge: CreateFlow201StepChallenge | null;
|
|
49
|
+
messages: readonly FlowMessage[];
|
|
50
|
+
identity: FlowIdentity | null;
|
|
51
|
+
errors: readonly FlowError[];
|
|
52
|
+
branding: Branding | Record<string, never>;
|
|
53
|
+
loading: boolean;
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=template-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-context.d.ts","sourceRoot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OAAO,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names of the bundled Liquid templates the `<zitadel-login>` orchestrator
|
|
3
|
+
* registers.
|
|
4
|
+
*
|
|
5
|
+
* This lives in its own module — separate from `liquid.ts` — so the public
|
|
6
|
+
* barrel can re-export `TEMPLATE_NAMES` without dragging LiquidJS' `Liquid`
|
|
7
|
+
* type (and its Node ambient-type requirements) into the published
|
|
8
|
+
* declaration surface. See `liquid.ts` / the orchestrator barrel.
|
|
9
|
+
*/
|
|
10
|
+
export declare const TEMPLATE_NAMES: {
|
|
11
|
+
readonly default: "default";
|
|
12
|
+
readonly authForm: "auth-form";
|
|
13
|
+
readonly passkeyUpsell: "passkey-upsell";
|
|
14
|
+
readonly signedIn: "signed-in";
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=template-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-names.d.ts","sourceRoot":"","sources":["../../src/orchestrator/template-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;aACzB,OAAO,EAAE,SAAS;aAClB,QAAQ,EAAE,WAAW;aACrB,aAAa,EAAE,gBAAgB;aAC/B,QAAQ,EAAE,WAAW;CACb,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `auth-form` partial — Sign in and Sign up screens (Figma screens file).
|
|
3
|
+
*
|
|
4
|
+
* Sign up 2xl frame: `6593:141741` (card `6593:141743`, attribution `6593:141767`).
|
|
5
|
+
* Sign in 2xl frame: `6593:141983`, card `6593:141985`, stack `6593:141989`
|
|
6
|
+
* (email + password + forgot link + CTAs on one step).
|
|
7
|
+
* Sign-in errors: wrong credentials `6602:180268`, server alert `6594:125237`.
|
|
8
|
+
*
|
|
9
|
+
* Figma `Field+CTAs` stacks fields + CTAs in one column at 16px (`spacing-03`).
|
|
10
|
+
* Primary/secondary are 48px buttons; register / sign_in are body copy with a
|
|
11
|
+
* purple text link (24px row) — not `<zl-button hierarchy="text">`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const authFormTemplate: string;
|
|
14
|
+
//# sourceMappingURL=auth-form.liquid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-form.liquid.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/auth-form.liquid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,QAwG5B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled `default.liquid` master template.
|
|
3
|
+
*
|
|
4
|
+
* Renders the four target Figma auth screens (Sign in, Sign up, Passkey
|
|
5
|
+
* upsell, Signed in) by including the appropriate partial based on
|
|
6
|
+
* `step.name`. Tenant-specific layouts (`branding.layout`) replace the
|
|
7
|
+
* outer chrome only — the per-step partials stay shared so atom output
|
|
8
|
+
* tracks the design system without each tenant re-implementing it.
|
|
9
|
+
*
|
|
10
|
+
* Spec: docs/design/branding/templates.md.
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultTemplate: string;
|
|
13
|
+
/**
|
|
14
|
+
* Layout chrome injected as an `adoptedStyleSheet` on the orchestrator's
|
|
15
|
+
* shadow root. Provides the page background and the attribution-footer
|
|
16
|
+
* positioning that lives *outside* any template — the rest of the visual
|
|
17
|
+
* surface is owned by the `<zl-page-shell>` / `<zl-card>` atoms the
|
|
18
|
+
* templates render. Token references resolve against the
|
|
19
|
+
* `@zitadel/design-tokens` CSS variables that are present on
|
|
20
|
+
* `:host` via the branding stylesheet.
|
|
21
|
+
*/
|
|
22
|
+
export declare const layoutChromeCss = "\n:host {\n display: block;\n min-height: 100%;\n background: var(--zl-color-surface-default-black, #0f0f11);\n color: var(--zl-color-text-primary-white, #f4f4f6);\n font-family: var(--zl-font-family-sans, system-ui, sans-serif);\n}\n.zl-mount {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n background: inherit;\n color: inherit;\n}\n.zl-mount > zl-page-shell,\n.zl-mount > [data-zl-template-root] {\n flex: 1 1 auto;\n}\n.zl-attribution {\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n}\n.zl-attribution[hidden] {\n display: none;\n}\n/* Card header typography \u2014 Figma \"Desktop/Headings/Small\" + \"Body Small\n Regular\" pattern shared by sign-in (6593:141740), passkey upsell\n (6594:89142 / 6594:12796), and signed-in (6596:132845). Templates\n slot raw <h1>/<p> elements into <zl-card>, which keeps them in the\n light DOM where the orchestrator's stylesheet can reach them \u2014 the\n atom intentionally doesn't dictate typography. */\n.zl-card-title {\n margin: 0;\n font-family: var(--zl-font-family-heading, var(--zl-font-family-sans, system-ui, sans-serif));\n font-size: 2rem;\n font-weight: 400;\n line-height: 2.5rem;\n letter-spacing: -0.02em;\n color: var(--zl-color-text-primary-white, #f4f4f6);\n text-align: left;\n}\n.zl-card-subtitle {\n margin: 0;\n font-family: var(--zl-font-family-sans, system-ui, sans-serif);\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 400;\n color: var(--zl-color-text-primary-white, #f4f4f6);\n}\n/* Figma 6593:141989 / 6594:12882 \u2014 left-aligned in Field+CTAs (x=0, items-start). */\n.zl-card-nav {\n margin: 0;\n font-family: var(--zl-font-family-sans, system-ui, sans-serif);\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 400;\n color: var(--zl-color-text-primary-white, #f4f4f6);\n text-align: left;\n}\n.zl-card-nav__link {\n display: inline;\n margin: 0;\n padding: 0;\n border: none;\n background: transparent;\n font: inherit;\n line-height: inherit;\n color: var(--zl-color-icon-default-purple, #bba5e4);\n text-decoration: none;\n cursor: pointer;\n}\n.zl-card-nav__link:hover {\n text-decoration: underline;\n}\n.zl-card-nav__link:focus-visible {\n outline: var(--zl-focus-width, 2px) solid var(--zl-focus-color, #f4f4f6);\n outline-offset: var(--zl-focus-offset, 2px);\n}\n/* Figma 6593:141989 \u2014 forgot password row (left-aligned, before CTAs). */\n.zl-card-forgot {\n margin: 0;\n text-align: left;\n}\n.zl-card-forgot__link {\n display: inline;\n margin: 0;\n padding: 0;\n border: none;\n background: transparent;\n font-family: var(--zl-font-family-sans, system-ui, sans-serif);\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 400;\n color: var(--zl-color-icon-default-purple, #bba5e4);\n text-decoration: none;\n cursor: pointer;\n}\n.zl-card-forgot__link:hover {\n text-decoration: underline;\n}\n.zl-card-forgot__link:focus-visible {\n outline: var(--zl-focus-width, 2px) solid var(--zl-focus-color, #f4f4f6);\n outline-offset: var(--zl-focus-offset, 2px);\n}\n";
|
|
23
|
+
//# sourceMappingURL=default.liquid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.liquid.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/default.liquid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,QAQ3B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,2jGA2G3B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `passkey-upsell` partial — third Figma target screen (file
|
|
3
|
+
* `xkvBjkOJ8ENuHdTGZHXezK`, node `6594:630`).
|
|
4
|
+
*
|
|
5
|
+
* Differs from `auth-form`:
|
|
6
|
+
* - heading + subtitle live in a compact card (gap 24px instead of 32px),
|
|
7
|
+
* - primary "Set up passkey" CTA carries a trailing 24px passkey icon
|
|
8
|
+
* (Figma slots the icon to the right of the label, not above it),
|
|
9
|
+
* - secondary "Skip for now" uses the dark secondary hierarchy, not the
|
|
10
|
+
* `text` hierarchy — the Figma button has a solid #252528 background.
|
|
11
|
+
*
|
|
12
|
+
* Server-side errors land in a `<zl-alert>` the same way as the auth form.
|
|
13
|
+
*/
|
|
14
|
+
export declare const passkeyUpsellTemplate: string;
|
|
15
|
+
//# sourceMappingURL=passkey-upsell.liquid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passkey-upsell.liquid.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/passkey-upsell.liquid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,QA8DjC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `signed-in` partial — fourth Figma target screen (file
|
|
3
|
+
* `xkvBjkOJ8ENuHdTGZHXezK`, node `6596:132844`).
|
|
4
|
+
*
|
|
5
|
+
* Figma layout:
|
|
6
|
+
* - heading "You're signed in as" (left-aligned, full width)
|
|
7
|
+
* - body line with the authenticated email address (Arimo Regular 16/24)
|
|
8
|
+
* - "Continue" primary CTA
|
|
9
|
+
* - "Logout" secondary CTA
|
|
10
|
+
*
|
|
11
|
+
* No avatar / identity hero glyph: the Figma frame is intentionally a
|
|
12
|
+
* pure modal layover and dropping the avatar keeps the orchestrator
|
|
13
|
+
* default in lockstep with the spec.
|
|
14
|
+
*
|
|
15
|
+
* Rendered when the flow returns a terminal step (`complete: "show"`)
|
|
16
|
+
* and no `post-sign-in-url` is configured, so the user can confirm the
|
|
17
|
+
* identity before the host SPA takes over.
|
|
18
|
+
*/
|
|
19
|
+
export declare const signedInTemplate: string;
|
|
20
|
+
//# sourceMappingURL=signed-in.liquid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signed-in.liquid.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/signed-in.liquid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,QA8E5B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ThemeController` — Lit ReactiveController that resolves the active
|
|
3
|
+
* `light | dark` theme from the current `Branding` payload and keeps it in
|
|
4
|
+
* sync with the OS-level `prefers-color-scheme` when the tenant opts into
|
|
5
|
+
* `theme.mode = "auto"`.
|
|
6
|
+
*
|
|
7
|
+
* Per `docs/design/branding/tokens.md` the orchestrator owns theming entirely.
|
|
8
|
+
* Subscribing here is what makes "auto" actually reactive instead of a
|
|
9
|
+
* one-shot read at first paint.
|
|
10
|
+
*/
|
|
11
|
+
import type { ReactiveController, ReactiveControllerHost } from "lit";
|
|
12
|
+
import type { Branding } from "./branding.js";
|
|
13
|
+
export type ResolvedTheme = "light" | "dark";
|
|
14
|
+
export declare class ThemeController implements ReactiveController {
|
|
15
|
+
private readonly host;
|
|
16
|
+
private branding;
|
|
17
|
+
private mediaQuery;
|
|
18
|
+
private _theme;
|
|
19
|
+
constructor(host: ReactiveControllerHost);
|
|
20
|
+
get theme(): ResolvedTheme;
|
|
21
|
+
setBranding(branding: Branding | undefined): void;
|
|
22
|
+
hostConnected(): void;
|
|
23
|
+
hostDisconnected(): void;
|
|
24
|
+
private refresh;
|
|
25
|
+
private attach;
|
|
26
|
+
private detach;
|
|
27
|
+
private onMediaChange;
|
|
28
|
+
private update;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=theme-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-controller.d.ts","sourceRoot":"","sources":["../../src/orchestrator/theme-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAI7C,qBAAa,eAAgB,YAAW,kBAAkB;IACxD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyB;IAE9C,OAAO,CAAC,QAAQ,CAAuB;IAEvC,OAAO,CAAC,UAAU,CAA+B;IAKjD,OAAO,CAAC,MAAM,CAAyB;IAEvC,YAAY,IAAI,EAAE,sBAAsB,EAGvC;IAED,IAAI,KAAK,IAAI,aAAa,CAEzB;IAED,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAGhD;IAED,aAAa,IAAI,IAAI,CAEpB;IAED,gBAAgB,IAAI,IAAI,CAEvB;IAED,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,MAAM;CAKf"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { type ZitadelProject } from "@zitadel/api/config";
|
|
2
|
+
import type { CreateFlowBodyPurpose } from "@zitadel/api/generated/model";
|
|
3
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
4
|
+
import "../atoms/index.js";
|
|
5
|
+
import { type Locale } from "./locales/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* `<zitadel-login>` — the auth-UI orchestrator.
|
|
8
|
+
*
|
|
9
|
+
* Drives the typed `@zitadel/api` Flow API directly: `POST /flow`
|
|
10
|
+
* starts a flow, `POST /flow/{id}/submit` advances it. Renders each step
|
|
11
|
+
* through LiquidJS, sanitises the output via DOMPurify, and mounts the
|
|
12
|
+
* result inside a real `<form>` element in its Shadow DOM via Lit's
|
|
13
|
+
* `unsafeHTML` directive. Atom CustomEvents (`zl-input` / `zl-submit`)
|
|
14
|
+
* and the form's native `submit` event feed back into the
|
|
15
|
+
* submit cycle.
|
|
16
|
+
*
|
|
17
|
+
* Form participation: the orchestrator owns the `<form>` so Enter submits,
|
|
18
|
+
* browsers offer "save password" prompts, and password managers / autofill
|
|
19
|
+
* see a real form. Each `<zl-field>` is form-associated (see
|
|
20
|
+
* `docs/design/branding/form-participation.md`) so its value participates in
|
|
21
|
+
* the form even though it lives inside its own shadow root. The shadow root
|
|
22
|
+
* also delegates focus, and after each step swap focus moves to the first
|
|
23
|
+
* field so screen-reader and keyboard users land in a sensible spot.
|
|
24
|
+
*
|
|
25
|
+
* Session/state: the server is stateless between requests — a `_zflow`
|
|
26
|
+
* HttpOnly cookie carries orchestration state. We always run with
|
|
27
|
+
* `credentials: "include"` (set in `api-client.ts`). The flow handle (`id`)
|
|
28
|
+
* may rotate on pivots/pops; we re-read it from every response.
|
|
29
|
+
*
|
|
30
|
+
* Spec sources:
|
|
31
|
+
* - `docs/design/flowengine/flow-engine-guide.md`
|
|
32
|
+
* - `docs/design/branding/templates.md`
|
|
33
|
+
* - `docs/design/branding/tokens.md`
|
|
34
|
+
* - `docs/design/branding/schema.md`
|
|
35
|
+
* - `docs/design/branding/form-participation.md`
|
|
36
|
+
* - `docs/design/flowengine/template-security.md`
|
|
37
|
+
*/
|
|
38
|
+
export declare class ZitadelLogin extends LitElement {
|
|
39
|
+
static shadowRootOptions: ShadowRootInit;
|
|
40
|
+
static styles: import("lit").CSSResult;
|
|
41
|
+
accessor purpose: CreateFlowBodyPurpose;
|
|
42
|
+
/**
|
|
43
|
+
* SDK project handle returned by `configureZitadel()`. When set, takes
|
|
44
|
+
* precedence over the global singleton from `getZitadelConfig()`.
|
|
45
|
+
*/
|
|
46
|
+
accessor project: ZitadelProject | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* URL to navigate to after a successful embedded sign-in. When set, the
|
|
49
|
+
* orchestrator exchanges the terminal `handoff_token` via the generated
|
|
50
|
+
* API client (setting the session cookie) and then performs a full
|
|
51
|
+
* navigation to this URL so host middleware can observe the cookie.
|
|
52
|
+
* For `complete: "redirect"` the orchestrator follows `redirect_uri`
|
|
53
|
+
* instead and does not run the exchange.
|
|
54
|
+
*/
|
|
55
|
+
accessor postSignInUrl: string;
|
|
56
|
+
/**
|
|
57
|
+
* Existing flow handle to resume rather than start a new flow. When set,
|
|
58
|
+
* the orchestrator hits `GET /flow/{id}` instead of `POST /flow` on
|
|
59
|
+
* mount, so a page reload after a network blip can re-render the same
|
|
60
|
+
* step without losing collected state.
|
|
61
|
+
*/
|
|
62
|
+
accessor resumeFlowId: string;
|
|
63
|
+
/**
|
|
64
|
+
* BCP 47 language tag (e.g. `"de"`, `"en-US"`). The widget resolves this
|
|
65
|
+
* to a built-in locale dictionary. Falls back to auto-detection from
|
|
66
|
+
* `document.documentElement.lang` or `navigator.language` when empty.
|
|
67
|
+
*/
|
|
68
|
+
accessor lang: string;
|
|
69
|
+
/**
|
|
70
|
+
* Custom locale dictionaries keyed by language code. When set, these take
|
|
71
|
+
* precedence over the built-in dictionaries for matching language codes.
|
|
72
|
+
*
|
|
73
|
+
* ```ts
|
|
74
|
+
* import { en } from "@zitadel/components";
|
|
75
|
+
* const locales = {
|
|
76
|
+
* en: { ...en, "identifier.title": "Welcome" },
|
|
77
|
+
* de: myGermanDict,
|
|
78
|
+
* };
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
accessor locales: Record<string, Locale> | undefined;
|
|
82
|
+
private accessor response;
|
|
83
|
+
private accessor branding;
|
|
84
|
+
private accessor loading;
|
|
85
|
+
private accessor startupError;
|
|
86
|
+
private accessor formValues;
|
|
87
|
+
private readonly themeController;
|
|
88
|
+
private engine;
|
|
89
|
+
private readonly sanitise;
|
|
90
|
+
/**
|
|
91
|
+
* Cached compiled tenant template, keyed by source string. Re-rendering on
|
|
92
|
+
* every `formValues` change otherwise re-parses the same template.
|
|
93
|
+
*/
|
|
94
|
+
private tenantTemplateCache;
|
|
95
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
96
|
+
/**
|
|
97
|
+
* Start the flow after the first render rather than in `connectedCallback`.
|
|
98
|
+
* Frameworks that wrap web components (e.g. `@lit/react` in the console)
|
|
99
|
+
* attach the element first and then assign object properties (`branding`,
|
|
100
|
+
* `locale`) via setters. `connectedCallback` runs synchronously on attach
|
|
101
|
+
* — before any setters from a wrapper's effects/refs — so reading those
|
|
102
|
+
* properties there sees stale defaults. `firstUpdated` runs after Lit's
|
|
103
|
+
* first render, by which time setters from the wrapping framework have
|
|
104
|
+
* fired.
|
|
105
|
+
*/
|
|
106
|
+
protected firstUpdated(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Resolves the effective locale dictionary. The built-in dictionary for the
|
|
109
|
+
* resolved language is used as the base; entries from the `locales` map (if
|
|
110
|
+
* set) are spread on top so partial overrides work without importing and
|
|
111
|
+
* spreading the full base dictionary.
|
|
112
|
+
*/
|
|
113
|
+
private resolveLocale;
|
|
114
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
115
|
+
updated(changed: PropertyValues<this>): void;
|
|
116
|
+
render(): import("lit").TemplateResult<1>;
|
|
117
|
+
/**
|
|
118
|
+
* Inject the attribution badge into the rendered template's
|
|
119
|
+
* `<zl-page-shell>` footer slot. The attribution must live INSIDE the
|
|
120
|
+
* page-shell so it sits within the 100vh viewport rhythm (matching the
|
|
121
|
+
* Figma sign-in frame where the pill sits 24px below the card, both
|
|
122
|
+
* centred on the page). It can't be a sibling of the page-shell because
|
|
123
|
+
* the page-shell already occupies the full viewport height.
|
|
124
|
+
*/
|
|
125
|
+
private injectAttribution;
|
|
126
|
+
/**
|
|
127
|
+
* "Secured with Zitadel" attribution chrome injected into every
|
|
128
|
+
* template's page-shell footer slot. Controlled by
|
|
129
|
+
* `branding.attribution.show_zitadel` — defaults to `true` for
|
|
130
|
+
* community / OSS deployments. Licensed tenants can suppress the badge
|
|
131
|
+
* entirely or swap it for a `custom_link` value.
|
|
132
|
+
*/
|
|
133
|
+
private renderAttributionHtml;
|
|
134
|
+
private startFlow;
|
|
135
|
+
private applyResponse;
|
|
136
|
+
private maybeCompleteFlow;
|
|
137
|
+
private renderStep;
|
|
138
|
+
/**
|
|
139
|
+
* Build a `FlowIdentity` from the orchestrator's captured form values so
|
|
140
|
+
* the signed-in template can greet the user by email without the API
|
|
141
|
+
* having to round-trip identity claims. Email comes from the
|
|
142
|
+
* identifier step; display name composes from `given_name` /
|
|
143
|
+
* `family_name` when the register step ran.
|
|
144
|
+
*/
|
|
145
|
+
private deriveIdentity;
|
|
146
|
+
private applyValuesToFields;
|
|
147
|
+
private handleAtomInput;
|
|
148
|
+
private handleAtomSubmit;
|
|
149
|
+
/** Secondary navigation rows (`data-action` on `.zl-card-nav__link`). */
|
|
150
|
+
private handleDelegatedAction;
|
|
151
|
+
private handleFormSubmit;
|
|
152
|
+
/**
|
|
153
|
+
* Handle a successful WebAuthn ceremony. Auto-submit with the proof
|
|
154
|
+
* as `challenge_response` so the flow advances without extra user
|
|
155
|
+
* interaction — the ceremony IS the factor verification (ADR 013).
|
|
156
|
+
*/
|
|
157
|
+
private handlePasskeyResult;
|
|
158
|
+
/**
|
|
159
|
+
* Handle a WebAuthn ceremony error. Re-render the current step with
|
|
160
|
+
* an error message so the user sees feedback and can retry or skip.
|
|
161
|
+
*
|
|
162
|
+
* Guard: if the step already carries the same error key, skip the update.
|
|
163
|
+
* Mutating `this.response` triggers `unsafeHTML` to replace the DOM tree,
|
|
164
|
+
* which reconnects a fresh `<zl-passkey>` that immediately re-starts the
|
|
165
|
+
* ceremony — creating an infinite loop. The guard breaks the cycle.
|
|
166
|
+
*
|
|
167
|
+
* We also strip the `challenge` from the step so the template does not
|
|
168
|
+
* render a new `<zl-passkey>` on re-render. Without this, the first
|
|
169
|
+
* cancel would trigger a second ceremony (the guard prevents a third).
|
|
170
|
+
*/
|
|
171
|
+
private handlePasskeyError;
|
|
172
|
+
private findPrimaryAction;
|
|
173
|
+
private moveFocusToFirstField;
|
|
174
|
+
private submit;
|
|
175
|
+
private handleTransportError;
|
|
176
|
+
}
|
|
177
|
+
declare global {
|
|
178
|
+
interface HTMLElementTagNameMap {
|
|
179
|
+
"zitadel-login": ZitadelLogin;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=zitadel-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zitadel-login.d.ts","sourceRoot":"","sources":["../../src/orchestrator/zitadel-login.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,K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;;;;;OASG;IACH,UAAmB,YAAY,IAAI,IAAI,CAItC;IAED;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAUZ,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAavD;IAEQ,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAQpD;IAEQ,MAAM,oCAoBd;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IASzB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;YAkBf,SAAS;IA+BvB,OAAO,CAAC,aAAa;YA0BP,iBAAiB;IAwC/B,OAAO,CAAC,UAAU;IAwDlB;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,eAAe,CAYrB;IAEF,OAAO,CAAC,gBAAgB,CAGtB;IAEF,yEAAyE;IACzE,OAAO,CAAC,qBAAqB,CAO3B;IAEF,OAAO,CAAC,gBAAgB,CAatB;IAEF;;;;OAIG;IACH,OAAO,CAAC,mBAAmB,CAUzB;IAEF;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,kBAAkB,CAaxB;IAEF,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,qBAAqB;YAUf,MAAM;IA4CpB,OAAO,CAAC,oBAAoB;CAa7B;AAWD,OAAO,CAAC,MAAM,CAAC,CAAC;IACd,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { LitElement, nothing } from "lit";
|
|
2
|
+
import { type ZitadelProject } from "@zitadel/api/config";
|
|
3
|
+
/**
|
|
4
|
+
* `<zitadel-logout>` — orchestrator-tier element that lets the signed-in user
|
|
5
|
+
* sign out without touching the flow API.
|
|
6
|
+
*
|
|
7
|
+
* Reads the user's display name + email from the `__nextgen_display` cookie
|
|
8
|
+
* (set by the auth backend on sign-in), renders an avatar trigger with a
|
|
9
|
+
* dropdown that exposes a "Sign out" action, and calls the typed
|
|
10
|
+
* `endSession` operation in `@zitadel/api`
|
|
11
|
+
* (`GET /auth/end-session`). The server clears the session cookie via
|
|
12
|
+
* `Set-Cookie: Max-Age=0`; on success the element fires `zitadel-signout`
|
|
13
|
+
* and optionally navigates to `post-sign-out-url`.
|
|
14
|
+
*
|
|
15
|
+
* ## Template-slot mode
|
|
16
|
+
*
|
|
17
|
+
* When the consumer projects a `<template>` child the element renders the
|
|
18
|
+
* template's clone into its light DOM with `{{name}}`, `{{email}}`, and
|
|
19
|
+
* `{{initial}}` substituted. Any element with `data-action="logout"` inside
|
|
20
|
+
* the cloned template triggers the sign-out flow. This mirrors the
|
|
21
|
+
* placeholder `<nextgen-logout>`'s contract so existing markup keeps working.
|
|
22
|
+
*
|
|
23
|
+
* Default styles consume the `--zl-*` design tokens so tenant branding
|
|
24
|
+
* applies automatically — there is no hardcoded brand colour, radius, or
|
|
25
|
+
* shadow.
|
|
26
|
+
*/
|
|
27
|
+
export declare class ZitadelLogout extends LitElement {
|
|
28
|
+
static styles: import("lit").CSSResult[];
|
|
29
|
+
/**
|
|
30
|
+
* SDK project handle returned by `configureZitadel()`. When set, takes
|
|
31
|
+
* precedence over the global singleton from `getZitadelConfig()`.
|
|
32
|
+
*/
|
|
33
|
+
accessor project: ZitadelProject | undefined;
|
|
34
|
+
/** URL to navigate to after a successful sign-out. */
|
|
35
|
+
accessor postSignOutUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* OIDC `client_id` to forward as a query parameter on the end-session
|
|
38
|
+
* request, mirroring the standard end-session contract. Optional —
|
|
39
|
+
* leaving this empty is fine when the backend can resolve the client
|
|
40
|
+
* from the session cookie alone.
|
|
41
|
+
*/
|
|
42
|
+
accessor clientId: string;
|
|
43
|
+
private accessor displayName;
|
|
44
|
+
private accessor displayEmail;
|
|
45
|
+
private accessor open;
|
|
46
|
+
private accessor loading;
|
|
47
|
+
private accessor errorMessage;
|
|
48
|
+
private templateMode;
|
|
49
|
+
connectedCallback(): void;
|
|
50
|
+
disconnectedCallback(): void;
|
|
51
|
+
updated(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Decodes the `__nextgen_display` cookie (base64-encoded JSON, set by the
|
|
54
|
+
* auth backend on sign-in) and populates `displayName` / `displayEmail`.
|
|
55
|
+
* A missing or malformed cookie is intentionally non-fatal — the dropdown
|
|
56
|
+
* still renders, just with empty values.
|
|
57
|
+
*/
|
|
58
|
+
private readDisplayCookie;
|
|
59
|
+
private get initial();
|
|
60
|
+
/**
|
|
61
|
+
* Clones a consumer-supplied `<template>` into the light DOM, fills the
|
|
62
|
+
* `{{name}}`, `{{email}}`, and `{{initial}}` tokens via a TreeWalker, and
|
|
63
|
+
* wires every element with `data-action="logout"` to trigger sign-out.
|
|
64
|
+
* Light-DOM mounting is deliberate so the consumer's existing CSS applies.
|
|
65
|
+
*/
|
|
66
|
+
private renderTemplate;
|
|
67
|
+
private readonly handleDocumentClick;
|
|
68
|
+
private readonly handleDocumentKeydown;
|
|
69
|
+
private toggleOpen;
|
|
70
|
+
private doLogout;
|
|
71
|
+
/**
|
|
72
|
+
* Returns the absolute URL the end-session request will hit. Useful for
|
|
73
|
+
* test assertions and for consumers that prefer to navigate the browser
|
|
74
|
+
* directly (instead of fetching) so the OIDC session-end redirect is
|
|
75
|
+
* driven by the user agent.
|
|
76
|
+
*/
|
|
77
|
+
getEndSessionUrl(): string;
|
|
78
|
+
private handleSignOutClick;
|
|
79
|
+
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
80
|
+
}
|
|
81
|
+
declare global {
|
|
82
|
+
interface HTMLElementTagNameMap {
|
|
83
|
+
"zitadel-logout": ZitadelLogout;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=zitadel-logout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zitadel-logout.d.ts","sourceRoot":"","sources":["../../src/orchestrator/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