@zitadel/api 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.
Files changed (90) hide show
  1. package/dist/generated/endpoints/zitadelNextGen.d.mts +2 -2
  2. package/dist/generated/endpoints/zitadelNextGen.mjs +55 -5
  3. package/dist/generated/endpoints/zitadelNextGen.mjs.map +1 -1
  4. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts +5 -3
  5. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts.map +1 -1
  6. package/dist/generated/endpoints/zitadelNextGen.msw.mjs +65 -21
  7. package/dist/generated/endpoints/zitadelNextGen.msw.mjs.map +1 -1
  8. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts +151 -51
  9. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts.map +1 -1
  10. package/dist/generated/endpoints/zitadelNextGen.zod.mjs +127 -52
  11. package/dist/generated/endpoints/zitadelNextGen.zod.mjs.map +1 -1
  12. package/dist/generated/model/index.d.mts +2 -2
  13. package/dist/generated/model/index.mjs +140 -11
  14. package/dist/generated/model/index.mjs.map +1 -1
  15. package/dist/{index-BGnjxx-b.d.mts → index-DLJ0vloQ.d.mts} +819 -77
  16. package/dist/index-DLJ0vloQ.d.mts.map +1 -0
  17. package/dist/runtime/api-factory.d.mts +1 -1
  18. package/dist/{zitadelNextGen-D1t6bmpx.d.mts → zitadelNextGen-CVTkhQJe.d.mts} +29 -7
  19. package/dist/zitadelNextGen-CVTkhQJe.d.mts.map +1 -0
  20. package/package.json +1 -1
  21. package/src/generated/endpoints/zitadelNextGen.msw.ts +92 -10
  22. package/src/generated/endpoints/zitadelNextGen.ts +81 -4
  23. package/src/generated/endpoints/zitadelNextGen.zod.ts +456 -325
  24. package/src/generated/model/activateFlowDefinition400.ts +20 -0
  25. package/src/generated/model/activateFlowDefinition400Details.ts +12 -0
  26. package/src/generated/model/activateFlowDefinitionDefault.ts +20 -0
  27. package/src/generated/model/activateFlowDefinitionDefaultDetails.ts +12 -0
  28. package/src/generated/model/activateFlowDefinitionParams.ts +15 -0
  29. package/src/generated/model/createFlow201StepActionsItem.ts +15 -1
  30. package/src/generated/model/createFlow201StepActionsItemKind.ts +31 -0
  31. package/src/generated/model/createFlow201StepChallengeMethod.ts +1 -0
  32. package/src/generated/model/createFlowBody.ts +5 -0
  33. package/src/generated/model/createFlowDefinition201.ts +0 -2
  34. package/src/generated/model/createFlowDefinition201FlowDefinition.ts +11 -0
  35. package/src/generated/model/createFlowDefinition201FlowDefinitionStatus.ts +26 -0
  36. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemActionsItem.ts +15 -1
  37. package/src/generated/model/createFlowDefinition201FlowDefinitionStepsItemActionsItemKind.ts +31 -0
  38. package/src/generated/model/createFlowDefinitionBody.ts +6 -0
  39. package/src/generated/model/createFlowDefinitionBodyFlowDefinition.ts +11 -0
  40. package/src/generated/model/createFlowDefinitionBodyFlowDefinitionStatus.ts +26 -0
  41. package/src/generated/model/createFlowDefinitionBodyFlowDefinitionStepsItemActionsItem.ts +15 -1
  42. package/src/generated/model/createFlowDefinitionBodyFlowDefinitionStepsItemActionsItemKind.ts +31 -0
  43. package/src/generated/model/deactivateFlowDefinition400.ts +20 -0
  44. package/src/generated/model/deactivateFlowDefinition400Details.ts +12 -0
  45. package/src/generated/model/deactivateFlowDefinition409.ts +20 -0
  46. package/src/generated/model/deactivateFlowDefinition409Details.ts +12 -0
  47. package/src/generated/model/deactivateFlowDefinitionDefault.ts +20 -0
  48. package/src/generated/model/deactivateFlowDefinitionDefaultDetails.ts +12 -0
  49. package/src/generated/model/deactivateFlowDefinitionParams.ts +15 -0
  50. package/src/generated/model/deleteFlowDefinition409.ts +20 -0
  51. package/src/generated/model/deleteFlowDefinition409Details.ts +12 -0
  52. package/src/generated/model/getFlowDefinition200.ts +0 -2
  53. package/src/generated/model/getFlowDefinition200FlowDefinition.ts +11 -0
  54. package/src/generated/model/getFlowDefinition200FlowDefinitionStatus.ts +26 -0
  55. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemActionsItem.ts +15 -1
  56. package/src/generated/model/getFlowDefinition200FlowDefinitionStepsItemActionsItemKind.ts +31 -0
  57. package/src/generated/model/getFlowStep200StepActionsItem.ts +15 -1
  58. package/src/generated/model/getFlowStep200StepActionsItemKind.ts +31 -0
  59. package/src/generated/model/getFlowStep200StepChallengeMethod.ts +1 -0
  60. package/src/generated/model/index.ts +40 -10
  61. package/src/generated/model/listFlowDefinitions200FlowDefinitionsItem.ts +11 -2
  62. package/src/generated/model/listFlowDefinitions200FlowDefinitionsItemStatus.ts +26 -0
  63. package/src/generated/model/submitFlowStep200StepActionsItem.ts +15 -1
  64. package/src/generated/model/submitFlowStep200StepActionsItemKind.ts +31 -0
  65. package/src/generated/model/submitFlowStep200StepChallengeMethod.ts +1 -0
  66. package/src/generated/model/submitFlowStep400StepActionsItem.ts +15 -1
  67. package/src/generated/model/submitFlowStep400StepActionsItemKind.ts +31 -0
  68. package/src/generated/model/submitFlowStep400StepChallengeMethod.ts +1 -0
  69. package/src/generated/model/updateFlowDefinition200.ts +0 -2
  70. package/src/generated/model/updateFlowDefinition200FlowDefinition.ts +11 -0
  71. package/src/generated/model/updateFlowDefinition200FlowDefinitionStatus.ts +26 -0
  72. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemActionsItem.ts +15 -1
  73. package/src/generated/model/updateFlowDefinition200FlowDefinitionStepsItemActionsItemKind.ts +31 -0
  74. package/src/generated/model/updateFlowDefinitionBody.ts +15 -30
  75. package/src/generated/model/updateFlowDefinitionBodyFlowDefinition.ts +69 -0
  76. package/src/generated/model/{updateFlowDefinitionBodyAudience.ts → updateFlowDefinitionBodyFlowDefinitionAudience.ts} +1 -1
  77. package/src/generated/model/updateFlowDefinitionBodyFlowDefinitionStatus.ts +26 -0
  78. package/src/generated/model/{updateFlowDefinitionBodyStepsItem.ts → updateFlowDefinitionBodyFlowDefinitionStepsItem.ts} +13 -13
  79. package/src/generated/model/updateFlowDefinitionBodyFlowDefinitionStepsItemActionsItem.ts +42 -0
  80. package/src/generated/model/updateFlowDefinitionBodyFlowDefinitionStepsItemActionsItemKind.ts +31 -0
  81. package/src/generated/model/{updateFlowDefinitionBodyStepsItemComplete.ts → updateFlowDefinitionBodyFlowDefinitionStepsItemComplete.ts} +3 -3
  82. package/src/generated/model/{updateFlowDefinitionBodyStepsItemGates.ts → updateFlowDefinitionBodyFlowDefinitionStepsItemGates.ts} +5 -5
  83. package/src/generated/model/{updateFlowDefinitionBodyStepsItemGatesConfig.ts → updateFlowDefinitionBodyFlowDefinitionStepsItemGatesConfig.ts} +1 -1
  84. package/src/generated/model/{updateFlowDefinitionBodyStepsItemGatesKind.ts → updateFlowDefinitionBodyFlowDefinitionStepsItemGatesKind.ts} +3 -3
  85. package/src/generated/model/{updateFlowDefinitionBodyStepsItemOnSuccess.ts → updateFlowDefinitionBodyFlowDefinitionStepsItemOnSuccess.ts} +3 -3
  86. package/src/generated/model/{updateFlowDefinitionBodyStepsItemSsoProvidersItem.ts → updateFlowDefinitionBodyFlowDefinitionStepsItemSsoProvidersItem.ts} +1 -1
  87. package/src/generated/model/{updateFlowDefinitionBodyStepsItemTransitions.ts → updateFlowDefinitionBodyFlowDefinitionStepsItemTransitions.ts} +1 -1
  88. package/dist/index-BGnjxx-b.d.mts.map +0 -1
  89. package/dist/zitadelNextGen-D1t6bmpx.d.mts.map +0 -1
  90. package/src/generated/model/updateFlowDefinitionBodyStepsItemActionsItem.ts +0 -28
