@zitadel/api 0.1.0-alpha.0 → 0.1.0-alpha.2

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.
Files changed (217) hide show
  1. package/dist/generated/endpoints/zitadelNextGen.d.mts +2 -2
  2. package/dist/generated/endpoints/zitadelNextGen.d.ts +17 -7
  3. package/dist/generated/endpoints/zitadelNextGen.d.ts.map +1 -1
  4. package/dist/generated/endpoints/zitadelNextGen.mjs +69 -16
  5. package/dist/generated/endpoints/zitadelNextGen.mjs.map +1 -1
  6. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts +8 -5
  7. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts.map +1 -1
  8. package/dist/generated/endpoints/zitadelNextGen.msw.d.ts +7 -4
  9. package/dist/generated/endpoints/zitadelNextGen.msw.d.ts.map +1 -1
  10. package/dist/generated/endpoints/zitadelNextGen.msw.mjs +248 -228
  11. package/dist/generated/endpoints/zitadelNextGen.msw.mjs.map +1 -1
  12. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts +139 -108
  13. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts.map +1 -1
  14. package/dist/generated/endpoints/zitadelNextGen.zod.d.ts +134 -103
  15. package/dist/generated/endpoints/zitadelNextGen.zod.d.ts.map +1 -1
  16. package/dist/generated/endpoints/zitadelNextGen.zod.mjs +104 -83
  17. package/dist/generated/endpoints/zitadelNextGen.zod.mjs.map +1 -1
  18. package/dist/generated/model/createFlowDefinition201.d.ts +11 -144
  19. package/dist/generated/model/createFlowDefinition201.d.ts.map +1 -1
  20. package/dist/generated/model/createFlowDefinition201FlowDefinition.d.ts +56 -0
  21. package/dist/generated/model/createFlowDefinition201FlowDefinition.d.ts.map +1 -0
  22. package/dist/generated/model/createFlowDefinition201FlowDefinitionAudience.d.ts +21 -0
  23. package/dist/generated/model/createFlowDefinition201FlowDefinitionAudience.d.ts.map +1 -0
  24. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItem.d.ts +71 -0
  25. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItem.d.ts.map +1 -0
  26. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemActions.d.ts +29 -0
  27. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemActions.d.ts.map +1 -0
  28. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemComplete.d.ts +19 -0
  29. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemComplete.d.ts.map +1 -0
  30. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemGates.d.ts +35 -0
  31. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemGates.d.ts.map +1 -0
  32. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemGatesConfig.d.ts +16 -0
  33. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemGatesConfig.d.ts.map +1 -0
  34. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemGatesKind.d.ts +18 -0
  35. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemGatesKind.d.ts.map +1 -0
  36. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemOnSuccess.d.ts +19 -0
  37. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemOnSuccess.d.ts.map +1 -0
  38. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemSsoProvidersItem.d.ts +19 -0
  39. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemSsoProvidersItem.d.ts.map +1 -0
  40. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemTransitions.d.ts +35 -0
  41. package/dist/generated/model/createFlowDefinition201FlowDefinitionStepsItemTransitions.d.ts.map +1 -0
  42. package/dist/generated/model/deleteFlowDefinitionParams.d.ts +15 -0
  43. package/dist/generated/model/deleteFlowDefinitionParams.d.ts.map +1 -0
  44. package/dist/generated/model/getFlowDefinition200.d.ts +11 -144
  45. package/dist/generated/model/getFlowDefinition200.d.ts.map +1 -1
  46. package/dist/generated/model/getFlowDefinition200FlowDefinition.d.ts +56 -0
  47. package/dist/generated/model/getFlowDefinition200FlowDefinition.d.ts.map +1 -0
  48. package/dist/generated/model/getFlowDefinition200FlowDefinitionAudience.d.ts +21 -0
  49. package/dist/generated/model/getFlowDefinition200FlowDefinitionAudience.d.ts.map +1 -0
  50. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItem.d.ts +71 -0
  51. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItem.d.ts.map +1 -0
  52. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemActions.d.ts +29 -0
  53. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemActions.d.ts.map +1 -0
  54. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemComplete.d.ts +19 -0
  55. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemComplete.d.ts.map +1 -0
  56. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemGates.d.ts +35 -0
  57. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemGates.d.ts.map +1 -0
  58. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemGatesConfig.d.ts +16 -0
  59. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemGatesConfig.d.ts.map +1 -0
  60. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemGatesKind.d.ts +18 -0
  61. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemGatesKind.d.ts.map +1 -0
  62. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemOnSuccess.d.ts +19 -0
  63. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemOnSuccess.d.ts.map +1 -0
  64. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemSsoProvidersItem.d.ts +19 -0
  65. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemSsoProvidersItem.d.ts.map +1 -0
  66. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemTransitions.d.ts +35 -0
  67. package/dist/generated/model/getFlowDefinition200FlowDefinitionStepsItemTransitions.d.ts.map +1 -0
  68. package/dist/generated/model/getFlowDefinitionParams.d.ts +15 -0
  69. package/dist/generated/model/getFlowDefinitionParams.d.ts.map +1 -0
  70. package/dist/generated/model/getMyUser200.d.ts +11 -0
  71. package/dist/generated/model/getMyUser200.d.ts.map +1 -0
  72. package/dist/generated/model/{getFlowDefinition404.d.ts → getMyUser401.d.ts} +4 -4
  73. package/dist/generated/model/getMyUser401.d.ts.map +1 -0
  74. package/dist/generated/model/{getFlowDefinition404Details.d.ts → getMyUser401Details.d.ts} +2 -2
  75. package/dist/generated/model/getMyUser401Details.d.ts.map +1 -0
  76. package/dist/generated/model/getMyUser404.d.ts +26 -0
  77. package/dist/generated/model/getMyUser404.d.ts.map +1 -0
  78. package/dist/generated/model/{deleteFlowDefinition404.d.ts → getMyUserDefault.d.ts} +4 -4
  79. package/dist/generated/model/getMyUserDefault.d.ts.map +1 -0
  80. package/dist/generated/model/{deleteFlowDefinition404Details.d.ts → getMyUserDefaultDetails.d.ts} +2 -2
  81. package/dist/generated/model/getMyUserDefaultDetails.d.ts.map +1 -0
  82. package/dist/generated/model/index.d.mts +2 -2
  83. package/dist/generated/model/index.d.ts +52 -4
  84. package/dist/generated/model/index.d.ts.map +1 -1
  85. package/dist/generated/model/index.mjs +37 -1
  86. package/dist/generated/model/index.mjs.map +1 -1
  87. package/dist/generated/model/listFlowDefinitions200FlowDefinitionsItem.d.ts +1 -1
  88. package/dist/generated/model/listFlowDefinitions200FlowDefinitionsItem.d.ts.map +1 -1
  89. package/dist/generated/model/listFlowDefinitionsParams.d.ts +1 -1
  90. package/dist/generated/model/setUserPassword400.d.ts +20 -0
  91. package/dist/generated/model/setUserPassword400.d.ts.map +1 -0
  92. package/dist/generated/model/setUserPassword400Details.d.ts +14 -0
  93. package/dist/generated/model/setUserPassword400Details.d.ts.map +1 -0
  94. package/dist/generated/model/setUserPassword404.d.ts +20 -0
  95. package/dist/generated/model/setUserPassword404.d.ts.map +1 -0
  96. package/dist/generated/model/setUserPassword404Details.d.ts +14 -0
  97. package/dist/generated/model/setUserPassword404Details.d.ts.map +1 -0
  98. package/dist/generated/model/setUserPassword500.d.ts +20 -0
  99. package/dist/generated/model/setUserPassword500.d.ts.map +1 -0
  100. package/dist/generated/model/setUserPassword500Details.d.ts +14 -0
  101. package/dist/generated/model/setUserPassword500Details.d.ts.map +1 -0
  102. package/dist/generated/model/setUserPasswordBody.d.ts +19 -0
  103. package/dist/generated/model/setUserPasswordBody.d.ts.map +1 -0
  104. package/dist/generated/model/setUserPasswordDefault.d.ts +20 -0
  105. package/dist/generated/model/setUserPasswordDefault.d.ts.map +1 -0
  106. package/dist/generated/model/setUserPasswordDefaultDetails.d.ts +14 -0
  107. package/dist/generated/model/setUserPasswordDefaultDetails.d.ts.map +1 -0
  108. package/dist/generated/model/setUserPasswordParams.d.ts +15 -0
  109. package/dist/generated/model/setUserPasswordParams.d.ts.map +1 -0
  110. package/dist/generated/model/updateFlowDefinition200.d.ts +11 -144
  111. package/dist/generated/model/updateFlowDefinition200.d.ts.map +1 -1
  112. package/dist/generated/model/updateFlowDefinition200FlowDefinition.d.ts +56 -0
  113. package/dist/generated/model/updateFlowDefinition200FlowDefinition.d.ts.map +1 -0
  114. package/dist/generated/model/updateFlowDefinition200FlowDefinitionAudience.d.ts +21 -0
  115. package/dist/generated/model/updateFlowDefinition200FlowDefinitionAudience.d.ts.map +1 -0
  116. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItem.d.ts +71 -0
  117. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItem.d.ts.map +1 -0
  118. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemActions.d.ts +29 -0
  119. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemActions.d.ts.map +1 -0
  120. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemComplete.d.ts +19 -0
  121. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemComplete.d.ts.map +1 -0
  122. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGates.d.ts +35 -0
  123. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGates.d.ts.map +1 -0
  124. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGatesConfig.d.ts +16 -0
  125. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGatesConfig.d.ts.map +1 -0
  126. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGatesKind.d.ts +18 -0
  127. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGatesKind.d.ts.map +1 -0
  128. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemOnSuccess.d.ts +19 -0
  129. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemOnSuccess.d.ts.map +1 -0
  130. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemSsoProvidersItem.d.ts +19 -0
  131. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemSsoProvidersItem.d.ts.map +1 -0
  132. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemTransitions.d.ts +35 -0
  133. package/dist/generated/model/updateFlowDefinition200FlowDefinitionStepsItemTransitions.d.ts.map +1 -0
  134. package/dist/generated/model/updateFlowDefinitionParams.d.ts +15 -0
  135. package/dist/generated/model/updateFlowDefinitionParams.d.ts.map +1 -0
  136. package/dist/{index-DlEenfQJ.d.mts → index-DyBulyp9.d.mts} +1685 -938
  137. package/dist/index-DyBulyp9.d.mts.map +1 -0
  138. package/dist/runtime/api-factory.d.mts +1 -1
  139. package/dist/runtime/config.d.mts +6 -3
  140. package/dist/runtime/config.d.mts.map +1 -1
  141. package/dist/runtime/config.d.ts +6 -3
  142. package/dist/runtime/config.d.ts.map +1 -1
  143. package/dist/runtime/config.mjs +42 -11
  144. package/dist/runtime/config.mjs.map +1 -1
  145. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  146. package/dist/{zitadelNextGen-C-fBEgnH.d.mts → zitadelNextGen-D6pDH5nq.d.mts} +20 -10
  147. package/dist/zitadelNextGen-D6pDH5nq.d.mts.map +1 -0
  148. package/package.json +1 -1
  149. package/src/generated/endpoints/zitadelNextGen.msw.ts +82 -34
  150. package/src/generated/endpoints/zitadelNextGen.ts +111 -16
  151. package/src/generated/endpoints/zitadelNextGen.zod.ts +443 -384
  152. package/src/generated/model/createFlowDefinition201.ts +11 -144
  153. package/src/generated/model/createFlowDefinition201FlowDefinition.ts +58 -0
  154. package/src/generated/model/createFlowDefinition201FlowDefinitionAudience.ts +21 -0
  155. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItem.ts +71 -0
  156. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemActions.ts +29 -0
  157. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemComplete.ts +21 -0
  158. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemGates.ts +35 -0
  159. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemGatesConfig.ts +14 -0
  160. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemGatesKind.ts +20 -0
  161. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemOnSuccess.ts +21 -0
  162. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemSsoProvidersItem.ts +19 -0
  163. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemTransitions.ts +35 -0
  164. package/src/generated/model/deleteFlowDefinitionParams.ts +15 -0
  165. package/src/generated/model/getFlowDefinition200.ts +11 -144
  166. package/src/generated/model/getFlowDefinition200FlowDefinition.ts +58 -0
  167. package/src/generated/model/getFlowDefinition200FlowDefinitionAudience.ts +21 -0
  168. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItem.ts +71 -0
  169. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemActions.ts +29 -0
  170. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemComplete.ts +21 -0
  171. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemGates.ts +35 -0
  172. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemGatesConfig.ts +14 -0
  173. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemGatesKind.ts +20 -0
  174. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemOnSuccess.ts +21 -0
  175. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemSsoProvidersItem.ts +19 -0
  176. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemTransitions.ts +35 -0
  177. package/src/generated/model/getFlowDefinitionParams.ts +15 -0
  178. package/src/generated/model/getMyUser200.ts +9 -0
  179. package/src/generated/model/{getFlowDefinition404.ts → getMyUser401.ts} +3 -3
  180. package/src/generated/model/{getFlowDefinition404Details.ts → getMyUser401Details.ts} +1 -1
  181. package/src/generated/model/getMyUser404.ts +24 -0
  182. package/src/generated/model/{deleteFlowDefinition404.ts → getMyUserDefault.ts} +3 -3
  183. package/src/generated/model/{deleteFlowDefinition404Details.ts → getMyUserDefaultDetails.ts} +1 -1
  184. package/src/generated/model/index.ts +52 -4
  185. package/src/generated/model/listFlowDefinitions200FlowDefinitionsItem.ts +1 -1
  186. package/src/generated/model/listFlowDefinitionsParams.ts +1 -1
  187. package/src/generated/model/setUserPassword400.ts +20 -0
  188. package/src/generated/model/setUserPassword400Details.ts +12 -0
  189. package/src/generated/model/setUserPassword404.ts +20 -0
  190. package/src/generated/model/setUserPassword404Details.ts +12 -0
  191. package/src/generated/model/setUserPassword500.ts +20 -0
  192. package/src/generated/model/setUserPassword500Details.ts +12 -0
  193. package/src/generated/model/setUserPasswordBody.ts +19 -0
  194. package/src/generated/model/setUserPasswordDefault.ts +20 -0
  195. package/src/generated/model/setUserPasswordDefaultDetails.ts +12 -0
  196. package/src/generated/model/setUserPasswordParams.ts +15 -0
  197. package/src/generated/model/updateFlowDefinition200.ts +11 -144
  198. package/src/generated/model/updateFlowDefinition200FlowDefinition.ts +58 -0
  199. package/src/generated/model/updateFlowDefinition200FlowDefinitionAudience.ts +21 -0
  200. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItem.ts +71 -0
  201. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemActions.ts +29 -0
  202. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemComplete.ts +21 -0
  203. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGates.ts +35 -0
  204. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGatesConfig.ts +14 -0
  205. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemGatesKind.ts +20 -0
  206. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemOnSuccess.ts +21 -0
  207. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemSsoProvidersItem.ts +19 -0
  208. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemTransitions.ts +35 -0
  209. package/src/generated/model/updateFlowDefinitionParams.ts +15 -0
  210. package/src/runtime/config.spec.ts +41 -0
  211. package/src/runtime/config.ts +46 -18
  212. package/dist/generated/model/deleteFlowDefinition404.d.ts.map +0 -1
  213. package/dist/generated/model/deleteFlowDefinition404Details.d.ts.map +0 -1
  214. package/dist/generated/model/getFlowDefinition404.d.ts.map +0 -1
  215. package/dist/generated/model/getFlowDefinition404Details.d.ts.map +0 -1
  216. package/dist/index-DlEenfQJ.d.mts.map +0 -1
  217. package/dist/zitadelNextGen-C-fBEgnH.d.mts.map +0 -1
