@zitadel/components 0.1.0-alpha.11 → 0.1.0-alpha.13

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.
@@ -1,6 +1,6 @@
1
- import { _ as __decorate, b as t, v as focusVisibleStyles, x as emit, y as baseHostStyles } from "./atoms-BHSt5lSe.mjs";
1
+ import { C as baseHostStyles, S as focusVisibleStyles, T as emit, w as t, x as __decorate } from "./atoms-BSwVl736.mjs";
2
2
  import { r as tokensCss } from "./tokens-C0j4iCrs.mjs";
3
- import { t as default_default } from "./default-Cpl78hQN.mjs";
3
+ import { t as default_default } from "./default-W5MwYLBc.mjs";
4
4
  import { manifestRegistry } from "./manifests.mjs";
5
5
  import { LitElement, css, html, nothing } from "lit";
6
6
  import { customElement, property, state } from "lit/decorators.js";
@@ -158,6 +158,7 @@ var __exportAll = (all, no_symbols) => {
158
158
  * OpenAPI spec version: 0.0.1
159
159
  */
160
160
  var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
161
+ activateFlowDefinition: () => activateFlowDefinition,
161
162
  authorizeDevice: () => authorizeDevice,
162
163
  authorizeGet: () => authorizeGet,
163
164
  createAuthAttempt: () => createAuthAttempt,
@@ -169,9 +170,11 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
169
170
  createSession: () => createSession,
170
171
  createTeam: () => createTeam,
171
172
  createUser: () => createUser,
173
+ deactivateFlowDefinition: () => deactivateFlowDefinition,
172
174
  deleteFlowDefinition: () => deleteFlowDefinition,
173
175
  endSession: () => endSession,
174
176
  exchangeHandoff: () => exchangeHandoff,
177
+ getActivateFlowDefinitionUrl: () => getActivateFlowDefinitionUrl,
175
178
  getAuthAttempt: () => getAuthAttempt,
176
179
  getAuthorizeDeviceUrl: () => getAuthorizeDeviceUrl,
177
180
  getAuthorizeGetUrl: () => getAuthorizeGetUrl,
@@ -184,6 +187,7 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
184
187
  getCreateSessionUrl: () => getCreateSessionUrl,
185
188
  getCreateTeamUrl: () => getCreateTeamUrl,
186
189
  getCreateUserUrl: () => getCreateUserUrl,
190
+ getDeactivateFlowDefinitionUrl: () => getDeactivateFlowDefinitionUrl,
187
191
  getDeleteFlowDefinitionUrl: () => getDeleteFlowDefinitionUrl,
188
192
  getEndSessionUrl: () => getEndSessionUrl,
189
193
  getExchangeHandoffUrl: () => getExchangeHandoffUrl,
@@ -1019,7 +1023,7 @@ const getCreateFlowDefinitionUrl = () => {
1019
1023
  Flow definitions are templates that define the sequence of steps (capabilities)
1020
1024
  for a particular user journey (e.g., registration, login, password reset).
1021
1025
 
1022
- Flow definitions are created based on the flow meta schema, which includes the flow's purpose, audience, and the steps involved.
1026
+ Flow definitions are created based on the flow definition schema, which includes the flow's purpose, audience, and the steps involved.
1023
1027
 
1024
1028
  * @summary Create a new flow definition
1025
1029
  */
@@ -1081,13 +1085,15 @@ const getUpdateFlowDefinitionUrl = (id, params) => {
1081
1085
  return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
1082
1086
  };
1083
1087
  /**
1084
- * Update a flow definition by id
1088
+ * Update a flow definition by id. This endpoint replaces the existing flow definition.
1089
+ If `flow_definition.status` is omitted, the current status is preserved
1090
+
1085
1091
  * @summary Update a flow definition by id
1086
1092
  */
1087
1093
  const updateFlowDefinition = async (id, updateFlowDefinitionBody, params, options) => {
1088
1094
  return customFetch(getUpdateFlowDefinitionUrl(id, params), {
1089
1095
  ...options,
1090
- method: "PATCH",
1096
+ method: "PUT",
1091
1097
  headers: {
1092
1098
  "Content-Type": "application/json",
1093
1099
  ...options?.headers
@@ -1104,7 +1110,10 @@ const getDeleteFlowDefinitionUrl = (id, params) => {
1104
1110
  return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
1105
1111
  };
1106
1112
  /**
1107
- * Delete a flow definition by id
1113
+ * Delete a flow definition by id.
1114
+ If the flow definition is currently being used by a flow, the deletion will fail.
1115
+ If the flow definition is the last active flow definition for a given purpose, the deletion will fail to prevent disruption of new flows being started for that purpose.
1116
+
1108
1117
  * @summary Delete a flow definition by id
1109
1118
  */
1110
1119
  const deleteFlowDefinition = async (id, params, options) => {
@@ -1113,6 +1122,47 @@ const deleteFlowDefinition = async (id, params, options) => {
1113
1122
  method: "DELETE"
1114
1123
  });
1115
1124
  };
1125
+ const getActivateFlowDefinitionUrl = (id, params) => {
1126
+ const normalizedParams = new URLSearchParams();
1127
+ Object.entries(params || {}).forEach(([key, value]) => {
1128
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1129
+ });
1130
+ const stringifiedParams = normalizedParams.toString();
1131
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}/activate?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}/activate`;
1132
+ };
1133
+ /**
1134
+ * Activate a flow definition by transitioning it from a `draft` state to an `active` state.
1135
+ Alternatively, the status of a flow definition can also be set via the `POST /flow_definitions` and `PUT /flow_definitions/{id}` endpoints by setting the `status` attribute in the flow definition payload.
1136
+
1137
+ * @summary Activate a flow definition by ID.
1138
+ */
1139
+ const activateFlowDefinition = async (id, params, options) => {
1140
+ return customFetch(getActivateFlowDefinitionUrl(id, params), {
1141
+ ...options,
1142
+ method: "POST"
1143
+ });
1144
+ };
1145
+ const getDeactivateFlowDefinitionUrl = (id, params) => {
1146
+ const normalizedParams = new URLSearchParams();
1147
+ Object.entries(params || {}).forEach(([key, value]) => {
1148
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1149
+ });
1150
+ const stringifiedParams = normalizedParams.toString();
1151
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}/deactivate?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}/deactivate`;
1152
+ };
1153
+ /**
1154
+ * Deactivates a flow definition in the `active` state by transitioning it to the `draft` state.
1155
+ Flow definitions in `draft` state cannot be used to start new flows. Existing flows that use the deactivated flow definition must gracefully handle this.
1156
+ Alternatively, the status of a flow definition can also be set via the `POST /flow_definitions` and `PUT /flow_definitions/{id}` endpoints by setting the `status` attribute in the flow definition payload.
1157
+
1158
+ * @summary Deactivate a flow definition by ID.
1159
+ */
1160
+ const deactivateFlowDefinition = async (id, params, options) => {
1161
+ return customFetch(getDeactivateFlowDefinitionUrl(id, params), {
1162
+ ...options,
1163
+ method: "POST"
1164
+ });
1165
+ };
1116
1166
  const getCreateTeamUrl = (params) => {
1117
1167
  const normalizedParams = new URLSearchParams();
1118
1168
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -1756,6 +1806,22 @@ function createLiquidEngine(options) {
1756
1806
  const lookupKey = `${stringify(textKey)}.help`;
1757
1807
  return options.locale[lookupKey] ?? "";
1758
1808
  });
1809
+ /**
1810
+ * Builds `<zl-select>` options from a field's closed `validation.enum`. The
1811
+ * wire only carries the allowed values (strings), so the label defaults to the
1812
+ * value — author the enum with display-ready text. Piped through `| json` into
1813
+ * the element's `options` attribute.
1814
+ */
1815
+ engine.registerFilter("selectOptions", (values) => {
1816
+ if (!Array.isArray(values)) return [];
1817
+ return values.map((value) => {
1818
+ const v = stringify(value);
1819
+ return {
1820
+ value: v,
1821
+ label: v
1822
+ };
1823
+ });
1824
+ });
1759
1825
  /** Maps `error.*` text keys to a field name (Figma inline-error annotations). */
1760
1826
  const fieldErrorKeys = {
1761
1827
  "error.email_required": "email",
@@ -1873,12 +1939,10 @@ const en = {
1873
1939
  "collect-credentials.field.email": "Work email",
1874
1940
  "collect-credentials.field.email.placeholder": "you@company.com",
1875
1941
  "collect-credentials.field.password": "Password",
1876
- "collect-credentials.field.password.help": "At least 8 characters, including a symbol and number.",
1877
1942
  "collect-credentials.action.submit": "Sign up",
1878
1943
  "register-password.title": "Create your password",
1879
1944
  "register-password.description": "Choose a secure password for your account",
1880
1945
  "register-password.field.password": "Password",
1881
- "register-password.field.password.help": "At least 8 characters, including a symbol and number.",
1882
1946
  "register-password.action.submit": "Sign up",
1883
1947
  "passkey-upsell.title": "Sign in faster next time",
1884
1948
  "passkey-upsell.description": "No password needed ever again.",
@@ -1909,12 +1973,12 @@ const en = {
1909
1973
  "register.field.email": "Work email",
1910
1974
  "register.field.email.placeholder": "you@company.com",
1911
1975
  "register.field.password": "Password",
1912
- "register.field.password.help": "At least 8 characters, including a symbol and number.",
1913
1976
  "register.field.givenName": "Given name",
1914
1977
  "register.field.familyName": "Family name",
1915
1978
  "register.field.dateOfBirth": "Date of birth",
1916
- "register.field.dateOfBirth.placeholder": "YYYY-MM-DD",
1917
- "register.field.dateOfBirth.help": "Use YYYY-MM-DD.",
1979
+ "register.field.country": "Country",
1980
+ "register.field.country.placeholder": "Select your country",
1981
+ "register.field.terms": "I agree to the terms of service",
1918
1982
  "register.action.password": "Continue with password",
1919
1983
  "register.action.passkey": "Continue with a passkey",
1920
1984
  "register.action.submit": "Sign up",
@@ -1974,12 +2038,10 @@ const de = {
1974
2038
  "collect-credentials.field.email": "E-Mail",
1975
2039
  "collect-credentials.field.email.placeholder": "du@unternehmen.com",
1976
2040
  "collect-credentials.field.password": "Passwort",
1977
- "collect-credentials.field.password.help": "Mindestens 8 Zeichen, einschließlich eines Sonderzeichens und einer Zahl.",
1978
2041
  "collect-credentials.action.submit": "Registrieren",
1979
2042
  "register-password.title": "Passwort erstellen",
1980
2043
  "register-password.description": "Wähle ein sicheres Passwort für dein Konto",
1981
2044
  "register-password.field.password": "Passwort",
1982
- "register-password.field.password.help": "Mindestens 8 Zeichen, einschließlich eines Sonderzeichens und einer Zahl.",
1983
2045
  "register-password.action.submit": "Registrieren",
1984
2046
  "passkey-upsell.title": "Nächstes Mal schneller anmelden",
1985
2047
  "passkey-upsell.description": "Kein Passwort mehr nötig.",
@@ -2010,12 +2072,12 @@ const de = {
2010
2072
  "register.field.email": "E-Mail",
2011
2073
  "register.field.email.placeholder": "du@unternehmen.com",
2012
2074
  "register.field.password": "Passwort",
2013
- "register.field.password.help": "Mindestens 8 Zeichen, einschließlich eines Sonderzeichens und einer Zahl.",
2014
2075
  "register.field.givenName": "Vorname",
2015
2076
  "register.field.familyName": "Nachname",
2016
2077
  "register.field.dateOfBirth": "Geburtsdatum",
2017
- "register.field.dateOfBirth.placeholder": "JJJJ-MM-TT",
2018
- "register.field.dateOfBirth.help": "Verwende JJJJ-MM-TT.",
2078
+ "register.field.country": "Land",
2079
+ "register.field.country.placeholder": "Land auswählen",
2080
+ "register.field.terms": "Ich stimme den Nutzungsbedingungen zu",
2019
2081
  "register.action.password": "Mit Passwort fortfahren",
2020
2082
  "register.action.passkey": "Weiter mit Passkey",
2021
2083
  "register.action.submit": "Registrieren",
@@ -2074,12 +2136,10 @@ const it = {
2074
2136
  "collect-credentials.field.email": "E-mail aziendale",
2075
2137
  "collect-credentials.field.email.placeholder": "tu@azienda.com",
2076
2138
  "collect-credentials.field.password": "Password",
2077
- "collect-credentials.field.password.help": "Almeno 8 caratteri, incluso un simbolo e un numero.",
2078
2139
  "collect-credentials.action.submit": "Registrati",
2079
2140
  "register-password.title": "Crea la tua password",
2080
2141
  "register-password.description": "Scegli una password sicura per il tuo account",
2081
2142
  "register-password.field.password": "Password",
2082
- "register-password.field.password.help": "Almeno 8 caratteri, incluso un simbolo e un numero.",
2083
2143
  "register-password.action.submit": "Registrati",
2084
2144
  "passkey-upsell.title": "Accedi più velocemente la prossima volta",
2085
2145
  "passkey-upsell.description": "Nessuna password necessaria.",
@@ -2110,12 +2170,12 @@ const it = {
2110
2170
  "register.field.email": "E-mail aziendale",
2111
2171
  "register.field.email.placeholder": "tu@azienda.com",
2112
2172
  "register.field.password": "Password",
2113
- "register.field.password.help": "Almeno 8 caratteri, incluso un simbolo e un numero.",
2114
2173
  "register.field.givenName": "Nome",
2115
2174
  "register.field.familyName": "Cognome",
2116
2175
  "register.field.dateOfBirth": "Data di nascita",
2117
- "register.field.dateOfBirth.placeholder": "AAAA-MM-GG",
2118
- "register.field.dateOfBirth.help": "Usa AAAA-MM-GG.",
2176
+ "register.field.country": "Paese",
2177
+ "register.field.country.placeholder": "Seleziona il tuo paese",
2178
+ "register.field.terms": "Accetto i termini di servizio",
2119
2179
  "register.action.password": "Continua con password",
2120
2180
  "register.action.passkey": "Continua con passkey",
2121
2181
  "register.action.submit": "Registrati",
@@ -2700,7 +2760,7 @@ let ZitadelLogin = class ZitadelLogin extends LitElement {
2700
2760
  actions,
2701
2761
  gates: step.gates ?? {},
2702
2762
  sso_providers: step.sso_providers ?? [],
2703
- challenge: step.challenge ?? null,
2763
+ challenge: this.loading ? null : step.challenge ?? null,
2704
2764
  messages: [],
2705
2765
  identity: this.deriveIdentity(),
2706
2766
  errors,
@@ -3390,4 +3450,4 @@ function fillTemplateTokens(fragment, name, email, initial) {
3390
3450
  //#endregion
3391
3451
  export { buildBrandingStylesheet as _, createSanitiser as a, startFlow as b, de as c, MANDATORY_GATES_MARKER as d, mandatoryGatesMarkerComment as f, applyBrandingTokens as g, validateBranding as h, layout_chrome_default as i, en as l, applyFontUrl as m, ZitadelLogin as n, builtinLocales as o, patchMandatoryGates as p, ThemeController as r, it as s, ZitadelLogout as t, TEMPLATE_NAMES as u, resolveTheme as v, submitStep as x, getCurrentStep as y };
3392
3452
 
3393
- //# sourceMappingURL=orchestrator-BeTmVk54.mjs.map
3453
+ //# sourceMappingURL=orchestrator-SBANwyzM.mjs.map