@@ -8,6 +8,7 @@
8
8
  import { getProxyPath } from "../../runtime/base-url";
9
9
  import { customFetch } from "../../runtime/fetch";
10
10
  import type {
11
+ ActivateFlowDefinitionParams,
11
12
  AuthorizeDevice200,
12
13
  AuthorizeDeviceParams,
13
14
  AuthorizeGetDefault,
@@ -32,6 +33,7 @@ import type {
32
33
  CreateUser201,
33
34
  CreateUserBody,
34
35
  CreateUserParams,
36
+ DeactivateFlowDefinitionParams,
35
37
  DeleteFlowDefinitionParams,
36
38
  EndSessionParams,
37
39
  ExchangeHandoff200,
@@ -1099,7 +1101,7 @@ export const getCreateFlowDefinitionUrl = () => {
1099
1101
  Flow definitions are templates that define the sequence of steps (capabilities)
1100
1102
  for a particular user journey (e.g., registration, login, password reset).
1101
1103
 
1102
- Flow definitions are created based on the flow meta schema, which includes the flow's purpose, audience, and the steps involved.
1104
+ Flow definitions are created based on the flow definition schema, which includes the flow's purpose, audience, and the steps involved.
1103
1105
 
1104
1106
  * @summary Create a new flow definition
1105
1107
  */
@@ -1195,7 +1197,9 @@ export const getUpdateFlowDefinitionUrl = (id: string, params: UpdateFlowDefinit
1195
1197
  };
1196
1198
 
1197
1199
  /**
1198
- * Update a flow definition by id
1200
+ * Update a flow definition by id. This endpoint replaces the existing flow definition.
1201
+ If `flow_definition.status` is omitted, the current status is preserved
1202
+
1199
1203
  * @summary Update a flow definition by id
1200
1204
  */
1201
1205
  export const updateFlowDefinition = async (
@@ -1206,7 +1210,7 @@ export const updateFlowDefinition = async (
1206
1210
  ): Promise<UpdateFlowDefinition200> => {
1207
1211
  return customFetch<UpdateFlowDefinition200>(getUpdateFlowDefinitionUrl(id, params), {
1208
1212
  ...options,
1209
- method: "PATCH",
1213
+ method: "PUT",
1210
1214
  headers: { "Content-Type": "application/json", ...options?.headers },
1211
1215
  body: JSON.stringify(updateFlowDefinitionBody),
1212
1216
  });
@@ -1229,7 +1233,10 @@ export const getDeleteFlowDefinitionUrl = (id: string, params: DeleteFlowDefinit
1229
1233
  };
1230
1234
 
1231
1235
  /**
1232
- * Delete a flow definition by id
1236
+ * Delete a flow definition by id.
1237
+ If the flow definition is currently being used by a flow, the deletion will fail.
1238
+ 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.
1239
+
1233
1240
  * @summary Delete a flow definition by id
1234
1241
  */
1235
1242
  export const deleteFlowDefinition = async (
@@ -1243,6 +1250,76 @@ export const deleteFlowDefinition = async (
1243
1250
  });
1244
1251
  };
1245
1252
 
1253
+ export const getActivateFlowDefinitionUrl = (id: string, params: ActivateFlowDefinitionParams) => {
1254
+ const normalizedParams = new URLSearchParams();
1255
+
1256
+ Object.entries(params || {}).forEach(([key, value]) => {
1257
+ if (value !== undefined) {
1258
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1259
+ }
1260
+ });
1261
+
1262
+ const stringifiedParams = normalizedParams.toString();
1263
+
1264
+ return stringifiedParams.length > 0
1265
+ ? `${getProxyPath()}/flow_definitions/${id}/activate?${stringifiedParams}`
1266
+ : `${getProxyPath()}/flow_definitions/${id}/activate`;
1267
+ };
1268
+
1269
+ /**
1270
+ * Activate a flow definition by transitioning it from a `draft` state to an `active` state.
1271
+ 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.
1272
+
1273
+ * @summary Activate a flow definition by ID.
1274
+ */
1275
+ export const activateFlowDefinition = async (
1276
+ id: string,
1277
+ params: ActivateFlowDefinitionParams,
1278
+ options?: RequestInit,
1279
+ ): Promise<void> => {
1280
+ return customFetch<void>(getActivateFlowDefinitionUrl(id, params), {
1281
+ ...options,
1282
+ method: "POST",
1283
+ });
1284
+ };
1285
+
1286
+ export const getDeactivateFlowDefinitionUrl = (
1287
+ id: string,
1288
+ params: DeactivateFlowDefinitionParams,
1289
+ ) => {
1290
+ const normalizedParams = new URLSearchParams();
1291
+
1292
+ Object.entries(params || {}).forEach(([key, value]) => {
1293
+ if (value !== undefined) {
1294
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1295
+ }
1296
+ });
1297
+
1298
+ const stringifiedParams = normalizedParams.toString();
1299
+
1300
+ return stringifiedParams.length > 0
1301
+ ? `${getProxyPath()}/flow_definitions/${id}/deactivate?${stringifiedParams}`
1302
+ : `${getProxyPath()}/flow_definitions/${id}/deactivate`;
1303
+ };
1304
+
1305
+ /**
1306
+ * Deactivates a flow definition in the `active` state by transitioning it to the `draft` state.
1307
+ Flow definitions in `draft` state cannot be used to start new flows. Existing flows that use the deactivated flow definition must gracefully handle this.
1308
+ 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.
1309
+
1310
+ * @summary Deactivate a flow definition by ID.
1311
+ */
1312
+ export const deactivateFlowDefinition = async (
1313
+ id: string,
1314
+ params: DeactivateFlowDefinitionParams,
1315
+ options?: RequestInit,
1316
+ ): Promise<void> => {
1317
+ return customFetch<void>(getDeactivateFlowDefinitionUrl(id, params), {
1318
+ ...options,
1319
+ method: "POST",
1320
+ });
1321
+ };
1322
+
1246
1323
  export const getCreateTeamUrl = (params: CreateTeamParams) => {
1247
1324
  const normalizedParams = new URLSearchParams();
1248
1325