@@ -585,6 +585,41 @@ export const GetUserByIDQueryParams = zod.strictObject({
585
585
 
586
586
  export const GetUserByIDResponse = zod.record(zod.string(), zod.unknown());
587
587
 
588
+ /**
589
+ * @summary Set user password
590
+ */
591
+ export const setUserPasswordPathUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
592
+
593
+ export const SetUserPasswordParams = zod.object({
594
+ user_id: zod.string().regex(setUserPasswordPathUserIdRegExp),
595
+ });
596
+
597
+ export const setUserPasswordQueryProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
598
+
599
+ export const SetUserPasswordQueryParams = zod.strictObject({
600
+ project_id: zod
601
+ .string()
602
+ .regex(setUserPasswordQueryProjectIdRegExp)
603
+ .describe("The unique identifier of the project"),
604
+ });
605
+
606
+ export const SetUserPasswordBody = zod
607
+ .object({
608
+ password: zod.string().describe("The new password for the user."),
609
+ isChangeRequired: zod
610
+ .boolean()
611
+ .optional()
612
+ .describe(
613
+ "Whether the user is required to change their password on the next login.\nIf not provided, it will default to false.\n",
614
+ ),
615
+ })
616
+ .describe("Request to update the user's password.");
617
+
618
+ /**
619
+ * @summary Get my user information
620
+ */
621
+ export const GetMyUserResponse = zod.record(zod.string(), zod.unknown());
622
+
588
623
  /**
589
624
  * Resolves a flow definition based on purpose + audience context and returns
590
625
  the first capability step. Creates a new session implicitly unless
@@ -3146,7 +3181,7 @@ export const ListFlowDefinitionsQueryParams = zod.strictObject({
3146
3181
  project_id: zod
3147
3182
  .string()
3148
3183
  .regex(listFlowDefinitionsQueryProjectIdRegExp)
3149
- .describe("The unique identifier of the project"),
3184
+ .describe("The project id to filter by."),
3150
3185
  purpose: zod
3151
3186
  .enum(["login", "register", "recovery", "profiling", "reauth", "link_account"])
3152
3187
  .optional()
@@ -3171,6 +3206,7 @@ export const ListFlowDefinitionsResponse = zod.object({
3171
3206
  .describe("Identifier of the project this flow definition belongs to."),
3172
3207
  schema_uri: zod
3173
3208
  .url()
3209
+ .optional()
3174
3210
  .describe(
3175
3211
  "URI of the flow definition schema this definition was authored against.\nIf the schema_uri was not provided in the request, the flow definition is validated against the latest version of the schema, and the response includes the schema_uri of the latest version.\n",
3176
3212
  ),
@@ -3200,30 +3236,232 @@ export const GetFlowDefinitionParams = zod.object({
3200
3236
  id: zod.string().describe("The id returned by the POST \/flow_definitions endpoint.\n"),
3201
3237
  });
3202
3238
 
3203
- export const getFlowDefinitionResponseOneNameRegExp = new RegExp("^[a-z][a-z0-9-]\*$");
3204
- export const getFlowDefinitionResponseOneStepsItemFieldsDefault = [];
3205
- export const getFlowDefinitionResponseOneStepsItemActionsPrimaryDefault = false;
3206
- export const getFlowDefinitionResponseOneStepsItemActionsDefault = {} as const;
3207
- export const getFlowDefinitionResponseOneStepsItemGatesDefault = {} as const;
3208
- export const getFlowDefinitionResponseOneStepsItemSsoProvidersDefault = [];
3239
+ export const getFlowDefinitionQueryProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
3240
+
3241
+ export const GetFlowDefinitionQueryParams = zod.strictObject({
3242
+ project_id: zod
3243
+ .string()
3244
+ .regex(getFlowDefinitionQueryProjectIdRegExp)
3245
+ .describe("The project id to filter by."),
3246
+ });
3247
+
3248
+ export const getFlowDefinitionResponseFlowDefinitionNameRegExp = new RegExp("^[a-z][a-z0-9-]\*$");
3249
+ export const getFlowDefinitionResponseFlowDefinitionStepsItemFieldsDefault = [];
3250
+ export const getFlowDefinitionResponseFlowDefinitionStepsItemActionsPrimaryDefault = false;
3251
+ export const getFlowDefinitionResponseFlowDefinitionStepsItemActionsDefault = {} as const;
3252
+ export const getFlowDefinitionResponseFlowDefinitionStepsItemGatesDefault = {} as const;
3253
+ export const getFlowDefinitionResponseFlowDefinitionStepsItemSsoProvidersDefault = [];
3254
+
3255
+ export const GetFlowDefinitionResponse = zod.object({
3256
+ id: zod.string().describe("Unique identifier for the flow definition."),
3257
+ project_id: zod.string().describe("Identifier of the project this flow definition belongs to."),
3258
+ status: zod.string().describe("Status of the flow definition."),
3259
+ flow_definition: zod
3260
+ .object({
3261
+ name: zod
3262
+ .string()
3263
+ .regex(getFlowDefinitionResponseFlowDefinitionNameRegExp)
3264
+ .describe(
3265
+ "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
3266
+ ),
3267
+ user_schema: zod
3268
+ .url()
3269
+ .describe(
3270
+ "User schema this flow operates on. Step `fields` reference properties\ndefined in this schema. The engine resolves field types, validation,\nand implicit outcomes from schema annotations at runtime.\n",
3271
+ ),
3272
+ purposes: zod
3273
+ .record(zod.string(), zod.string())
3274
+ .describe(
3275
+ "Maps each purpose this definition handles to its entry-point step.\nKeys are purpose names; values must match a `name` in `steps`. A\ndefinition can serve multiple purposes (e.g. a combined login\/register\nflow) by listing one entry per purpose.\n",
3276
+ ),
3277
+ audience: zod
3278
+ .object({
3279
+ team_ids: zod
3280
+ .array(zod.string())
3281
+ .optional()
3282
+ .describe(
3283
+ "Restrict to specific teams (organizations). Empty means no team restriction.",
3284
+ ),
3285
+ app_ids: zod
3286
+ .array(zod.string())
3287
+ .optional()
3288
+ .describe("Restrict to specific applications. Empty means no app restriction."),
3289
+ })
3290
+ .optional()
3291
+ .describe(
3292
+ 'Scopes which teams or apps this flow definition applies to. Empty or\nomitted fields mean \"no restriction\"; when both are empty the definition\nmatches every request in the project. The engine picks the most specific\nmatching definition: app > team > project-wide.\n',
3293
+ ),
3294
+ steps: zod
3295
+ .array(
3296
+ zod
3297
+ .object({
3298
+ name: zod
3299
+ .string()
3300
+ .describe(
3301
+ "Unique step identifier within this flow. Used as transition targets\nand returned in the API response as `step.name`.\n",
3302
+ ),
3303
+ fields: zod
3304
+ .array(zod.string())
3305
+ .default(getFlowDefinitionResponseFlowDefinitionStepsItemFieldsDefault)
3306
+ .describe(
3307
+ "Schema property names to collect from the user. Each entry references\na property in the flow's user schema. The engine resolves field type,\nvalidation rules, and implicit outcomes from schema annotations\n(e.g. a property with `x-unique` set implies a `user_not_found`\ntransition outcome).\n",
3308
+ ),
3309
+ actions: zod
3310
+ .record(
3311
+ zod.string(),
3312
+ zod
3313
+ .object({
3314
+ primary: zod
3315
+ .boolean()
3316
+ .default(
3317
+ getFlowDefinitionResponseFlowDefinitionStepsItemActionsPrimaryDefault,
3318
+ )
3319
+ .describe(
3320
+ "Marks this as the default\/primary action. The runtime template uses\nthis hint to choose visual emphasis. At most one action per step\nshould be primary; this is not enforced here.\n",
3321
+ ),
3322
+ text_key: zod
3323
+ .string()
3324
+ .optional()
3325
+ .describe(
3326
+ "Optional localization key override for the action's label. When\nomitted, the engine derives a key from the step and action names.\nDisplay text is resolved client-side from a locale dictionary, never\nby the engine.\n",
3327
+ ),
3328
+ })
3329
+ .describe(
3330
+ "Configuration for a user-invokable action on a step. Keyed by action name\nin the parent dictionary. The action name is sent back in the submit\nrequest as `action`.\n",
3331
+ ),
3332
+ )
3333
+ .default(getFlowDefinitionResponseFlowDefinitionStepsItemActionsDefault)
3334
+ .describe(
3335
+ "Actions the user can take. Keyed by action name.\nThe action name is what the frontend sends back in the submit request.\nIf omitted, the engine provides a default `submit` action.\n",
3336
+ ),
3337
+ gates: zod
3338
+ .record(
3339
+ zod.string(),
3340
+ zod
3341
+ .object({
3342
+ kind: zod
3343
+ .enum(["captcha"])
3344
+ .describe(
3345
+ "The gate category. Only `captcha` is currently defined. Authenticator\nceremonies (e.g. passkey) are modelled as credential auth_attempts via\n`x-credential` on a field, not as gates.\n",
3346
+ ),
3347
+ provider: zod
3348
+ .string()
3349
+ .describe(
3350
+ "Provider identifier within the gate kind — e.g. `altcha`, `turnstile`,\n`hcaptcha`. The engine looks up an implementation in its provider\nregistry.\n",
3351
+ ),
3352
+ config: zod
3353
+ .record(zod.string(), zod.unknown())
3354
+ .optional()
3355
+ .describe(
3356
+ "Provider-specific configuration consumed by the implementation when\nissuing the per-render challenge. Opaque to the engine.\n",
3357
+ ),
3358
+ })
3359
+ .describe(
3360
+ "A security challenge that must be satisfied before this step's submission\nis accepted. The engine may also inject gates at runtime based on policy\nor risk evaluation.\n",
3361
+ ),
3362
+ )
3363
+ .default(getFlowDefinitionResponseFlowDefinitionStepsItemGatesDefault)
3364
+ .describe(
3365
+ 'Security gates that must be satisfied before submission. Keyed by gate\nname. Each gate selects a kind (e.g. \"captcha\") and provider-specific\nconfiguration. The engine may also inject gates dynamically based on\npolicy.\n',
3366
+ ),
3367
+ sso_providers: zod
3368
+ .array(
3369
+ zod
3370
+ .object({
3371
+ id: zod.string().describe("Provider instance identifier."),
3372
+ name: zod.string().describe("Display name for the provider."),
3373
+ template: zod
3374
+ .string()
3375
+ .describe("Template hint for rendering (logo, colors)."),
3376
+ })
3377
+ .describe("An available SSO identity provider."),
3378
+ )
3379
+ .default(getFlowDefinitionResponseFlowDefinitionStepsItemSsoProvidersDefault)
3380
+ .describe("Available SSO identity providers for this step."),
3381
+ on_success: zod
3382
+ .enum(["create_user"])
3383
+ .optional()
3384
+ .describe(
3385
+ "Server-side mutation to execute when this step completes successfully.\nRuns after field validation passes, before the transition fires.\n\n- create_user: creates the user record (registration flows)\n",
3386
+ ),
3387
+ complete: zod
3388
+ .enum(["redirect", "show"])
3389
+ .optional()
3390
+ .describe(
3391
+ "Marks this as a terminal step. Tells the frontend what to do:\n- redirect: navigate to redirect_uri (OIDC\/SAML callback done)\n- show: render as a success\/info screen\n",
3392
+ ),
3393
+ transitions: zod
3394
+ .record(
3395
+ zod.string(),
3396
+ zod.object({
3397
+ target: zod
3398
+ .string()
3399
+ .describe(
3400
+ "Step name within this flow (when `action` is null), or the name\nof another flow (when `action` is `switch` or `pivot`).\n",
3401
+ ),
3402
+ action: zod
3403
+ .union([zod.enum(["switch", "pivot"]), zod.null()])
3404
+ .optional()
3405
+ .describe(
3406
+ "How to interpret `target`:\n- null (omitted): transition to a step in the current flow.\n- switch: replace the current flow with the target flow.\n No return — the current flow is discarded.\n Example: login ↔ register.\n- pivot: push the target flow onto the stack. The current flow\n is paused and resumes when the target flow completes (auto-pop).\n Example: login → recovery → back to login.\n",
3407
+ ),
3408
+ }),
3409
+ )
3410
+ .optional()
3411
+ .describe(
3412
+ "Maps action\/outcome names to their transition descriptor.\n\nKeys match action names from the `actions` dict. Additional keys\ncome from implicit outcomes based on schema annotations\n(e.g. `user_not_found` from `x-unique` fields) and engine\nevents (e.g. `sso`, `callback`).\n",
3413
+ ),
3414
+ })
3415
+ .describe(
3416
+ "A step in a flow definition. This is the admin-authored configuration,\nnot the runtime payload sent to the frontend.\n\nSteps are schema-driven: `fields` references properties from the flow's\nuser schema, and the engine resolves field metadata (type, validation,\nimplicit outcomes) from schema annotations at runtime.\n\nA step with only `complete` set is a terminal step. All other steps are\nrendered to the frontend as capability payloads.\n",
3417
+ ),
3418
+ )
3419
+ .min(1)
3420
+ .describe(
3421
+ "Ordered list of steps in this flow. The order is for human readability —\nactual step sequencing is determined by transitions.\n",
3422
+ ),
3423
+ })
3424
+ .describe(
3425
+ "A flow definition is the server-side configuration that describes a complete\nauthentication or identity flow. It is NOT sent to the frontend — the flow\nengine evaluates it and produces FlowResponse payloads (steps with capability\ndictionaries) for the client.\n\nFlow definitions are created by administrators and stored in the project\/team\nconfiguration hierarchy. The engine selects the matching definition based on\nthe purpose + audience when a flow is created via POST \/flow.\n",
3426
+ ),
3427
+ created_at: zod.iso.datetime({ offset: true }),
3428
+ updated_at: zod.iso.datetime({ offset: true }),
3429
+ });
3430
+
3431
+ /**
3432
+ * Update a flow definition by id
3433
+ * @summary Update a flow definition by id
3434
+ */
3435
+ export const UpdateFlowDefinitionParams = zod.object({
3436
+ id: zod.string().describe("The id returned by the POST \/flow_definitions endpoint.\n"),
3437
+ });
3438
+
3439
+ export const updateFlowDefinitionQueryProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
3440
+
3441
+ export const UpdateFlowDefinitionQueryParams = zod.strictObject({
3442
+ project_id: zod
3443
+ .string()
3444
+ .regex(updateFlowDefinitionQueryProjectIdRegExp)
3445
+ .describe("The project id to filter by."),
3446
+ });
3447
+
3448
+ export const updateFlowDefinitionBodyStepsItemFieldsDefault = [];
3449
+ export const updateFlowDefinitionBodyStepsItemActionsPrimaryDefault = false;
3450
+ export const updateFlowDefinitionBodyStepsItemActionsDefault = {} as const;
3451
+ export const updateFlowDefinitionBodyStepsItemGatesDefault = {} as const;
3452
+ export const updateFlowDefinitionBodyStepsItemSsoProvidersDefault = [];
3209
3453
 
3210
- export const GetFlowDefinitionResponse = zod
3454
+ export const UpdateFlowDefinitionBody = zod
3211
3455
  .object({
3212
- name: zod
3213
- .string()
3214
- .regex(getFlowDefinitionResponseOneNameRegExp)
3215
- .describe(
3216
- "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
3217
- ),
3218
3456
  user_schema: zod
3219
3457
  .url()
3220
- .describe(
3221
- "User schema this flow operates on. Step `fields` reference properties\ndefined in this schema. The engine resolves field types, validation,\nand implicit outcomes from schema annotations at runtime.\n",
3222
- ),
3458
+ .optional()
3459
+ .describe("User schema this flow operates on. Replaces the current value if provided.\n"),
3223
3460
  purposes: zod
3224
3461
  .record(zod.string(), zod.string())
3462
+ .optional()
3225
3463
  .describe(
3226
- "Maps each purpose this definition handles to its entry-point step.\nKeys are purpose names; values must match a `name` in `steps`. A\ndefinition can serve multiple purposes (e.g. a combined login\/register\nflow) by listing one entry per purpose.\n",
3464
+ "Replaces the full purpose-to-entry-step map if provided. Keys are\npurpose names; values must match a `name` in `steps`.\n",
3227
3465
  ),
3228
3466
  audience: zod
3229
3467
  .object({
@@ -3251,7 +3489,7 @@ export const GetFlowDefinitionResponse = zod
3251
3489
  ),
3252
3490
  fields: zod
3253
3491
  .array(zod.string())
3254
- .default(getFlowDefinitionResponseOneStepsItemFieldsDefault)
3492
+ .default(updateFlowDefinitionBodyStepsItemFieldsDefault)
3255
3493
  .describe(
3256
3494
  "Schema property names to collect from the user. Each entry references\na property in the flow's user schema. The engine resolves field type,\nvalidation rules, and implicit outcomes from schema annotations\n(e.g. a property with `x-unique` set implies a `user_not_found`\ntransition outcome).\n",
3257
3495
  ),
@@ -3262,7 +3500,7 @@ export const GetFlowDefinitionResponse = zod
3262
3500
  .object({
3263
3501
  primary: zod
3264
3502
  .boolean()
3265
- .default(getFlowDefinitionResponseOneStepsItemActionsPrimaryDefault)
3503
+ .default(updateFlowDefinitionBodyStepsItemActionsPrimaryDefault)
3266
3504
  .describe(
3267
3505
  "Marks this as the default\/primary action. The runtime template uses\nthis hint to choose visual emphasis. At most one action per step\nshould be primary; this is not enforced here.\n",
3268
3506
  ),
@@ -3277,7 +3515,7 @@ export const GetFlowDefinitionResponse = zod
3277
3515
  "Configuration for a user-invokable action on a step. Keyed by action name\nin the parent dictionary. The action name is sent back in the submit\nrequest as `action`.\n",
3278
3516
  ),
3279
3517
  )
3280
- .default(getFlowDefinitionResponseOneStepsItemActionsDefault)
3518
+ .default(updateFlowDefinitionBodyStepsItemActionsDefault)
3281
3519
  .describe(
3282
3520
  "Actions the user can take. Keyed by action name.\nThe action name is what the frontend sends back in the submit request.\nIf omitted, the engine provides a default `submit` action.\n",
3283
3521
  ),
@@ -3307,7 +3545,7 @@ export const GetFlowDefinitionResponse = zod
3307
3545
  "A security challenge that must be satisfied before this step's submission\nis accepted. The engine may also inject gates at runtime based on policy\nor risk evaluation.\n",
3308
3546
  ),
3309
3547
  )
3310
- .default(getFlowDefinitionResponseOneStepsItemGatesDefault)
3548
+ .default(updateFlowDefinitionBodyStepsItemGatesDefault)
3311
3549
  .describe(
3312
3550
  'Security gates that must be satisfied before submission. Keyed by gate\nname. Each gate selects a kind (e.g. \"captcha\") and provider-specific\nconfiguration. The engine may also inject gates dynamically based on\npolicy.\n',
3313
3551
  ),
@@ -3321,7 +3559,7 @@ export const GetFlowDefinitionResponse = zod
3321
3559
  })
3322
3560
  .describe("An available SSO identity provider."),
3323
3561
  )
