@zitadel/api 1.0.0-alpha.21 → 1.0.0-alpha.22

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 +75 -4
  3. package/dist/generated/endpoints/zitadelNextGen.mjs.map +1 -1
  4. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts +6 -2
  5. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts.map +1 -1
  6. package/dist/generated/endpoints/zitadelNextGen.msw.mjs +622 -1
  7. package/dist/generated/endpoints/zitadelNextGen.msw.mjs.map +1 -1
  8. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts +380 -24
  9. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts.map +1 -1
  10. package/dist/generated/endpoints/zitadelNextGen.zod.mjs +370 -39
  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 +54 -1
  14. package/dist/generated/model/index.mjs.map +1 -1
  15. package/dist/{index-BK4Q468Q.d.mts → index-DtExHu2p.d.mts} +1452 -140
  16. package/dist/index-DtExHu2p.d.mts.map +1 -0
  17. package/dist/runtime/api-factory.d.mts +1 -1
  18. package/dist/{zitadelNextGen-C8m49W5h.d.mts → zitadelNextGen-C79YSuEo.d.mts} +45 -7
  19. package/dist/zitadelNextGen-C79YSuEo.d.mts.map +1 -0
  20. package/package.json +1 -1
  21. package/src/generated/endpoints/zitadelNextGen.msw.ts +759 -55
  22. package/src/generated/endpoints/zitadelNextGen.ts +98 -3
  23. package/src/generated/endpoints/zitadelNextGen.zod.ts +1199 -422
  24. package/src/generated/model/completeClaim410.ts +21 -16
  25. package/src/generated/model/createFlowDefinition201FlowDefinition.ts +5 -3
  26. package/src/generated/model/createFlowDefinitionBodyFlowDefinition.ts +5 -3
  27. package/src/generated/model/createFlowDefinitionDefault.ts +0 -10
  28. package/src/generated/model/createGrant201.ts +32 -0
  29. package/src/generated/model/createGrant201Principal.ts +147 -0
  30. package/src/generated/model/createGrant201Team.ts +22 -0
  31. package/src/generated/model/createGrant201User.ts +38 -0
  32. package/src/generated/model/createSession201Session.ts +1 -0
  33. package/src/generated/model/createSession201SessionUser.ts +1 -0
  34. package/src/generated/model/exchangeHandoff200Session.ts +1 -0
  35. package/src/generated/model/exchangeHandoff200SessionUser.ts +1 -0
  36. package/src/generated/model/getClaimStatus410.ts +21 -16
  37. package/src/generated/model/getClaimWindow200.ts +23 -0
  38. package/src/generated/model/{createFlowDefinition409.ts → getClaimWindow404.ts} +3 -3
  39. package/src/generated/model/{createFlowDefinition409Details.ts → getClaimWindow404Details.ts} +1 -1
  40. package/src/generated/model/getClaimWindow429.ts +20 -0
  41. package/src/generated/model/getClaimWindow429Details.ts +12 -0
  42. package/src/generated/model/getClaimWindowDefault.ts +20 -0
  43. package/src/generated/model/getClaimWindowDefaultDetails.ts +12 -0
  44. package/src/generated/model/getClaimWindowParams.ts +15 -0
  45. package/src/generated/model/getEvent200.ts +75 -0
  46. package/src/generated/model/getFlowDefinition200FlowDefinition.ts +5 -3
  47. package/src/generated/model/getGrant200.ts +32 -0
  48. package/src/generated/model/getGrant200Principal.ts +147 -0
  49. package/src/generated/model/getGrant200Team.ts +22 -0
  50. package/src/generated/model/getGrant200User.ts +38 -0
  51. package/src/generated/model/getMySession200.ts +1 -0
  52. package/src/generated/model/getMySession200User.ts +1 -0
  53. package/src/generated/model/getSession200.ts +1 -0
  54. package/src/generated/model/getSession200User.ts +1 -0
  55. package/src/generated/model/index.ts +39 -2
  56. package/src/generated/model/initClaim410.ts +24 -0
  57. package/src/generated/model/listEvents200DataItem.ts +75 -0
  58. package/src/generated/model/listFlowDefinitions200.ts +3 -0
  59. package/src/generated/model/listFlowDefinitions200FlowDefinitionsItemFlowDefinition.ts +5 -3
  60. package/src/generated/model/listFlowDefinitionsParams.ts +8 -0
  61. package/src/generated/model/queryGrants200.ts +20 -0
  62. package/src/generated/model/queryGrants200GrantsItem.ts +66 -0
  63. package/src/generated/model/queryGrants200GrantsItemObjectType.ts +17 -0
  64. package/src/generated/model/queryGrants200GrantsItemPrincipal.ts +147 -0
  65. package/src/generated/model/queryGrants200GrantsItemPrincipalType.ts +18 -0
  66. package/src/generated/model/queryGrants200GrantsItemRelation.ts +19 -0
  67. package/src/generated/model/queryGrants200GrantsItemTeam.ts +22 -0
  68. package/src/generated/model/queryGrants200GrantsItemUser.ts +38 -0
  69. package/src/generated/model/queryGrants400.ts +20 -0
  70. package/src/generated/model/queryGrants400Details.ts +12 -0
  71. package/src/generated/model/queryGrants401.ts +20 -0
  72. package/src/generated/model/queryGrants401Details.ts +12 -0
  73. package/src/generated/model/queryGrants403.ts +20 -0
  74. package/src/generated/model/queryGrants403Details.ts +12 -0
  75. package/src/generated/model/queryGrantsBody.ts +33 -0
  76. package/src/generated/model/queryGrantsBodyExpandItem.ts +30 -0
  77. package/src/generated/model/queryGrantsBodyFilterItem.ts +33 -0
  78. package/src/generated/model/queryGrantsBodyFilterItemField.ts +27 -0
  79. package/src/generated/model/queryGrantsBodyFilterItemOperation.ts +30 -0
  80. package/src/generated/model/queryGrantsBodySorting.ts +17 -0
  81. package/src/generated/model/queryGrantsBodySortingDirection.ts +15 -0
  82. package/src/generated/model/queryGrantsBodySortingField.ts +21 -0
  83. package/src/generated/model/queryGrantsDefault.ts +99 -0
  84. package/src/generated/model/queryGrantsParams.ts +15 -0
  85. package/src/generated/model/querySessions200SessionsItem.ts +1 -0
  86. package/src/generated/model/querySessions200SessionsItemUser.ts +1 -0
  87. package/src/generated/model/updateFlowDefinition200FlowDefinition.ts +5 -3
  88. package/src/generated/model/updateFlowDefinitionBodyFlowDefinition.ts +5 -3
  89. package/dist/index-BK4Q468Q.d.mts.map +0 -1
  90. package/dist/zitadelNextGen-C8m49W5h.d.mts.map +0 -1
