@zitadel/config 0.1.0-alpha.14 → 0.1.0-alpha.16
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/defaults/README-flows.md +66 -9
- package/defaults/README-schemas.md +139 -30
- package/defaults/default-login.json +1 -0
- package/defaults/presets/passkey-first/human-user.json +46 -0
- package/defaults/presets/passkey-first/login.json +161 -0
- package/dist/{defaults-B2iIPSSl.mjs → defaults-BQej3KIY.mjs} +191 -4
- package/dist/defaults-BQej3KIY.mjs.map +1 -0
- package/dist/{defaults-DzfOT2_7.d.mts → defaults-CSjBjBkQ.d.mts} +14 -3
- package/dist/defaults-CSjBjBkQ.d.mts.map +1 -0
- package/dist/defaults.d.mts +2 -2
- package/dist/defaults.mjs +2 -2
- package/dist/index.d.mts +5 -2
- package/dist/index.mjs +5 -2
- package/dist/meta-schemas-8nlyVL7g.mjs +456 -0
- package/dist/meta-schemas-8nlyVL7g.mjs.map +1 -0
- package/dist/meta-schemas.d.mts +21 -0
- package/dist/meta-schemas.d.mts.map +1 -0
- package/dist/meta-schemas.mjs +2 -0
- package/dist/normalize.d.mts +45 -0
- package/dist/normalize.d.mts.map +1 -0
- package/dist/normalize.mjs +88 -0
- package/dist/normalize.mjs.map +1 -0
- package/dist/validate.d.mts +94 -0
- package/dist/validate.d.mts.map +1 -0
- package/dist/validate.mjs +371 -0
- package/dist/validate.mjs.map +1 -0
- package/meta-schemas/auth-method.json +20 -0
- package/meta-schemas/auth-methods.json +24 -0
- package/meta-schemas/flow-definition.json +344 -0
- package/meta-schemas/user-property.json +76 -0
- package/meta-schemas/user-schema.json +50 -0
- package/package.json +20 -2
- package/dist/defaults-B2iIPSSl.mjs.map +0 -1
- package/dist/defaults-DzfOT2_7.d.mts.map +0 -1
|
@@ -48,6 +48,7 @@ var default_human_user_default = {
|
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region defaults/default-login.json
|
|
50
50
|
var default_login_default = {
|
|
51
|
+
$schema: "../meta/flow-definition.json",
|
|
51
52
|
name: "default-login",
|
|
52
53
|
status: "active",
|
|
53
54
|
user_schema: "${USER_SCHEMA_URL}",
|
|
@@ -142,6 +143,169 @@ var default_login_default = {
|
|
|
142
143
|
]
|
|
143
144
|
};
|
|
144
145
|
//#endregion
|
|
146
|
+
//#region defaults/presets/passkey-first/human-user.json
|
|
147
|
+
var human_user_default = {
|
|
148
|
+
title: "DefaultHumanUserSchema",
|
|
149
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
150
|
+
metaSchema: "${SERVER_URL}/user-schema.json",
|
|
151
|
+
$id: "${USER_SCHEMA_URL}",
|
|
152
|
+
objectType: "human-user",
|
|
153
|
+
kind: "user-schema",
|
|
154
|
+
type: "object",
|
|
155
|
+
description: "The default editable schema for human users (passkey-first sign-in).",
|
|
156
|
+
"x-auth-methods": {
|
|
157
|
+
"passkey": {
|
|
158
|
+
"enabled": true,
|
|
159
|
+
"position": 1
|
|
160
|
+
},
|
|
161
|
+
"password": {
|
|
162
|
+
"enabled": true,
|
|
163
|
+
"position": 2
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
required: ["email"],
|
|
167
|
+
properties: {
|
|
168
|
+
"email": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"format": "email",
|
|
171
|
+
"x-unique": "project",
|
|
172
|
+
"description": "The user's email address."
|
|
173
|
+
},
|
|
174
|
+
"givenName": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"maxLength": 50,
|
|
177
|
+
"description": "The user's given (first) name."
|
|
178
|
+
},
|
|
179
|
+
"familyName": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"maxLength": 50,
|
|
182
|
+
"description": "The user's family (last) name."
|
|
183
|
+
},
|
|
184
|
+
"dateOfBirth": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"format": "date",
|
|
187
|
+
"description": "The user's date of birth (ISO 8601, YYYY-MM-DD)."
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region defaults/presets/passkey-first/login.json
|
|
193
|
+
var login_default = {
|
|
194
|
+
$schema: "../meta/flow-definition.json",
|
|
195
|
+
name: "default-login",
|
|
196
|
+
status: "active",
|
|
197
|
+
user_schema: "${USER_SCHEMA_URL}",
|
|
198
|
+
purposes: {
|
|
199
|
+
"login": "passkey-first",
|
|
200
|
+
"register": "register"
|
|
201
|
+
},
|
|
202
|
+
steps: [
|
|
203
|
+
{
|
|
204
|
+
"name": "passkey-first",
|
|
205
|
+
"fields": [],
|
|
206
|
+
"actions": [{
|
|
207
|
+
"name": "passkey",
|
|
208
|
+
"kind": "passkey",
|
|
209
|
+
"primary": true,
|
|
210
|
+
"text_key": "passkey-first.action.passkey"
|
|
211
|
+
}, {
|
|
212
|
+
"name": "email_fallback",
|
|
213
|
+
"kind": "navigate",
|
|
214
|
+
"primary": false,
|
|
215
|
+
"text_key": "passkey-first.action.email_fallback"
|
|
216
|
+
}],
|
|
217
|
+
"transitions": {
|
|
218
|
+
"passkey": { "target": "done" },
|
|
219
|
+
"email_fallback": { "target": "identifier" },
|
|
220
|
+
"user_not_found": { "target": "register" }
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "identifier",
|
|
225
|
+
"fields": ["email"],
|
|
226
|
+
"actions": [{
|
|
227
|
+
"name": "submit",
|
|
228
|
+
"kind": "submit",
|
|
229
|
+
"primary": true,
|
|
230
|
+
"text_key": "identifier.action.continue"
|
|
231
|
+
}, {
|
|
232
|
+
"name": "passkey",
|
|
233
|
+
"kind": "passkey",
|
|
234
|
+
"primary": false,
|
|
235
|
+
"text_key": "identifier.action.passkey"
|
|
236
|
+
}],
|
|
237
|
+
"transitions": {
|
|
238
|
+
"submit": { "target": "password" },
|
|
239
|
+
"passkey": { "target": "done" },
|
|
240
|
+
"user_not_found": { "target": "register" }
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "password",
|
|
245
|
+
"fields": ["x-auth-methods#password"],
|
|
246
|
+
"actions": [{
|
|
247
|
+
"name": "submit",
|
|
248
|
+
"kind": "submit",
|
|
249
|
+
"primary": true,
|
|
250
|
+
"text_key": "password.action.signin"
|
|
251
|
+
}, {
|
|
252
|
+
"name": "passkey",
|
|
253
|
+
"kind": "passkey",
|
|
254
|
+
"primary": false,
|
|
255
|
+
"text_key": "password.action.passkey"
|
|
256
|
+
}],
|
|
257
|
+
"transitions": {
|
|
258
|
+
"submit": { "target": "done" },
|
|
259
|
+
"passkey": { "target": "done" }
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "register",
|
|
264
|
+
"fields": [
|
|
265
|
+
"email",
|
|
266
|
+
"givenName",
|
|
267
|
+
"familyName",
|
|
268
|
+
"dateOfBirth"
|
|
269
|
+
],
|
|
270
|
+
"actions": [{
|
|
271
|
+
"name": "passkey_register",
|
|
272
|
+
"kind": "passkey_register",
|
|
273
|
+
"primary": true,
|
|
274
|
+
"text_key": "register.action.passkey"
|
|
275
|
+
}, {
|
|
276
|
+
"name": "submit",
|
|
277
|
+
"kind": "submit",
|
|
278
|
+
"primary": false,
|
|
279
|
+
"text_key": "register.action.password"
|
|
280
|
+
}],
|
|
281
|
+
"transitions": {
|
|
282
|
+
"passkey_register": { "target": "done" },
|
|
283
|
+
"submit": { "target": "register-password" },
|
|
284
|
+
"user_already_exists": { "target": "password" }
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "register-password",
|
|
289
|
+
"fields": ["x-auth-methods#password"],
|
|
290
|
+
"actions": [{
|
|
291
|
+
"name": "submit",
|
|
292
|
+
"kind": "submit",
|
|
293
|
+
"primary": true,
|
|
294
|
+
"text_key": "register-password.action.submit"
|
|
295
|
+
}],
|
|
296
|
+
"on_success": "create_user",
|
|
297
|
+
"transitions": {
|
|
298
|
+
"submit": { "target": "done" },
|
|
299
|
+
"user_already_exists": { "target": "password" }
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "done",
|
|
304
|
+
"complete": "show"
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
};
|
|
308
|
+
//#endregion
|
|
145
309
|
//#region src/readmes.ts
|
|
146
310
|
/**
|
|
147
311
|
* README content the CLI copies to `.zitadel/schemas/README.md` during setup.
|
|
@@ -167,19 +331,42 @@ const DEFAULT_BUILTIN_SCHEMA_BASE = "https://nextgen.com/api/schemas";
|
|
|
167
331
|
const DEFAULT_FLOW_SCHEMA_URI = "https://nextgen.com/flow-definition.json";
|
|
168
332
|
const DEFAULT_SCHEMA_CONFIG_PATH = ".zitadel/schemas/default-human-user.json";
|
|
169
333
|
const DEFAULT_FLOW_CONFIG_PATH = ".zitadel/flows/default-login.json";
|
|
334
|
+
/**
|
|
335
|
+
* Named schema+flow bundles `zitadel setup` can scaffold (#448: the prompt
|
|
336
|
+
* fires before any `.zitadel/` file is written; each preset maps to a
|
|
337
|
+
* pre-defined bundle the CLI copies on first setup). `password-first` is
|
|
338
|
+
* today's default; `passkey-first` puts a passkey ceremony on the login
|
|
339
|
+
* entry step with an email→password fallback path.
|
|
340
|
+
*/
|
|
341
|
+
const SETUP_PRESETS = ["password-first", "passkey-first"];
|
|
342
|
+
const DEFAULT_SETUP_PRESET = "password-first";
|
|
343
|
+
const PRESET_TEMPLATES = {
|
|
344
|
+
"password-first": {
|
|
345
|
+
schema: default_human_user_default,
|
|
346
|
+
flow: default_login_default
|
|
347
|
+
},
|
|
348
|
+
"passkey-first": {
|
|
349
|
+
schema: human_user_default,
|
|
350
|
+
flow: login_default
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
function presetTemplates(preset) {
|
|
354
|
+
if (!Object.hasOwn(PRESET_TEMPLATES, preset)) throw new Error(`unknown setup preset ${JSON.stringify(preset)} (known presets: ${SETUP_PRESETS.join(", ")})`);
|
|
355
|
+
return PRESET_TEMPLATES[preset];
|
|
356
|
+
}
|
|
170
357
|
function defaultHumanUserSchemaUrl(builtinSchemaBase = DEFAULT_BUILTIN_SCHEMA_BASE) {
|
|
171
358
|
return `${trimTrailingSlash(builtinSchemaBase)}/default-human-user.json`;
|
|
172
359
|
}
|
|
173
360
|
function getDefaultHumanUserSchema(options = {}) {
|
|
174
361
|
const builtinSchemaBase = trimTrailingSlash(options.builtinSchemaBase ?? "https://nextgen.com/api/schemas");
|
|
175
|
-
return renderTemplate(
|
|
362
|
+
return renderTemplate(presetTemplates(options.preset ?? "password-first").schema, {
|
|
176
363
|
SERVER_URL: builtinSchemaBase,
|
|
177
364
|
USER_SCHEMA_URL: options.userSchemaUrl ?? defaultHumanUserSchemaUrl(builtinSchemaBase)
|
|
178
365
|
});
|
|
179
366
|
}
|
|
180
367
|
function getDefaultLoginFlow(options = {}) {
|
|
181
368
|
const builtinSchemaBase = trimTrailingSlash(options.builtinSchemaBase ?? "https://nextgen.com/api/schemas");
|
|
182
|
-
return renderTemplate(
|
|
369
|
+
return renderTemplate(presetTemplates(options.preset ?? "password-first").flow, {
|
|
183
370
|
SERVER_URL: builtinSchemaBase,
|
|
184
371
|
USER_SCHEMA_URL: options.userSchemaUrl ?? defaultHumanUserSchemaUrl(builtinSchemaBase)
|
|
185
372
|
});
|
|
@@ -196,6 +383,6 @@ function trimTrailingSlash(value) {
|
|
|
196
383
|
return value.replace(/\/+$/u, "");
|
|
197
384
|
}
|
|
198
385
|
//#endregion
|
|
199
|
-
export {
|
|
386
|
+
export { DEFAULT_SETUP_PRESET as a, getDefaultHumanUserSchema as c, schemasReadmeContent as d, DEFAULT_SCHEMA_CONFIG_PATH as i, getDefaultLoginFlow as l, DEFAULT_FLOW_CONFIG_PATH as n, SETUP_PRESETS as o, DEFAULT_FLOW_SCHEMA_URI as r, defaultHumanUserSchemaUrl as s, DEFAULT_BUILTIN_SCHEMA_BASE as t, flowsReadmeContent as u };
|
|
200
387
|
|
|
201
|
-
//# sourceMappingURL=defaults-
|
|
388
|
+
//# sourceMappingURL=defaults-BQej3KIY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults-BQej3KIY.mjs","names":["defaultHumanUserSchemaTemplate","defaultLoginFlowTemplate","passkeyFirstHumanUserSchemaTemplate","passkeyFirstLoginFlowTemplate"],"sources":["../defaults/default-human-user.json","../defaults/default-login.json","../defaults/presets/passkey-first/human-user.json","../defaults/presets/passkey-first/login.json","../src/readmes.ts","../src/defaults.ts"],"sourcesContent":["","","","","import { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * README content the CLI copies to `.zitadel/schemas/README.md` during setup.\n * Source of truth is `packages/config/defaults/README-schemas.md`; the Go\n * server-side embed reads the same file (see `defaults.go`).\n */\nexport function schemasReadmeContent(): string {\n return readFileSync(readmeUrl(\"README-schemas.md\"), \"utf8\");\n}\n\n/**\n * README content the CLI copies to `.zitadel/flows/README.md` during setup.\n * Source of truth is `packages/config/defaults/README-flows.md`.\n */\nexport function flowsReadmeContent(): string {\n return readFileSync(readmeUrl(\"README-flows.md\"), \"utf8\");\n}\n\nfunction readmeUrl(filename: string): string {\n return fileURLToPath(new URL(`../defaults/${filename}`, import.meta.url));\n}\n","import type {\n CreateFlowDefinitionBodyFlowDefinition,\n CreateSchemaBody,\n} from \"@zitadel/api/generated/model\";\n\nimport defaultHumanUserSchemaTemplate from \"../defaults/default-human-user.json\" with {\n type: \"json\",\n};\nimport defaultLoginFlowTemplate from \"../defaults/default-login.json\" with {\n type: \"json\",\n};\nimport passkeyFirstHumanUserSchemaTemplate from \"../defaults/presets/passkey-first/human-user.json\" with {\n type: \"json\",\n};\nimport passkeyFirstLoginFlowTemplate from \"../defaults/presets/passkey-first/login.json\" with {\n type: \"json\",\n};\n\nexport { flowsReadmeContent, schemasReadmeContent } from \"./readmes.js\";\n\nexport const DEFAULT_BUILTIN_SCHEMA_BASE = \"https://nextgen.com/api/schemas\";\nexport const DEFAULT_FLOW_SCHEMA_URI = \"https://nextgen.com/flow-definition.json\";\nexport const DEFAULT_SCHEMA_CONFIG_PATH = \".zitadel/schemas/default-human-user.json\";\nexport const DEFAULT_FLOW_CONFIG_PATH = \".zitadel/flows/default-login.json\";\n\n/**\n * Named schema+flow bundles `zitadel setup` can scaffold (#448: the prompt\n * fires before any `.zitadel/` file is written; each preset maps to a\n * pre-defined bundle the CLI copies on first setup). `password-first` is\n * today's default; `passkey-first` puts a passkey ceremony on the login\n * entry step with an email→password fallback path.\n */\nexport const SETUP_PRESETS = [\"password-first\", \"passkey-first\"] as const;\n\nexport type SetupPreset = (typeof SETUP_PRESETS)[number];\n\nexport const DEFAULT_SETUP_PRESET: SetupPreset = \"password-first\";\n\nconst PRESET_TEMPLATES: Record<SetupPreset, { schema: unknown; flow: unknown }> = {\n \"password-first\": {\n schema: defaultHumanUserSchemaTemplate,\n flow: defaultLoginFlowTemplate,\n },\n \"passkey-first\": {\n schema: passkeyFirstHumanUserSchemaTemplate,\n flow: passkeyFirstLoginFlowTemplate,\n },\n};\n\nfunction presetTemplates(preset: string): { schema: unknown; flow: unknown } {\n // Own-property check: indexing a plain object with an arbitrary string\n // would let \"__proto__\"/\"constructor\" resolve via the prototype chain\n // and bypass the unknown-preset error.\n if (!Object.hasOwn(PRESET_TEMPLATES, preset)) {\n throw new Error(\n `unknown setup preset ${JSON.stringify(preset)} (known presets: ${SETUP_PRESETS.join(\", \")})`,\n );\n }\n return PRESET_TEMPLATES[preset as SetupPreset];\n}\n\nexport type DefaultConfigRenderOptions = {\n builtinSchemaBase?: string;\n userSchemaUrl?: string;\n /** Which bundle to render; defaults to {@link DEFAULT_SETUP_PRESET}. */\n preset?: string;\n};\n\nexport function defaultHumanUserSchemaUrl(\n builtinSchemaBase = DEFAULT_BUILTIN_SCHEMA_BASE,\n): string {\n return `${trimTrailingSlash(builtinSchemaBase)}/default-human-user.json`;\n}\n\nexport function getDefaultHumanUserSchema(\n options: DefaultConfigRenderOptions = {},\n): CreateSchemaBody {\n const builtinSchemaBase = trimTrailingSlash(\n options.builtinSchemaBase ?? DEFAULT_BUILTIN_SCHEMA_BASE,\n );\n return renderTemplate(presetTemplates(options.preset ?? DEFAULT_SETUP_PRESET).schema, {\n SERVER_URL: builtinSchemaBase,\n USER_SCHEMA_URL: options.userSchemaUrl ?? defaultHumanUserSchemaUrl(builtinSchemaBase),\n }) as CreateSchemaBody;\n}\n\nexport function getDefaultLoginFlow(\n options: DefaultConfigRenderOptions = {},\n): CreateFlowDefinitionBodyFlowDefinition {\n const builtinSchemaBase = trimTrailingSlash(\n options.builtinSchemaBase ?? DEFAULT_BUILTIN_SCHEMA_BASE,\n );\n return renderTemplate(presetTemplates(options.preset ?? DEFAULT_SETUP_PRESET).flow, {\n SERVER_URL: builtinSchemaBase,\n USER_SCHEMA_URL: options.userSchemaUrl ?? defaultHumanUserSchemaUrl(builtinSchemaBase),\n }) as CreateFlowDefinitionBodyFlowDefinition;\n}\n\nfunction renderTemplate(value: unknown, replacements: Record<string, string>): unknown {\n if (Array.isArray(value)) {\n return value.map((item) => renderTemplate(item, replacements));\n }\n if (value !== null && typeof value === \"object\") {\n return Object.fromEntries(\n Object.entries(value).map(([key, item]) => [key, renderTemplate(item, replacements)]),\n );\n }\n if (typeof value === \"string\") {\n return value.replaceAll(/\\$\\{([A-Z_]+)\\}/g, (match, name: string) => {\n return replacements[name] ?? match;\n });\n }\n return value;\n}\n\nfunction trimTrailingSlash(value: string): string {\n return value.replace(/\\/+$/u, \"\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIQA,SAAgB,uBAA+B;AAC7C,QAAO,aAAa,UAAU,oBAAoB,EAAE,OAAO;;;;;;AAO7D,SAAgB,qBAA6B;AAC3C,QAAO,aAAa,UAAU,kBAAkB,EAAE,OAAO;;AAG3D,SAAS,UAAU,UAA0B;AAC3C,QAAO,cAAc,IAAI,IAAI,eAAe,YAAY,OAAO,KAAK,IAAI,CAAC;;;;ACD3E,MAAa,8BAA8B;AAC3C,MAAa,0BAA0B;AACvC,MAAa,6BAA6B;AAC1C,MAAa,2BAA2B;;;;;;;;AASxC,MAAa,gBAAgB,CAAC,kBAAkB,gBAAgB;AAIhE,MAAa,uBAAoC;AAEjD,MAAM,mBAA4E;CAChF,kBAAkB;EAChB,QAAQA;EACR,MAAMC;EACP;CACD,iBAAiB;EACf,QAAQC;EACR,MAAMC;EACP;CACF;AAED,SAAS,gBAAgB,QAAoD;AAI3E,KAAI,CAAC,OAAO,OAAO,kBAAkB,OAAO,CAC1C,OAAM,IAAI,MACR,wBAAwB,KAAK,UAAU,OAAO,CAAC,mBAAmB,cAAc,KAAK,KAAK,CAAC,GAC5F;AAEH,QAAO,iBAAiB;;AAU1B,SAAgB,0BACd,oBAAoB,6BACZ;AACR,QAAO,GAAG,kBAAkB,kBAAkB,CAAC;;AAGjD,SAAgB,0BACd,UAAsC,EAAE,EACtB;CAClB,MAAM,oBAAoB,kBACxB,QAAQ,qBAAA,kCACT;AACD,QAAO,eAAe,gBAAgB,QAAQ,UAAA,iBAA+B,CAAC,QAAQ;EACpF,YAAY;EACZ,iBAAiB,QAAQ,iBAAiB,0BAA0B,kBAAkB;EACvF,CAAC;;AAGJ,SAAgB,oBACd,UAAsC,EAAE,EACA;CACxC,MAAM,oBAAoB,kBACxB,QAAQ,qBAAA,kCACT;AACD,QAAO,eAAe,gBAAgB,QAAQ,UAAA,iBAA+B,CAAC,MAAM;EAClF,YAAY;EACZ,iBAAiB,QAAQ,iBAAiB,0BAA0B,kBAAkB;EACvF,CAAC;;AAGJ,SAAS,eAAe,OAAgB,cAA+C;AACrF,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,SAAS,eAAe,MAAM,aAAa,CAAC;AAEhE,KAAI,UAAU,QAAQ,OAAO,UAAU,SACrC,QAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,KAAK,eAAe,MAAM,aAAa,CAAC,CAAC,CACtF;AAEH,KAAI,OAAO,UAAU,SACnB,QAAO,MAAM,WAAW,qBAAqB,OAAO,SAAiB;AACnE,SAAO,aAAa,SAAS;GAC7B;AAEJ,QAAO;;AAGT,SAAS,kBAAkB,OAAuB;AAChD,QAAO,MAAM,QAAQ,SAAS,GAAG"}
|
|
@@ -18,13 +18,24 @@ declare const DEFAULT_BUILTIN_SCHEMA_BASE = "https://nextgen.com/api/schemas";
|
|
|
18
18
|
declare const DEFAULT_FLOW_SCHEMA_URI = "https://nextgen.com/flow-definition.json";
|
|
19
19
|
declare const DEFAULT_SCHEMA_CONFIG_PATH = ".zitadel/schemas/default-human-user.json";
|
|
20
20
|
declare const DEFAULT_FLOW_CONFIG_PATH = ".zitadel/flows/default-login.json";
|
|
21
|
+
/**
|
|
22
|
+
* Named schema+flow bundles `zitadel setup` can scaffold (#448: the prompt
|
|
23
|
+
* fires before any `.zitadel/` file is written; each preset maps to a
|
|
24
|
+
* pre-defined bundle the CLI copies on first setup). `password-first` is
|
|
25
|
+
* today's default; `passkey-first` puts a passkey ceremony on the login
|
|
26
|
+
* entry step with an email→password fallback path.
|
|
27
|
+
*/
|
|
28
|
+
declare const SETUP_PRESETS: readonly ["password-first", "passkey-first"];
|
|
29
|
+
type SetupPreset = (typeof SETUP_PRESETS)[number];
|
|
30
|
+
declare const DEFAULT_SETUP_PRESET: SetupPreset;
|
|
21
31
|
type DefaultConfigRenderOptions = {
|
|
22
32
|
builtinSchemaBase?: string;
|
|
23
|
-
userSchemaUrl?: string;
|
|
33
|
+
userSchemaUrl?: string; /** Which bundle to render; defaults to {@link DEFAULT_SETUP_PRESET}. */
|
|
34
|
+
preset?: string;
|
|
24
35
|
};
|
|
25
36
|
declare function defaultHumanUserSchemaUrl(builtinSchemaBase?: string): string;
|
|
26
37
|
declare function getDefaultHumanUserSchema(options?: DefaultConfigRenderOptions): CreateSchemaBody;
|
|
27
38
|
declare function getDefaultLoginFlow(options?: DefaultConfigRenderOptions): CreateFlowDefinitionBodyFlowDefinition;
|
|
28
39
|
//#endregion
|
|
29
|
-
export {
|
|
30
|
-
//# sourceMappingURL=defaults-
|
|
40
|
+
export { DEFAULT_SETUP_PRESET as a, SetupPreset as c, getDefaultLoginFlow as d, flowsReadmeContent as f, DEFAULT_SCHEMA_CONFIG_PATH as i, defaultHumanUserSchemaUrl as l, DEFAULT_FLOW_CONFIG_PATH as n, DefaultConfigRenderOptions as o, schemasReadmeContent as p, DEFAULT_FLOW_SCHEMA_URI as r, SETUP_PRESETS as s, DEFAULT_BUILTIN_SCHEMA_BASE as t, getDefaultHumanUserSchema as u };
|
|
41
|
+
//# sourceMappingURL=defaults-CSjBjBkQ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults-CSjBjBkQ.d.mts","names":[],"sources":["../src/readmes.ts","../src/defaults.ts"],"mappings":";;;;;;AAQA;;iBAAgB,oBAAA,CAAA;;;AAQhB;;iBAAgB,kBAAA,CAAA;;;cCIH,2BAAA;AAAA,cACA,uBAAA;AAAA,cACA,0BAAA;AAAA,cACA,wBAAA;;;ADPb;;;;;cCgBa,aAAA;AAAA,KAED,WAAA,WAAsB,aAAA;AAAA,cAErB,oBAAA,EAAsB,WAAA;AAAA,KAyBvB,0BAAA;EACV,iBAAA;EACA,aAAA,WA3CsC;EA6CtC,MAAA;AAAA;AAAA,iBAGc,yBAAA,CACd,iBAAA;AAAA,iBAKc,yBAAA,CACd,OAAA,GAAS,0BAAA,GACR,gBAAA;AAAA,iBAUa,mBAAA,CACd,OAAA,GAAS,0BAAA,GACR,sCAAA"}
|
package/dist/defaults.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { DEFAULT_BUILTIN_SCHEMA_BASE, DEFAULT_FLOW_CONFIG_PATH, DEFAULT_FLOW_SCHEMA_URI, DEFAULT_SCHEMA_CONFIG_PATH, DefaultConfigRenderOptions, defaultHumanUserSchemaUrl, flowsReadmeContent, getDefaultHumanUserSchema, getDefaultLoginFlow, schemasReadmeContent };
|
|
1
|
+
import { a as DEFAULT_SETUP_PRESET, c as SetupPreset, d as getDefaultLoginFlow, f as flowsReadmeContent, i as DEFAULT_SCHEMA_CONFIG_PATH, l as defaultHumanUserSchemaUrl, n as DEFAULT_FLOW_CONFIG_PATH, o as DefaultConfigRenderOptions, p as schemasReadmeContent, r as DEFAULT_FLOW_SCHEMA_URI, s as SETUP_PRESETS, t as DEFAULT_BUILTIN_SCHEMA_BASE, u as getDefaultHumanUserSchema } from "./defaults-CSjBjBkQ.mjs";
|
|
2
|
+
export { DEFAULT_BUILTIN_SCHEMA_BASE, DEFAULT_FLOW_CONFIG_PATH, DEFAULT_FLOW_SCHEMA_URI, DEFAULT_SCHEMA_CONFIG_PATH, DEFAULT_SETUP_PRESET, DefaultConfigRenderOptions, SETUP_PRESETS, SetupPreset, defaultHumanUserSchemaUrl, flowsReadmeContent, getDefaultHumanUserSchema, getDefaultLoginFlow, schemasReadmeContent };
|
package/dist/defaults.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { DEFAULT_BUILTIN_SCHEMA_BASE, DEFAULT_FLOW_CONFIG_PATH, DEFAULT_FLOW_SCHEMA_URI, DEFAULT_SCHEMA_CONFIG_PATH, defaultHumanUserSchemaUrl, flowsReadmeContent, getDefaultHumanUserSchema, getDefaultLoginFlow, schemasReadmeContent };
|
|
1
|
+
import { a as DEFAULT_SETUP_PRESET, c as getDefaultHumanUserSchema, d as schemasReadmeContent, i as DEFAULT_SCHEMA_CONFIG_PATH, l as getDefaultLoginFlow, n as DEFAULT_FLOW_CONFIG_PATH, o as SETUP_PRESETS, r as DEFAULT_FLOW_SCHEMA_URI, s as defaultHumanUserSchemaUrl, t as DEFAULT_BUILTIN_SCHEMA_BASE, u as flowsReadmeContent } from "./defaults-BQej3KIY.mjs";
|
|
2
|
+
export { DEFAULT_BUILTIN_SCHEMA_BASE, DEFAULT_FLOW_CONFIG_PATH, DEFAULT_FLOW_SCHEMA_URI, DEFAULT_SCHEMA_CONFIG_PATH, DEFAULT_SETUP_PRESET, SETUP_PRESETS, defaultHumanUserSchemaUrl, flowsReadmeContent, getDefaultHumanUserSchema, getDefaultLoginFlow, schemasReadmeContent };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as DEFAULT_SETUP_PRESET, c as SetupPreset, d as getDefaultLoginFlow, f as flowsReadmeContent, i as DEFAULT_SCHEMA_CONFIG_PATH, l as defaultHumanUserSchemaUrl, n as DEFAULT_FLOW_CONFIG_PATH, o as DefaultConfigRenderOptions, p as schemasReadmeContent, r as DEFAULT_FLOW_SCHEMA_URI, s as SETUP_PRESETS, t as DEFAULT_BUILTIN_SCHEMA_BASE, u as getDefaultHumanUserSchema } from "./defaults-CSjBjBkQ.mjs";
|
|
2
|
+
import { FLOW_FILE_SCHEMA_REF, META_SCHEMA_DIR, MetaSchemaFile, metaSchemaFiles } from "./meta-schemas.mjs";
|
|
3
|
+
import { USER_PROPERTY_DEFAULTS, normalizeFlowBody, normalizeSchemaBody } from "./normalize.mjs";
|
|
2
4
|
import { createFlowDefinitionRequestSchema, flowConfigSchema, schemaConfigSchema } from "./schemas.mjs";
|
|
3
|
-
|
|
5
|
+
import { FLOW_PURPOSES, FLOW_VALIDATION_RULES, FlowValidationIssue, FlowValidationRuleId, FlowValidationSeverity, PURPOSE_FLIP_TARGETS, RESERVED_OUTCOMES, validateFlowDefinition } from "./validate.mjs";
|
|
6
|
+
export { DEFAULT_BUILTIN_SCHEMA_BASE, DEFAULT_FLOW_CONFIG_PATH, DEFAULT_FLOW_SCHEMA_URI, DEFAULT_SCHEMA_CONFIG_PATH, DEFAULT_SETUP_PRESET, DefaultConfigRenderOptions, FLOW_FILE_SCHEMA_REF, FLOW_PURPOSES, FLOW_VALIDATION_RULES, FlowValidationIssue, FlowValidationRuleId, FlowValidationSeverity, META_SCHEMA_DIR, MetaSchemaFile, PURPOSE_FLIP_TARGETS, RESERVED_OUTCOMES, SETUP_PRESETS, SetupPreset, USER_PROPERTY_DEFAULTS, createFlowDefinitionRequestSchema, defaultHumanUserSchemaUrl, flowConfigSchema, flowsReadmeContent, getDefaultHumanUserSchema, getDefaultLoginFlow, metaSchemaFiles, normalizeFlowBody, normalizeSchemaBody, schemaConfigSchema, schemasReadmeContent, validateFlowDefinition };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as DEFAULT_SETUP_PRESET, c as getDefaultHumanUserSchema, d as schemasReadmeContent, i as DEFAULT_SCHEMA_CONFIG_PATH, l as getDefaultLoginFlow, n as DEFAULT_FLOW_CONFIG_PATH, o as SETUP_PRESETS, r as DEFAULT_FLOW_SCHEMA_URI, s as defaultHumanUserSchemaUrl, t as DEFAULT_BUILTIN_SCHEMA_BASE, u as flowsReadmeContent } from "./defaults-BQej3KIY.mjs";
|
|
2
|
+
import { n as META_SCHEMA_DIR, r as metaSchemaFiles, t as FLOW_FILE_SCHEMA_REF } from "./meta-schemas-8nlyVL7g.mjs";
|
|
3
|
+
import { USER_PROPERTY_DEFAULTS, normalizeFlowBody, normalizeSchemaBody } from "./normalize.mjs";
|
|
2
4
|
import { createFlowDefinitionRequestSchema, flowConfigSchema, schemaConfigSchema } from "./schemas.mjs";
|
|
3
|
-
|
|
5
|
+
import { FLOW_PURPOSES, FLOW_VALIDATION_RULES, PURPOSE_FLIP_TARGETS, RESERVED_OUTCOMES, validateFlowDefinition } from "./validate.mjs";
|
|
6
|
+
export { DEFAULT_BUILTIN_SCHEMA_BASE, DEFAULT_FLOW_CONFIG_PATH, DEFAULT_FLOW_SCHEMA_URI, DEFAULT_SCHEMA_CONFIG_PATH, DEFAULT_SETUP_PRESET, FLOW_FILE_SCHEMA_REF, FLOW_PURPOSES, FLOW_VALIDATION_RULES, META_SCHEMA_DIR, PURPOSE_FLIP_TARGETS, RESERVED_OUTCOMES, SETUP_PRESETS, USER_PROPERTY_DEFAULTS, createFlowDefinitionRequestSchema, defaultHumanUserSchemaUrl, flowConfigSchema, flowsReadmeContent, getDefaultHumanUserSchema, getDefaultLoginFlow, metaSchemaFiles, normalizeFlowBody, normalizeSchemaBody, schemaConfigSchema, schemasReadmeContent, validateFlowDefinition };
|