3324
- .default(getFlowDefinitionResponseOneStepsItemSsoProvidersDefault)
3562
+ .default(updateFlowDefinitionBodyStepsItemSsoProvidersDefault)
3325
3563
  .describe("Available SSO identity providers for this step."),
3326
3564
  on_success: zod
3327
3565
  .enum(["create_user"])
@@ -3362,387 +3600,199 @@ export const GetFlowDefinitionResponse = zod
3362
3600
  ),
3363
3601
  )
3364
3602
  .min(1)
3603
+ .optional()
3365
3604
  .describe(
3366
- "Ordered list of steps in this flow. The order is for human readability —\nactual step sequencing is determined by transitions.\n",
3605
+ "Replaces the full steps array if provided. Partial step lists are not\nsupported supply all steps when updating this field.\n",
3367
3606
  ),
3368
3607
  })
3369
3608
  .describe(
3370
- "A flow definition is the server-side configuration that describes a complete\nauthentication or identity flow. It is NOT sent to the frontend the flow\nengine evaluates it and produces FlowResponse payloads (steps with capability\ndictionaries) for the client.\n\nFlow definitions are created by administrators and stored in the project\/team\nconfiguration hierarchy. The engine selects the matching definition based on\nthe purpose + audience when a flow is created via POST \/flow.\n",
3371
- )
3372
- .and(
3373
- zod.object({
3374
- id: zod.string().describe("Unique identifier for the flow definition."),
3375
- project_id: zod
3609
+ "Partial update for a flow definition. Only provided fields are replaced;\nomitted fields retain their current server-side values.\n\nCollection fields (`steps`, `purposes`) are treated atomically: if\nprovided, the entire array\/object is replaced. If omitted, the current\nvalue is preserved unchanged.\n\n`name` is a stable identifier and cannot be changed after creation.\n",
3610
+ );
3611
+
3612
+ export const updateFlowDefinitionResponseFlowDefinitionNameRegExp = new RegExp(
3613
+ "^[a-z][a-z0-9-]\*$",
3614
+ );
3615
+ export const updateFlowDefinitionResponseFlowDefinitionStepsItemFieldsDefault = [];
3616
+ export const updateFlowDefinitionResponseFlowDefinitionStepsItemActionsPrimaryDefault = false;
3617
+ export const updateFlowDefinitionResponseFlowDefinitionStepsItemActionsDefault = {} as const;
3618
+ export const updateFlowDefinitionResponseFlowDefinitionStepsItemGatesDefault = {} as const;
3619
+ export const updateFlowDefinitionResponseFlowDefinitionStepsItemSsoProvidersDefault = [];
3620
+
3621
+ export const UpdateFlowDefinitionResponse = zod.object({
3622
+ id: zod.string().describe("Unique identifier for the flow definition."),
3623
+ project_id: zod.string().describe("Identifier of the project this flow definition belongs to."),
3624
+ status: zod.string().describe("Status of the flow definition."),
3625
+ flow_definition: zod
3626
+ .object({
3627
+ name: zod
3376
3628
  .string()
3377
- .describe("Identifier of the project this flow definition belongs to."),
3378
- schema_uri: zod
3629
+ .regex(updateFlowDefinitionResponseFlowDefinitionNameRegExp)
3630
+ .describe(
3631
+ "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
3632
+ ),
3633
+ user_schema: zod
3379
3634
  .url()
3380
3635
  .describe(
3381
- "URI of the flow definition schema this definition was authored against.\nIf the schema_uri was not provided in the request, the flow definition is validated against the latest version of the schema, and the response includes the schema_uri of the latest version.\n",
3636
+ "User schema this flow operates on. Step `fields` reference properties\ndefined in this schema. The engine resolves field types, validation,\nand implicit outcomes from schema annotations at runtime.\n",
3382
3637
  ),
3383
- status: zod.string().describe("Status of the flow definition."),
3384
- created_at: zod.iso.datetime({ offset: true }),
3385
- updated_at: zod.iso.datetime({ offset: true }),
3386
- }),
3387
- );
3388
-
3389
- /**
3390
- * Update a flow definition by id
3391
- * @summary Update a flow definition by id
3392
- */
3393
- export const UpdateFlowDefinitionParams = zod.object({
3394
- id: zod.string().describe("The id returned by the POST \/flow_definitions endpoint.\n"),
3395
- });
3396
-
3397
- export const updateFlowDefinitionBodyStepsItemFieldsDefault = [];
3398
- export const updateFlowDefinitionBodyStepsItemActionsPrimaryDefault = false;
3399
- export const updateFlowDefinitionBodyStepsItemActionsDefault = {} as const;
3400
- export const updateFlowDefinitionBodyStepsItemGatesDefault = {} as const;
3401
- export const updateFlowDefinitionBodyStepsItemSsoProvidersDefault = [];
3402
-
3403
- export const UpdateFlowDefinitionBody = zod
3404
- .object({
3405
- user_schema: zod
3406
- .url()
3407
- .optional()
3408
- .describe("User schema this flow operates on. Replaces the current value if provided.\n"),
3409
- purposes: zod
3410
- .record(zod.string(), zod.string())
3411
- .optional()
3412
- .describe(
3413
- "Replaces the full purpose-to-entry-step map if provided. Keys are\npurpose names; values must match a `name` in `steps`.\n",
3414
- ),
3415
- audience: zod
3416
- .object({
3417
- team_ids: zod
3418
- .array(zod.string())
3419
- .optional()
3420
- .describe("Restrict to specific teams (organizations). Empty means no team restriction."),
3421
- app_ids: zod
3422
- .array(zod.string())
3423
- .optional()
3424
- .describe("Restrict to specific applications. Empty means no app restriction."),
3425
- })
3426
- .optional()
3427
- .describe(
3428
- 'Scopes which teams or apps this flow definition applies to. Empty or\nomitted fields mean \"no restriction\"; when both are empty the definition\nmatches every request in the project. The engine picks the most specific\nmatching definition: app > team > project-wide.\n',
3429
- ),
3430
- steps: zod
3431
- .array(
3432
- zod
3433
- .object({
3434
- name: zod
3435
- .string()
3436
- .describe(
3437
- "Unique step identifier within this flow. Used as transition targets\nand returned in the API response as `step.name`.\n",
3438
- ),
3439
- fields: zod
3440
- .array(zod.string())
3441
- .default(updateFlowDefinitionBodyStepsItemFieldsDefault)
3442
- .describe(
3443
- "Schema property names to collect from the user. Each entry references\na property in the flow's user schema. The engine resolves field type,\nvalidation rules, and implicit outcomes from schema annotations\n(e.g. a property with `x-unique` set implies a `user_not_found`\ntransition outcome).\n",
3444
- ),
3445
- actions: zod
3446
- .record(
3447
- zod.string(),
3448
- zod
3449
- .object({
3450
- primary: zod
3451
- .boolean()
3452
- .default(updateFlowDefinitionBodyStepsItemActionsPrimaryDefault)
3453
- .describe(
3454
- "Marks this as the default\/primary action. The runtime template uses\nthis hint to choose visual emphasis. At most one action per step\nshould be primary; this is not enforced here.\n",
3455
- ),
3456
- text_key: zod
3457
- .string()
3458
- .optional()
3459
- .describe(
3460
- "Optional localization key override for the action's label. When\nomitted, the engine derives a key from the step and action names.\nDisplay text is resolved client-side from a locale dictionary, never\nby the engine.\n",
3461
- ),
3462
- })
3463
- .describe(
3464
- "Configuration for a user-invokable action on a step. Keyed by action name\nin the parent dictionary. The action name is sent back in the submit\nrequest as `action`.\n",
3465
- ),
3466
- )
3467
- .default(updateFlowDefinitionBodyStepsItemActionsDefault)
3468
- .describe(
3469
- "Actions the user can take. Keyed by action name.\nThe action name is what the frontend sends back in the submit request.\nIf omitted, the engine provides a default `submit` action.\n",
3470
- ),
3471
- gates: zod
3472
- .record(
3473
- zod.string(),
3474
- zod
3475
- .object({
3476
- kind: zod
3477
- .enum(["captcha"])
3478
- .describe(
3479
- "The gate category. Only `captcha` is currently defined. Authenticator\nceremonies (e.g. passkey) are modelled as credential auth_attempts via\n`x-credential` on a field, not as gates.\n",
3480
- ),
3481
- provider: zod
3482
- .string()
3483
- .describe(
3484
- "Provider identifier within the gate kind — e.g. `altcha`, `turnstile`,\n`hcaptcha`. The engine looks up an implementation in its provider\nregistry.\n",
3485
- ),
3486
- config: zod
3487
- .record(zod.string(), zod.unknown())
3488
- .optional()
3489
- .describe(
3490
- "Provider-specific configuration consumed by the implementation when\nissuing the per-render challenge. Opaque to the engine.\n",
3491
- ),
3492
- })
3493
- .describe(
3494
- "A security challenge that must be satisfied before this step's submission\nis accepted. The engine may also inject gates at runtime based on policy\nor risk evaluation.\n",
3495
- ),
3496
- )
3497
- .default(updateFlowDefinitionBodyStepsItemGatesDefault)
3498
- .describe(
3499
- 'Security gates that must be satisfied before submission. Keyed by gate\nname. Each gate selects a kind (e.g. \"captcha\") and provider-specific\nconfiguration. The engine may also inject gates dynamically based on\npolicy.\n',
3500
- ),
3501
- sso_providers: zod
3502
- .array(
3503
- zod
3504
- .object({
3505
- id: zod.string().describe("Provider instance identifier."),
3506
- name: zod.string().describe("Display name for the provider."),
3507
- template: zod.string().describe("Template hint for rendering (logo, colors)."),
3508
- })
3509
- .describe("An available SSO identity provider."),
3510
- )
3511
- .default(updateFlowDefinitionBodyStepsItemSsoProvidersDefault)
3512
- .describe("Available SSO identity providers for this step."),
3513
- on_success: zod
3514
- .enum(["create_user"])
3515
- .optional()
3516
- .describe(
3517
- "Server-side mutation to execute when this step completes successfully.\nRuns after field validation passes, before the transition fires.\n\n- create_user: creates the user record (registration flows)\n",
3518
- ),
3519
- complete: zod
3520
- .enum(["redirect", "show"])
3521
- .optional()
3522
- .describe(
3523
- "Marks this as a terminal step. Tells the frontend what to do:\n- redirect: navigate to redirect_uri (OIDC\/SAML callback done)\n- show: render as a success\/info screen\n",
3524
- ),
3525
- transitions: zod
3526
- .record(
3527
- zod.string(),
3528
- zod.object({
3529
- target: zod
3530
- .string()
3638
+ purposes: zod
3639
+ .record(zod.string(), zod.string())
3640
+ .describe(
3641
+ "Maps each purpose this definition handles to its entry-point step.\nKeys are purpose names; values must match a `name` in `steps`. A\ndefinition can serve multiple purposes (e.g. a combined login\/register\nflow) by listing one entry per purpose.\n",
3642
+ ),
3643
+ audience: zod
3644
+ .object({
3645
+ team_ids: zod
3646
+ .array(zod.string())
3647
+ .optional()
3648
+ .describe(
3649
+ "Restrict to specific teams (organizations). Empty means no team restriction.",
3650
+ ),
3651
+ app_ids: zod
3652
+ .array(zod.string())
3653
+ .optional()
3654
+ .describe("Restrict to specific applications. Empty means no app restriction."),
3655
+ })
3656
+ .optional()
3657
+ .describe(
3658
+ 'Scopes which teams or apps this flow definition applies to. Empty or\nomitted fields mean \"no restriction\"; when both are empty the definition\nmatches every request in the project. The engine picks the most specific\nmatching definition: app > team > project-wide.\n',
3659
+ ),
3660
+ steps: zod
3661
+ .array(
3662
+ zod
3663
+ .object({
3664
+ name: zod
3665
+ .string()
3666
+ .describe(
3667
+ "Unique step identifier within this flow. Used as transition targets\nand returned in the API response as `step.name`.\n",
3668
+ ),
3669
+ fields: zod
3670
+ .array(zod.string())
3671
+ .default(updateFlowDefinitionResponseFlowDefinitionStepsItemFieldsDefault)
3672
+ .describe(
3673
+ "Schema property names to collect from the user. Each entry references\na property in the flow's user schema. The engine resolves field type,\nvalidation rules, and implicit outcomes from schema annotations\n(e.g. a property with `x-unique` set implies a `user_not_found`\ntransition outcome).\n",
3674
+ ),
3675
+ actions: zod
3676
+ .record(
3677
+ zod.string(),
3678
+ zod
3679
+ .object({
3680
+ primary: zod
3681
+ .boolean()
3682
+ .default(
3683
+ updateFlowDefinitionResponseFlowDefinitionStepsItemActionsPrimaryDefault,
3684
+ )
3685
+ .describe(
3686
+ "Marks this as the default\/primary action. The runtime template uses\nthis hint to choose visual emphasis. At most one action per step\nshould be primary; this is not enforced here.\n",
3687
+ ),
3688
+ text_key: zod
3689
+ .string()
3690
+ .optional()
3691
+ .describe(
3692
+ "Optional localization key override for the action's label. When\nomitted, the engine derives a key from the step and action names.\nDisplay text is resolved client-side from a locale dictionary, never\nby the engine.\n",
3693
+ ),
3694
+ })
3531
3695
  .describe(
3532
- "Step name within this flow (when `action` is null), or the name\nof another flow (when `action` is `switch` or `pivot`).\n",
3696
+ "Configuration for a user-invokable action on a step. Keyed by action name\nin the parent dictionary. The action name is sent back in the submit\nrequest as `action`.\n",
3533
3697
  ),
3534
- action: zod
3535
- .union([zod.enum(["switch", "pivot"]), zod.null()])
3536
- .optional()
3698
+ )
3699
+ .default(updateFlowDefinitionResponseFlowDefinitionStepsItemActionsDefault)
3700
+ .describe(
3701
+ "Actions the user can take. Keyed by action name.\nThe action name is what the frontend sends back in the submit request.\nIf omitted, the engine provides a default `submit` action.\n",
3702
+ ),
3703
+ gates: zod
3704
+ .record(
3705
+ zod.string(),
3706
+ zod
3707
+ .object({
3708
+ kind: zod
3709
+ .enum(["captcha"])
3710
+ .describe(
3711
+ "The gate category. Only `captcha` is currently defined. Authenticator\nceremonies (e.g. passkey) are modelled as credential auth_attempts via\n`x-credential` on a field, not as gates.\n",
3712
+ ),
3713
+ provider: zod
3714
+ .string()
3715
+ .describe(
3716
+ "Provider identifier within the gate kind — e.g. `altcha`, `turnstile`,\n`hcaptcha`. The engine looks up an implementation in its provider\nregistry.\n",
3717
+ ),
3718
+ config: zod
3719
+ .record(zod.string(), zod.unknown())
3720
+ .optional()
3721
+ .describe(
3722
+ "Provider-specific configuration consumed by the implementation when\nissuing the per-render challenge. Opaque to the engine.\n",
3723
+ ),
3724
+ })
3537
3725
  .describe(
3538
- "How to interpret `target`:\n- null (omitted): transition to a step in the current flow.\n- switch: replace the current flow with the target flow.\n No return — the current flow is discarded.\n Example: login ↔ register.\n- pivot: push the target flow onto the stack. The current flow\n is paused and resumes when the target flow completes (auto-pop).\n Example: login → recovery → back to login.\n",
3726
+ "A security challenge that must be satisfied before this step's submission\nis accepted. The engine may also inject gates at runtime based on policy\nor risk evaluation.\n",
3539
3727
  ),
3540
- }),
3541
- )
3542
- .optional()
3543
- .describe(
3544
- "Maps action\/outcome names to their transition descriptor.\n\nKeys match action names from the `actions` dict. Additional keys\ncome from implicit outcomes based on schema annotations\n(e.g. `user_not_found` from `x-unique` fields) and engine\nevents (e.g. `sso`, `callback`).\n",
3545
- ),
3546
- })
3547
- .describe(
3548
- "A step in a flow definition. This is the admin-authored configuration,\nnot the runtime payload sent to the frontend.\n\nSteps are schema-driven: `fields` references properties from the flow's\nuser schema, and the engine resolves field metadata (type, validation,\nimplicit outcomes) from schema annotations at runtime.\n\nA step with only `complete` set is a terminal step. All other steps are\nrendered to the frontend as capability payloads.\n",
3549
- ),
3550
- )
3551
- .min(1)
3552
- .optional()
3553
- .describe(
3554
- "Replaces the full steps array if provided. Partial step lists are not\nsupported — supply all steps when updating this field.\n",
3555
- ),
3556
- })
3557
- .describe(
3558
- "Partial update for a flow definition. Only provided fields are replaced;\nomitted fields retain their current server-side values.\n\nCollection fields (`steps`, `purposes`) are treated atomically: if\nprovided, the entire array\/object is replaced. If omitted, the current\nvalue is preserved unchanged.\n\n`name` is a stable identifier and cannot be changed after creation.\n",
3559
- );
3560
-
3561
- export const updateFlowDefinitionResponseOneNameRegExp = new RegExp("^[a-z][a-z0-9-]\*$");
3562
- export const updateFlowDefinitionResponseOneStepsItemFieldsDefault = [];
3563
- export const updateFlowDefinitionResponseOneStepsItemActionsPrimaryDefault = false;
3564
- export const updateFlowDefinitionResponseOneStepsItemActionsDefault = {} as const;
3565
- export const updateFlowDefinitionResponseOneStepsItemGatesDefault = {} as const;
3566
- export const updateFlowDefinitionResponseOneStepsItemSsoProvidersDefault = [];
3567
-
3568
- export const UpdateFlowDefinitionResponse = zod
3569
- .object({
3570
- name: zod
3571
- .string()
3572
- .regex(updateFlowDefinitionResponseOneNameRegExp)
3573
- .describe(
3574
- "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
3575
- ),
3576
- user_schema: zod
3577
- .url()
3578
- .describe(
3579
- "User schema this flow operates on. Step `fields` reference properties\ndefined in this schema. The engine resolves field types, validation,\nand implicit outcomes from schema annotations at runtime.\n",
3580
- ),
3581
- purposes: zod
3582
- .record(zod.string(), zod.string())
3583
- .describe(
3584
- "Maps each purpose this definition handles to its entry-point step.\nKeys are purpose names; values must match a `name` in `steps`. A\ndefinition can serve multiple purposes (e.g. a combined login\/register\nflow) by listing one entry per purpose.\n",
3585
- ),
3586
- audience: zod
3587
- .object({
3588
- team_ids: zod
3589
- .array(zod.string())
3590
- .optional()
3591
- .describe("Restrict to specific teams (organizations). Empty means no team restriction."),
3592
- app_ids: zod
3593
- .array(zod.string())
3594
- .optional()
3595
- .describe("Restrict to specific applications. Empty means no app restriction."),
3596
- })
3597
- .optional()
3598
- .describe(
3599
- 'Scopes which teams or apps this flow definition applies to. Empty or\nomitted fields mean \"no restriction\"; when both are empty the definition\nmatches every request in the project. The engine picks the most specific\nmatching definition: app > team > project-wide.\n',
3600
- ),
3601
- steps: zod
3602
- .array(
3603
- zod
3604
- .object({
3605
- name: zod
3606
- .string()
3607
- .describe(
3608
- "Unique step identifier within this flow. Used as transition targets\nand returned in the API response as `step.name`.\n",
3609
- ),
3610
- fields: zod
3611
- .array(zod.string())
3612
- .default(updateFlowDefinitionResponseOneStepsItemFieldsDefault)
3613
- .describe(
3614
- "Schema property names to collect from the user. Each entry references\na property in the flow's user schema. The engine resolves field type,\nvalidation rules, and implicit outcomes from schema annotations\n(e.g. a property with `x-unique` set implies a `user_not_found`\ntransition outcome).\n",
3615
- ),
3616
- actions: zod
3617
- .record(
3618
- zod.string(),
3619
- zod
3620
- .object({
3621
- primary: zod
3622
- .boolean()
3623
- .default(updateFlowDefinitionResponseOneStepsItemActionsPrimaryDefault)
3624
- .describe(
3625
- "Marks this as the default\/primary action. The runtime template uses\nthis hint to choose visual emphasis. At most one action per step\nshould be primary; this is not enforced here.\n",
3626
- ),
3627
- text_key: zod
3628
- .string()
3629
- .optional()
3630
- .describe(
3631
- "Optional localization key override for the action's label. When\nomitted, the engine derives a key from the step and action names.\nDisplay text is resolved client-side from a locale dictionary, never\nby the engine.\n",
3632
- ),
3633
- })
3634
- .describe(
3635
- "Configuration for a user-invokable action on a step. Keyed by action name\nin the parent dictionary. The action name is sent back in the submit\nrequest as `action`.\n",
3636
- ),
3637
- )
3638
- .default(updateFlowDefinitionResponseOneStepsItemActionsDefault)
3639
- .describe(
3640
- "Actions the user can take. Keyed by action name.\nThe action name is what the frontend sends back in the submit request.\nIf omitted, the engine provides a default `submit` action.\n",
3641
- ),
3642
- gates: zod
3643
- .record(
3644
- zod.string(),
3645
- zod
3646
- .object({
3647
- kind: zod
3648
- .enum(["captcha"])
3649
- .describe(
3650
- "The gate category. Only `captcha` is currently defined. Authenticator\nceremonies (e.g. passkey) are modelled as credential auth_attempts via\n`x-credential` on a field, not as gates.\n",
3651
- ),
3652
- provider: zod
3728
+ )
3729
+ .default(updateFlowDefinitionResponseFlowDefinitionStepsItemGatesDefault)
3730
+ .describe(
3731
+ 'Security gates that must be satisfied before submission. Keyed by gate\nname. Each gate selects a kind (e.g. \"captcha\") and provider-specific\nconfiguration. The engine may also inject gates dynamically based on\npolicy.\n',
3732
+ ),
3733
+ sso_providers: zod
3734
+ .array(
3735
+ zod
3736
+ .object({
3737
+ id: zod.string().describe("Provider instance identifier."),
3738
+ name: zod.string().describe("Display name for the provider."),
3739
+ template: zod
3740
+ .string()
3741
+ .describe("Template hint for rendering (logo, colors)."),
3742
+ })
3743
+ .describe("An available SSO identity provider."),
3744
+ )
3745
+ .default(updateFlowDefinitionResponseFlowDefinitionStepsItemSsoProvidersDefault)
3746
+ .describe("Available SSO identity providers for this step."),
3747
+ on_success: zod
3748
+ .enum(["create_user"])
3749
+ .optional()
3750
+ .describe(
3751
+ "Server-side mutation to execute when this step completes successfully.\nRuns after field validation passes, before the transition fires.\n\n- create_user: creates the user record (registration flows)\n",
3752
+ ),
3753
+ complete: zod
3754
+ .enum(["redirect", "show"])
3755
+ .optional()
3756
+ .describe(
3757
+ "Marks this as a terminal step. Tells the frontend what to do:\n- redirect: navigate to redirect_uri (OIDC\/SAML callback done)\n- show: render as a success\/info screen\n",
3758
+ ),
3759
+ transitions: zod
3760
+ .record(
3761
+ zod.string(),
3762
+ zod.object({
3763
+ target: zod
3653
3764
  .string()
3654
3765
  .describe(
3655
- "Provider identifier within the gate kind e.g. `altcha`, `turnstile`,\n`hcaptcha`. The engine looks up an implementation in its provider\nregistry.\n",
3766
+ "Step name within this flow (when `action` is null), or the name\nof another flow (when `action` is `switch` or `pivot`).\n",
3656
3767
  ),
3657
- config: zod
3658
- .record(zod.string(), zod.unknown())
3768
+ action: zod
3769
+ .union([zod.enum(["switch", "pivot"]), zod.null()])
3659
3770
  .optional()
3660
3771
  .describe(
3661
- "Provider-specific configuration consumed by the implementation when\nissuing the per-render challenge. Opaque to the engine.\n",
3772
+ "How to interpret `target`:\n- null (omitted): transition to a step in the current flow.\n- switch: replace the current flow with the target flow.\n No return — the current flow is discarded.\n Example: login ↔ register.\n- pivot: push the target flow onto the stack. The current flow\n is paused and resumes when the target flow completes (auto-pop).\n Example: login → recovery → back to login.\n",
3662
3773
  ),
3663
- })
3664
- .describe(
3665
- "A security challenge that must be satisfied before this step's submission\nis accepted. The engine may also inject gates at runtime based on policy\nor risk evaluation.\n",
3666
- ),
3667
- )
3668
- .default(updateFlowDefinitionResponseOneStepsItemGatesDefault)
3669
- .describe(
3670
- 'Security gates that must be satisfied before submission. Keyed by gate\nname. Each gate selects a kind (e.g. \"captcha\") and provider-specific\nconfiguration. The engine may also inject gates dynamically based on\npolicy.\n',
3671
- ),
3672
- sso_providers: zod
3673
- .array(
3674
- zod
3675
- .object({
3676
- id: zod.string().describe("Provider instance identifier."),
3677
- name: zod.string().describe("Display name for the provider."),
3678
- template: zod.string().describe("Template hint for rendering (logo, colors)."),
3679
- })
3680
- .describe("An available SSO identity provider."),
3681
- )
3682
- .default(updateFlowDefinitionResponseOneStepsItemSsoProvidersDefault)
3683
- .describe("Available SSO identity providers for this step."),
3684
- on_success: zod
3685
- .enum(["create_user"])
3686
- .optional()
3687
- .describe(
3688
- "Server-side mutation to execute when this step completes successfully.\nRuns after field validation passes, before the transition fires.\n\n- create_user: creates the user record (registration flows)\n",
3689
- ),
3690
- complete: zod
3691
- .enum(["redirect", "show"])
3692
- .optional()
3693
- .describe(
3694
- "Marks this as a terminal step. Tells the frontend what to do:\n- redirect: navigate to redirect_uri (OIDC\/SAML callback done)\n- show: render as a success\/info screen\n",
3695
- ),
3696
- transitions: zod
3697
- .record(
3698
- zod.string(),
3699
- zod.object({
3700
- target: zod
3701
- .string()
3702
- .describe(
3703
- "Step name within this flow (when `action` is null), or the name\nof another flow (when `action` is `switch` or `pivot`).\n",
3704
- ),
3705
- action: zod
3706
- .union([zod.enum(["switch", "pivot"]), zod.null()])
3707
- .optional()
3708
- .describe(
3709
- "How to interpret `target`:\n- null (omitted): transition to a step in the current flow.\n- switch: replace the current flow with the target flow.\n No return — the current flow is discarded.\n Example: login ↔ register.\n- pivot: push the target flow onto the stack. The current flow\n is paused and resumes when the target flow completes (auto-pop).\n Example: login → recovery → back to login.\n",
3710
- ),
3711
- }),
3712
- )
3713
- .optional()
3714
- .describe(
3715
- "Maps action\/outcome names to their transition descriptor.\n\nKeys match action names from the `actions` dict. Additional keys\ncome from implicit outcomes based on schema annotations\n(e.g. `user_not_found` from `x-unique` fields) and engine\nevents (e.g. `sso`, `callback`).\n",
3716
- ),
3717
- })
3718
- .describe(
3719
- "A step in a flow definition. This is the admin-authored configuration,\nnot the runtime payload sent to the frontend.\n\nSteps are schema-driven: `fields` references properties from the flow's\nuser schema, and the engine resolves field metadata (type, validation,\nimplicit outcomes) from schema annotations at runtime.\n\nA step with only `complete` set is a terminal step. All other steps are\nrendered to the frontend as capability payloads.\n",
3720
- ),
3721
- )
3722
- .min(1)
3723
- .describe(
3724
- "Ordered list of steps in this flow. The order is for human readability —\nactual step sequencing is determined by transitions.\n",
3725
- ),
3726
- })
3727
- .describe(
3728
- "A flow definition is the server-side configuration that describes a complete\nauthentication or identity flow. It is NOT sent to the frontend — the flow\nengine evaluates it and produces FlowResponse payloads (steps with capability\ndictionaries) for the client.\n\nFlow definitions are created by administrators and stored in the project\/team\nconfiguration hierarchy. The engine selects the matching definition based on\nthe purpose + audience when a flow is created via POST \/flow.\n",
3729
- )
3730
- .and(
3731
- zod.object({
3732
- id: zod.string().describe("Unique identifier for the flow definition."),
3733
- project_id: zod
3734
- .string()
3735
- .describe("Identifier of the project this flow definition belongs to."),
3736
- schema_uri: zod
3737
- .url()
3774
+ }),
3775
+ )
3776
+ .optional()
3777
+ .describe(
3778
+ "Maps action\/outcome names to their transition descriptor.\n\nKeys match action names from the `actions` dict. Additional keys\ncome from implicit outcomes based on schema annotations\n(e.g. `user_not_found` from `x-unique` fields) and engine\nevents (e.g. `sso`, `callback`).\n",
3779
+ ),
3780
+ })
3781
+ .describe(
3782
+ "A step in a flow definition. This is the admin-authored configuration,\nnot the runtime payload sent to the frontend.\n\nSteps are schema-driven: `fields` references properties from the flow's\nuser schema, and the engine resolves field metadata (type, validation,\nimplicit outcomes) from schema annotations at runtime.\n\nA step with only `complete` set is a terminal step. All other steps are\nrendered to the frontend as capability payloads.\n",
3783
+ ),
3784
+ )
3785
+ .min(1)
3738
3786
  .describe(
3739
- "URI of the flow definition schema this definition was authored against.\nIf the schema_uri was not provided in the request, the flow definition is validated against the latest version of the schema, and the response includes the schema_uri of the latest version.\n",
3787
+ "Ordered list of steps in this flow. The order is for human readability —\nactual step sequencing is determined by transitions.\n",
3740
3788
  ),
3741
- status: zod.string().describe("Status of the flow definition."),
3742
- created_at: zod.iso.datetime({ offset: true }),
3743
- updated_at: zod.iso.datetime({ offset: true }),
3744
- }),
3745
- );
3789
+ })
3790
+ .describe(
3791
+ "A flow definition is the server-side configuration that describes a complete\nauthentication or identity flow. It is NOT sent to the frontend — the flow\nengine evaluates it and produces FlowResponse payloads (steps with capability\ndictionaries) for the client.\n\nFlow definitions are created by administrators and stored in the project\/team\nconfiguration hierarchy. The engine selects the matching definition based on\nthe purpose + audience when a flow is created via POST \/flow.\n",
3792
+ ),
3793
+ created_at: zod.iso.datetime({ offset: true }),
3794
+ updated_at: zod.iso.datetime({ offset: true }),
3795
+ });
3746
3796
 
3747
3797
  /**
3748
3798
  * Delete a flow definition by id
@@ -3752,6 +3802,15 @@ export const DeleteFlowDefinitionParams = zod.object({
3752
3802
  id: zod.string().describe("The id returned by the POST \/flow_definitions endpoint.\n"),
3753
3803
  });
3754
3804
 
3805
+ export const deleteFlowDefinitionQueryProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
3806
+
3807
+ export const DeleteFlowDefinitionQueryParams = zod.strictObject({
3808
+ project_id: zod
3809
+ .string()
3810
+ .regex(deleteFlowDefinitionQueryProjectIdRegExp)
3811
+ .describe("The project id to filter by."),
3812
+ });
3813
+
3755
3814
  /**
3756
3815
  * @summary Create team
3757
3816
  */