@@ -52,6 +52,8 @@ import type {
52
52
  GetBrandingById200,
53
53
  GetClaimStatus200,
54
54
  GetClaimStatusParams,
55
+ GetClaimWindow200,
56
+ GetClaimWindowParams,
55
57
  GetEnvironmentByName200,
56
58
  GetEnvironmentByNameParams,
57
59
  GetEvent200,
@@ -95,6 +97,9 @@ import type {
95
97
  ListUserTeamsParams,
96
98
  PatchProject200,
97
99
  PatchProjectBody,
100
+ QueryGrants200,
101
+ QueryGrantsBody,
102
+ QueryGrantsParams,
98
103
  QueryProjects200,
99
104
  QueryProjectsBody,
100
105
  QuerySessions200,
@@ -778,7 +783,11 @@ export const getGetClaimStatusUrl = (projectId: string, params: GetClaimStatusPa
778
783
  * Polled by the CLI while a browser completes the claim. Authorized by the
779
784
  project secret that initiated the challenge. Returns `pending`, or
780
785
  `completed` with the owning team, the claim timestamp, and the dashboard
781
- URL once the browser leg has finished.
786
+ URL once the project is claimed. The claim grant, not the polled
787
+ challenge, is the source of truth: a project claimed through another
788
+ concurrent challenge also reports `completed`, and a completed claim
789
+ keeps reporting `completed` past this challenge's expiry and past the
790
+ project's claim window.
782
791
 
783
792
  * @summary Get claim status
784
793
  */
@@ -818,6 +827,43 @@ export const completeClaim = async (
818
827
  });
819
828
  };
820
829
 
830
+ export const getGetClaimWindowUrl = (projectId: string, params: GetClaimWindowParams) => {
831
+ const normalizedParams = new URLSearchParams();
832
+
833
+ Object.entries(params || {}).forEach(([key, value]) => {
834
+ if (value !== undefined) {
835
+ normalizedParams.append(key, value === null ? "null" : value.toString());
836
+ }
837
+ });
838
+
839
+ const stringifiedParams = normalizedParams.toString();
840
+
841
+ return stringifiedParams.length > 0
842
+ ? `${getProxyPath()}/projects/${projectId}/claim/window?${stringifiedParams}`
843
+ : `${getProxyPath()}/projects/${projectId}/claim/window`;
844
+ };
845
+
846
+ /**
847
+ * Read by the claim page in the browser to show how long is left to claim the
848
+ project. Unauthenticated by design: the claim page runs this before the
849
+ developer has signed in, and holding the `challenge_id` from the claim URL
850
+ is the authorization — the same capability `claim/complete` accepts. It
851
+ reveals only the window, never the project itself, and unlike
852
+ `claim/complete` it spends nothing, so a reload is free.
853
+
854
+ * @summary Get the claim window for a project
855
+ */
856
+ export const getClaimWindow = async (
857
+ projectId: string,
858
+ params: GetClaimWindowParams,
859
+ options?: RequestInit,
860
+ ): Promise<GetClaimWindow200> => {
861
+ return customFetch<GetClaimWindow200>(getGetClaimWindowUrl(projectId, params), {
862
+ ...options,
863
+ method: "GET",
864
+ });
865
+ };
866
+
821
867
  export const getCreateSessionUrl = () => {
822
868
  return `${getProxyPath()}/sessions`;
823
869
  };
@@ -1148,12 +1194,17 @@ export const getCreateFlowDefinitionUrl = () => {
1148
1194
  };
1149
1195
 
1150
1196
  /**
1151
- * Creates a new flow definition.
1197
+ * Publishes a new flow definition revision.
1152
1198
  Flow definitions are templates that define the sequence of steps (capabilities)
1153
1199
  for a particular user journey (e.g., registration, login, password reset).
1154
1200
 
1155
1201
  Flow definitions are created based on the flow definition schema, which includes the flow's purpose, audience, and the steps involved.
1156
1202
 
1203
+ Every call allocates a new opaque id. Revisions of one flow share its
1204
+ `name`; posting a definition under an existing `name` publishes a new
1205
+ revision of that flow, it is not a conflict. List with `name` to see a
1206
+ flow's revisions, newest by creation time first.
1207
+
1157
1208
  * @summary Create a new flow definition
1158
1209
  */
1159
1210
  export const createFlowDefinition = async (
@@ -1185,8 +1236,9 @@ export const getListFlowDefinitionsUrl = (params: ListFlowDefinitionsParams) =>
1185
1236
  };
1186
1237
 
1187
1238
  /**
1188
- * Retrieves a list of all flow definitions.
1239
+ * Retrieves a list of all flow definitions, newest by creation time first.
1189
1240
  This endpoint can be used to view existing flow definitions and their configurations.
1241
+ Filter by `name` to list the revisions of one flow.
1190
1242
 
1191
1243
  * @summary List flow definitions
1192
1244
  */
@@ -1709,6 +1761,49 @@ export const createGrant = async (
1709
1761
  });
