@zitadel/config 0.1.0-alpha.17 → 0.1.0-alpha.19
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 +27 -0
- package/defaults/README-branding.md +96 -0
- package/defaults/README-flows.md +21 -4
- package/defaults/README-schemas.md +2 -2
- package/defaults/branding/centered/login.liquid +164 -0
- package/defaults/branding/hero/login.liquid +224 -0
- package/defaults/branding/minimal/login.liquid +154 -0
- package/defaults/branding/split/login.liquid +183 -0
- package/defaults/branding/split-right/login.liquid +183 -0
- package/defaults/default-human-user.json +2 -19
- package/defaults/default-login.json +21 -4
- package/defaults/presets/passkey-first/human-user.json +2 -19
- package/defaults/presets/passkey-first/login.json +31 -4
- package/dist/branding-url.d.mts +14 -0
- package/dist/branding-url.d.mts.map +1 -0
- package/dist/branding-url.mjs +23 -0
- package/dist/branding-url.mjs.map +1 -0
- package/dist/defaults-Bh4_xVbh.d.mts +84 -0
- package/dist/defaults-Bh4_xVbh.d.mts.map +1 -0
- package/dist/defaults-eiGHyI5Y.mjs +569 -0
- package/dist/defaults-eiGHyI5Y.mjs.map +1 -0
- package/dist/defaults.d.mts +2 -2
- package/dist/defaults.mjs +2 -2
- package/dist/index.d.mts +6 -4
- package/dist/index.mjs +6 -4
- package/dist/{meta-schemas-8nlyVL7g.mjs → meta-schemas-CSc18JqO.mjs} +92 -31
- package/dist/meta-schemas-CSc18JqO.mjs.map +1 -0
- package/dist/meta-schemas.d.mts +6 -1
- package/dist/meta-schemas.d.mts.map +1 -1
- package/dist/meta-schemas.mjs +2 -2
- package/dist/normalize.d.mts +11 -9
- package/dist/normalize.d.mts.map +1 -1
- package/dist/normalize.mjs +24 -17
- package/dist/normalize.mjs.map +1 -1
- package/dist/schemas.d.mts +14 -1
- package/dist/schemas.d.mts.map +1 -1
- package/dist/schemas.mjs +62 -2
- package/dist/schemas.mjs.map +1 -1
- package/dist/template.d.mts +76 -0
- package/dist/template.d.mts.map +1 -0
- package/dist/template.mjs +145 -0
- package/dist/template.mjs.map +1 -0
- package/dist/validate.mjs +70 -11
- package/dist/validate.mjs.map +1 -1
- package/meta-schemas/auth-method.json +2 -7
- package/meta-schemas/branding.json +44 -0
- package/meta-schemas/flow-definition.json +20 -1
- package/meta-schemas/property-name.json +7 -0
- package/meta-schemas/user-property.json +8 -24
- package/meta-schemas/user-schema.json +4 -1
- package/package.json +17 -4
- package/dist/defaults-BQej3KIY.mjs +0 -388
- package/dist/defaults-BQej3KIY.mjs.map +0 -1
- package/dist/defaults-CSjBjBkQ.d.mts +0 -41
- package/dist/defaults-CSjBjBkQ.d.mts.map +0 -1
- package/dist/meta-schemas-8nlyVL7g.mjs.map +0 -1
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
"kind": "navigate",
|
|
24
24
|
"primary": false,
|
|
25
25
|
"text_key": "passkey-first.action.email_fallback"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "register",
|
|
29
|
+
"kind": "navigate",
|
|
30
|
+
"primary": false,
|
|
31
|
+
"text_key": "identifier.action.register.link"
|
|
26
32
|
}
|
|
27
33
|
],
|
|
28
34
|
"transitions": {
|
|
@@ -34,6 +40,10 @@
|
|
|
34
40
|
},
|
|
35
41
|
"user_not_found": {
|
|
36
42
|
"target": "register"
|
|
43
|
+
},
|
|
44
|
+
"register": {
|
|
45
|
+
"target": "register",
|
|
46
|
+
"purpose": "register"
|
|
37
47
|
}
|
|
38
48
|
}
|
|
39
49
|
},
|
|
@@ -54,6 +64,12 @@
|
|
|
54
64
|
"kind": "passkey",
|
|
55
65
|
"primary": false,
|
|
56
66
|
"text_key": "identifier.action.passkey"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "register",
|
|
70
|
+
"kind": "navigate",
|
|
71
|
+
"primary": false,
|
|
72
|
+
"text_key": "identifier.action.register.link"
|
|
57
73
|
}
|
|
58
74
|
],
|
|
59
75
|
"transitions": {
|
|
@@ -65,6 +81,10 @@
|
|
|
65
81
|
},
|
|
66
82
|
"user_not_found": {
|
|
67
83
|
"target": "register"
|
|
84
|
+
},
|
|
85
|
+
"register": {
|
|
86
|
+
"target": "register",
|
|
87
|
+
"purpose": "register"
|
|
68
88
|
}
|
|
69
89
|
}
|
|
70
90
|
},
|
|
@@ -99,10 +119,7 @@
|
|
|
99
119
|
{
|
|
100
120
|
"name": "register",
|
|
101
121
|
"fields": [
|
|
102
|
-
"email"
|
|
103
|
-
"givenName",
|
|
104
|
-
"familyName",
|
|
105
|
-
"dateOfBirth"
|
|
122
|
+
"email"
|
|
106
123
|
],
|
|
107
124
|
"actions": [
|
|
108
125
|
{
|
|
@@ -116,6 +133,12 @@
|
|
|
116
133
|
"kind": "submit",
|
|
117
134
|
"primary": false,
|
|
118
135
|
"text_key": "register.action.password"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "sign_in",
|
|
139
|
+
"kind": "navigate",
|
|
140
|
+
"primary": false,
|
|
141
|
+
"text_key": "register.action.sign_in.link"
|
|
119
142
|
}
|
|
120
143
|
],
|
|
121
144
|
"transitions": {
|
|
@@ -127,6 +150,10 @@
|
|
|
127
150
|
},
|
|
128
151
|
"user_already_exists": {
|
|
129
152
|
"target": "password"
|
|
153
|
+
},
|
|
154
|
+
"sign_in": {
|
|
155
|
+
"target": "passkey-first",
|
|
156
|
+
"purpose": "login"
|
|
130
157
|
}
|
|
131
158
|
}
|
|
132
159
|
},
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/branding-url.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Reports whether value is an absolute HTTP URL using one of the canonical
|
|
4
|
+
* loopback spellings shared by the config and component gates.
|
|
5
|
+
*
|
|
6
|
+
* The raw-pattern check deliberately runs before WHATWG URL normalisation so
|
|
7
|
+
* shorthand, integer, hexadecimal, leading-zero, and userinfo forms cannot
|
|
8
|
+
* become a loopback host in one JavaScript layer while the Go save gate rejects
|
|
9
|
+
* them.
|
|
10
|
+
*/
|
|
11
|
+
declare function isCanonicalLoopbackHttpUrl(value: string): boolean;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { isCanonicalLoopbackHttpUrl };
|
|
14
|
+
//# sourceMappingURL=branding-url.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branding-url.d.mts","names":[],"sources":["../src/branding-url.ts"],"mappings":";;AAYA;;;;;;;;iBAAgB,0BAAA,CAA2B,KAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/branding-url.ts
|
|
2
|
+
const CANONICAL_LOOPBACK_HTTP_URL = /^http:\/\/(?:localhost|127\.(?:0|[1-9][0-9]{0,2})\.(?:0|[1-9][0-9]{0,2})\.(?:0|[1-9][0-9]{0,2})|\[::1\])(?::[0-9]+)?(?:[/?#]|$)/i;
|
|
3
|
+
/**
|
|
4
|
+
* Reports whether value is an absolute HTTP URL using one of the canonical
|
|
5
|
+
* loopback spellings shared by the config and component gates.
|
|
6
|
+
*
|
|
7
|
+
* The raw-pattern check deliberately runs before WHATWG URL normalisation so
|
|
8
|
+
* shorthand, integer, hexadecimal, leading-zero, and userinfo forms cannot
|
|
9
|
+
* become a loopback host in one JavaScript layer while the Go save gate rejects
|
|
10
|
+
* them.
|
|
11
|
+
*/
|
|
12
|
+
function isCanonicalLoopbackHttpUrl(value) {
|
|
13
|
+
if (!CANONICAL_LOOPBACK_HTTP_URL.test(value)) return false;
|
|
14
|
+
try {
|
|
15
|
+
return new URL(value).protocol === "http:";
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { isCanonicalLoopbackHttpUrl };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=branding-url.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branding-url.mjs","names":[],"sources":["../src/branding-url.ts"],"sourcesContent":["const CANONICAL_LOOPBACK_HTTP_URL =\n /^http:\\/\\/(?:localhost|127\\.(?:0|[1-9][0-9]{0,2})\\.(?:0|[1-9][0-9]{0,2})\\.(?:0|[1-9][0-9]{0,2})|\\[::1\\])(?::[0-9]+)?(?:[/?#]|$)/i;\n\n/**\n * Reports whether value is an absolute HTTP URL using one of the canonical\n * loopback spellings shared by the config and component gates.\n *\n * The raw-pattern check deliberately runs before WHATWG URL normalisation so\n * shorthand, integer, hexadecimal, leading-zero, and userinfo forms cannot\n * become a loopback host in one JavaScript layer while the Go save gate rejects\n * them.\n */\nexport function isCanonicalLoopbackHttpUrl(value: string): boolean {\n if (!CANONICAL_LOOPBACK_HTTP_URL.test(value)) return false;\n try {\n return new URL(value).protocol === \"http:\";\n } catch {\n return false;\n }\n}\n"],"mappings":";AAAA,MAAM,8BACJ;;;;;;;;;;AAWF,SAAgB,2BAA2B,OAAwB;AACjE,KAAI,CAAC,4BAA4B,KAAK,MAAM,CAAE,QAAO;AACrD,KAAI;AACF,SAAO,IAAI,IAAI,MAAM,CAAC,aAAa;SAC7B;AACN,SAAO"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { CreateFlowDefinitionBodyFlowDefinition, CreateSchemaBody } from "@zitadel/api/generated/model";
|
|
2
|
+
|
|
3
|
+
//#region src/readmes.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* README content the CLI copies to `.zitadel/schemas/README.md` during setup.
|
|
6
|
+
* Source of truth is `packages/config/defaults/README-schemas.md`; the Go
|
|
7
|
+
* server-side embed reads the same file (see `defaults.go`).
|
|
8
|
+
*/
|
|
9
|
+
declare function schemasReadmeContent(): string;
|
|
10
|
+
/**
|
|
11
|
+
* README content the CLI copies to `.zitadel/flows/README.md` during setup.
|
|
12
|
+
* Source of truth is `packages/config/defaults/README-flows.md`.
|
|
13
|
+
*/
|
|
14
|
+
declare function flowsReadmeContent(): string;
|
|
15
|
+
/**
|
|
16
|
+
* README content the CLI copies to `.zitadel/branding/README.md` when a
|
|
17
|
+
* branding design is ejected. Source of truth is
|
|
18
|
+
* `packages/config/defaults/README-branding.md`.
|
|
19
|
+
*/
|
|
20
|
+
declare function brandingReadmeContent(): string;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/defaults.d.ts
|
|
23
|
+
declare const DEFAULT_BUILTIN_SCHEMA_BASE = "https://nextgen.com/api/schemas";
|
|
24
|
+
declare const DEFAULT_FLOW_SCHEMA_URI = "https://nextgen.com/flow-definition.json";
|
|
25
|
+
declare const DEFAULT_SCHEMA_CONFIG_PATH = ".zitadel/schemas/default-human-user.json";
|
|
26
|
+
declare const DEFAULT_FLOW_CONFIG_PATH = ".zitadel/flows/default-login.json";
|
|
27
|
+
declare const DEFAULT_BRANDING_CONFIG_PATH = ".zitadel/branding/branding.json";
|
|
28
|
+
declare const DEFAULT_BRANDING_TEMPLATE_PATH = ".zitadel/branding/login.liquid";
|
|
29
|
+
/**
|
|
30
|
+
* Named schema+flow bundles `zitadel setup` can scaffold (#448: the prompt
|
|
31
|
+
* fires before any `.zitadel/` file is written; each preset maps to a
|
|
32
|
+
* pre-defined bundle the CLI copies on first setup). `password-first` is
|
|
33
|
+
* today's default; `passkey-first` puts a passkey ceremony on the login
|
|
34
|
+
* entry step with an email→password fallback path.
|
|
35
|
+
*/
|
|
36
|
+
declare const SETUP_PRESETS: readonly ["password-first", "passkey-first"];
|
|
37
|
+
type SetupPreset = (typeof SETUP_PRESETS)[number];
|
|
38
|
+
declare const DEFAULT_SETUP_PRESET: SetupPreset;
|
|
39
|
+
/**
|
|
40
|
+
* Login-design starting points `zitadel branding eject --design <name>` (and
|
|
41
|
+
* `zitadel setup --design <name>`) scaffold into `.zitadel/branding/`. A
|
|
42
|
+
* design is a full Liquid template plus the descriptor `layout` it degrades
|
|
43
|
+
* to — the wire `layout` enum stays `centered | split`, richer designs are
|
|
44
|
+
* delivered as templates (ADR 040).
|
|
45
|
+
*/
|
|
46
|
+
declare const BRANDING_DESIGNS: readonly ["centered", "split", "split-right", "hero", "minimal"];
|
|
47
|
+
type BrandingDesign = (typeof BRANDING_DESIGNS)[number];
|
|
48
|
+
declare const DEFAULT_BRANDING_DESIGN: BrandingDesign;
|
|
49
|
+
type DefaultBrandingConfig = {
|
|
50
|
+
/** The `.zitadel/branding/branding.json` descriptor body (sans `$schema`). */branding: {
|
|
51
|
+
layout: "centered" | "split";
|
|
52
|
+
liquid_template_file: string;
|
|
53
|
+
}; /** The `.zitadel/branding/login.liquid` template content. */
|
|
54
|
+
template: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Renders the scaffold files for a branding design. The `centered` template
|
|
58
|
+
* is a drift-tested copy of the bundled default in `@zitadel/components`;
|
|
59
|
+
* the other designs are authored variants of it.
|
|
60
|
+
*/
|
|
61
|
+
declare function getDefaultBrandingConfig(design?: string): DefaultBrandingConfig;
|
|
62
|
+
/**
|
|
63
|
+
* The second setup axis (#448): *who* signs in, orthogonal to the sign-in
|
|
64
|
+
* preset (*how* they sign in). The sign-in preset owns the flow shape and
|
|
65
|
+
* auth methods; the use case owns which profile fields the schema collects.
|
|
66
|
+
* Composing the two keeps us at one field catalog + one flow-per-preset
|
|
67
|
+
* instead of a bundle per (use case × preset) pair. `minimal` is the
|
|
68
|
+
* default and never blocks non-interactive runs.
|
|
69
|
+
*/
|
|
70
|
+
declare const SETUP_USE_CASES: readonly ["minimal", "consumer", "business"];
|
|
71
|
+
type SetupUseCase = (typeof SETUP_USE_CASES)[number];
|
|
72
|
+
declare const DEFAULT_SETUP_USE_CASE: SetupUseCase;
|
|
73
|
+
type DefaultConfigRenderOptions = {
|
|
74
|
+
builtinSchemaBase?: string;
|
|
75
|
+
userSchemaUrl?: string; /** Which flow/auth bundle to render; defaults to {@link DEFAULT_SETUP_PRESET}. */
|
|
76
|
+
preset?: string; /** Which field set to collect; defaults to {@link DEFAULT_SETUP_USE_CASE}. */
|
|
77
|
+
useCase?: string;
|
|
78
|
+
};
|
|
79
|
+
declare function defaultHumanUserSchemaUrl(builtinSchemaBase?: string): string;
|
|
80
|
+
declare function getDefaultHumanUserSchema(options?: DefaultConfigRenderOptions): CreateSchemaBody;
|
|
81
|
+
declare function getDefaultLoginFlow(options?: DefaultConfigRenderOptions): CreateFlowDefinitionBodyFlowDefinition;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { flowsReadmeContent as C, brandingReadmeContent as S, SetupUseCase as _, DEFAULT_BRANDING_TEMPLATE_PATH as a, getDefaultHumanUserSchema as b, DEFAULT_FLOW_SCHEMA_URI as c, DEFAULT_SETUP_USE_CASE as d, DefaultBrandingConfig as f, SetupPreset as g, SETUP_USE_CASES as h, DEFAULT_BRANDING_DESIGN as i, DEFAULT_SCHEMA_CONFIG_PATH as l, SETUP_PRESETS as m, BrandingDesign as n, DEFAULT_BUILTIN_SCHEMA_BASE as o, DefaultConfigRenderOptions as p, DEFAULT_BRANDING_CONFIG_PATH as r, DEFAULT_FLOW_CONFIG_PATH as s, BRANDING_DESIGNS as t, DEFAULT_SETUP_PRESET as u, defaultHumanUserSchemaUrl as v, schemasReadmeContent as w, getDefaultLoginFlow as x, getDefaultBrandingConfig as y };
|
|
84
|
+
//# sourceMappingURL=defaults-Bh4_xVbh.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults-Bh4_xVbh.d.mts","names":[],"sources":["../src/readmes.ts","../src/defaults.ts"],"mappings":";;;;;;AAQA;;iBAAgB,oBAAA,CAAA;;;AAQhB;;iBAAgB,kBAAA,CAAA;;;AAShB;;;iBAAgB,qBAAA,CAAA;;;cCFH,2BAAA;AAAA,cACA,uBAAA;AAAA,cACA,0BAAA;AAAA,cACA,wBAAA;AAAA,cACA,4BAAA;AAAA,cACA,8BAAA;ADZb;;;;;AASA;;AATA,cCqBa,aAAA;AAAA,KAED,WAAA,WAAsB,aAAA;AAAA,cAErB,oBAAA,EAAsB,WAAA;;;;AAlBnC;;;;cAkDa,gBAAA;AAAA,KAED,cAAA,WAAyB,gBAAA;AAAA,cAExB,uBAAA,EAAyB,cAAA;AAAA,KAW1B,qBAAA;EAhEwB,8EAkElC,QAAA;IACE,MAAA;IACA,oBAAA;EAAA,GAnEmC;EAsErC,QAAA;AAAA;;;;;AApEF;iBA4EgB,wBAAA,CACd,MAAA,YACC,qBAAA;;;;AA7EH;;;;;cAgHa,eAAA;AAAA,KAED,YAAA,WAAuB,eAAA;AAAA,cAEtB,sBAAA,EAAwB,YAAA;AAAA,KA0GzB,0BAAA;EACV,iBAAA;EACA,aAAA,WArNqB;EAuNrB,MAAA,WAvNgC;EAyNhC,OAAA;AAAA;AAAA,iBAGc,yBAAA,CACd,iBAAA;AAAA,iBAKc,yBAAA,CACd,OAAA,GAAS,0BAAA,GACR,gBAAA;AAAA,iBAca,mBAAA,CACd,OAAA,GAAS,0BAAA,GACR,sCAAA"}
|