1710
1762
  };
1711
1763
 
1764
+ export const getQueryGrantsUrl = (params: QueryGrantsParams) => {
1765
+ const normalizedParams = new URLSearchParams();
1766
+
1767
+ Object.entries(params || {}).forEach(([key, value]) => {
1768
+ if (value !== undefined) {
1769
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1770
+ }
1771
+ });
1772
+
1773
+ const stringifiedParams = normalizedParams.toString();
1774
+
1775
+ return stringifiedParams.length > 0
1776
+ ? `${getProxyPath()}/grants/query?${stringifiedParams}`
1777
+ : `${getProxyPath()}/grants/query`;
1778
+ };
1779
+
1780
+ /**
1781
+ * Returns the collaboration grants of a project, paginated with a cursor.
1782
+ Only unrevoked grants this API manages are listed (user or team bound to
1783
+ viewer, editor, or admin), including expired grants so a client can
1784
+ DELETE before re-granting. Project-secret setup (`sk_proj`) and
1785
+ owning-team (`relation=team`) rows are not returned. Grants are not in
1786
+ `resource_scope_index`; project scope is required on the query (same as
1787
+ get). Requires `project.read`. `expand: ["principal"]` additionally
1788
+ requires `user.read` and `team.read` (documented on the expand enum;
1789
+ those scopes cannot be ANDed onto this security block because they are
1790
+ body-conditional).
1791
+
1792
+ * @summary Query grants
1793
+ */
1794
+ export const queryGrants = async (
1795
+ queryGrantsBody: QueryGrantsBody,
1796
+ params: QueryGrantsParams,
1797
+ options?: RequestInit,
1798
+ ): Promise<QueryGrants200> => {
1799
+ return customFetch<QueryGrants200>(getQueryGrantsUrl(params), {
1800
+ ...options,
1801
+ method: "POST",
1802
+ headers: { "Content-Type": "application/json", ...options?.headers },
1803
+ body: JSON.stringify(queryGrantsBody),
1804
+ });
1805
+ };
1806
+
1712
1807
  export const getGetGrantUrl = (id: string, params: GetGrantParams) => {
1713
1808
  const normalizedParams = new URLSearchParams();
1714
1809