@zitadel/api 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{fetch-DD3lSbnp.d.mts → fetch-CtYe0OvX.d.mts} +8 -2
- package/dist/fetch-CtYe0OvX.d.mts.map +1 -0
- package/dist/generated/endpoints/zitadelNextGen.d.mts +2 -2
- package/dist/generated/endpoints/zitadelNextGen.mjs +228 -42
- package/dist/generated/endpoints/zitadelNextGen.mjs.map +1 -1
- package/dist/generated/endpoints/zitadelNextGen.msw.d.mts +15 -4
- package/dist/generated/endpoints/zitadelNextGen.msw.d.mts.map +1 -1
- package/dist/generated/endpoints/zitadelNextGen.msw.mjs +3156 -1476
- package/dist/generated/endpoints/zitadelNextGen.msw.mjs.map +1 -1
- package/dist/generated/endpoints/zitadelNextGen.zod.d.mts +1282 -94
- package/dist/generated/endpoints/zitadelNextGen.zod.d.mts.map +1 -1
- package/dist/generated/endpoints/zitadelNextGen.zod.mjs +1785 -641
- package/dist/generated/endpoints/zitadelNextGen.zod.mjs.map +1 -1
- package/dist/generated/model/index.d.mts +2 -2
- package/dist/generated/model/index.mjs +72 -65
- package/dist/generated/model/index.mjs.map +1 -1
- package/dist/generated/operations.mjs +181 -29
- package/dist/generated/operations.mjs.map +1 -1
- package/dist/{index-DuuFQkA8.d.mts → index-D7-l5LV6.d.mts} +6051 -1072
- package/dist/index-D7-l5LV6.d.mts.map +1 -0
- package/dist/runtime/api-factory.d.mts +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +9 -2
- package/dist/runtime/fetch.mjs.map +1 -1
- package/dist/{zitadelNextGen-BdUDEEuX.d.mts → zitadelNextGen-Cw3DrCn1.d.mts} +135 -37
- package/dist/zitadelNextGen-Cw3DrCn1.d.mts.map +1 -0
- package/package.json +2 -2
- package/src/generated/endpoints/zitadelNextGen.faker.ts +37 -19
- package/src/generated/endpoints/zitadelNextGen.msw.ts +91 -13
- package/src/generated/endpoints/zitadelNextGen.ts +322 -52
- package/src/generated/endpoints/zitadelNextGen.zod.ts +1072 -123
- package/src/generated/model/addOriginDefault.ts +27 -0
- package/src/generated/model/beginUserPasskeyRegistrationDefault.ts +18 -0
- package/src/generated/model/buildRelease200PointersItem.ts +2 -0
- package/src/generated/model/buildRelease200PointersItemKind.ts +1 -0
- package/src/generated/model/buildRelease201PointersItem.ts +2 -0
- package/src/generated/model/buildRelease201PointersItemKind.ts +1 -0
- package/src/generated/model/buildRelease400DetailsResourcesItemKind.ts +1 -0
- package/src/generated/model/buildReleaseBody.ts +3 -3
- package/src/generated/model/buildReleaseBodyBundle.ts +20 -3
- package/src/generated/model/buildReleaseBodyBundlePoliciesItem.ts +47 -0
- package/src/generated/model/buildReleaseDefault.ts +36 -0
- package/src/generated/model/createAuthAttemptDefault.ts +27 -0
- package/src/generated/model/createBrandingDefault.ts +18 -0
- package/src/generated/model/createDeployment200ReleasePointersItem.ts +2 -0
- package/src/generated/model/createDeployment200ReleasePointersItemKind.ts +1 -0
- package/src/generated/model/createDeployment201ReleasePointersItem.ts +2 -0
- package/src/generated/model/createDeployment201ReleasePointersItemKind.ts +1 -0
- package/src/generated/model/createDeployment409.ts +3 -1
- package/src/generated/model/createDeploymentBody.ts +2 -4
- package/src/generated/model/createDeploymentDefault.ts +54 -0
- package/src/generated/model/createFlow201Step.ts +19 -0
- package/src/generated/model/createFlow201StepPurpose.ts +26 -0
- package/src/generated/model/createFlowDefault.ts +18 -0
- package/src/generated/model/createFlowDefinitionDefault.ts +18 -0
- package/src/generated/model/createGrant201Team.ts +4 -1
- package/src/generated/model/createGrantDefault.ts +18 -0
- package/src/generated/model/createHandoffDefault.ts +18 -0
- package/src/generated/model/createIdpDefault.ts +18 -0
- package/src/generated/model/createRelease200PointersItem.ts +2 -0
- package/src/generated/model/createRelease200PointersItemKind.ts +1 -0
- package/src/generated/model/createRelease201PointersItem.ts +2 -0
- package/src/generated/model/createRelease201PointersItemKind.ts +1 -0
- package/src/generated/model/createReleaseBodyPointersItemKind.ts +1 -0
- package/src/generated/model/createReleaseDefault.ts +18 -0
- package/src/generated/model/createSchemaDefault.ts +18 -0
- package/src/generated/model/createSessionDefault.ts +18 -0
- package/src/generated/model/createTeamDefault.ts +18 -0
- package/src/generated/model/createUserDefault.ts +18 -0
- package/src/generated/model/deleteGrantDefault.ts +18 -0
- package/src/generated/model/deleteTeamDefault.ts +18 -0
- package/src/generated/model/deleteUserByIDDefault.ts +18 -0
- package/src/generated/model/deleteVariableDefault.ts +18 -0
- package/src/generated/model/exchangeHandoffDefault.ts +36 -0
- package/src/generated/model/finishUserPasskeyRegistrationDefault.ts +18 -0
- package/src/generated/model/getAuthAttemptDefault.ts +18 -0
- package/src/generated/model/getBrandingByIdDefault.ts +18 -0
- package/src/generated/model/getClaimStatusDefault.ts +18 -0
- package/src/generated/model/getDeploymentById200ReleasePointersItem.ts +2 -0
- package/src/generated/model/getDeploymentById200ReleasePointersItemKind.ts +1 -0
- package/src/generated/model/getDeploymentByIdDefault.ts +18 -0
- package/src/generated/model/getDeploymentVariablesDefault.ts +9 -0
- package/src/generated/model/getEvent200.ts +788 -0
- package/src/generated/model/getEventDefault.ts +18 -0
- package/src/generated/model/getFlowDefinitionDefault.ts +18 -0
- package/src/generated/model/getFlowStep200Step.ts +19 -0
- package/src/generated/model/getFlowStep200StepPurpose.ts +26 -0
- package/src/generated/model/getFlowStepDefault.ts +36 -0
- package/src/generated/model/getGrant200Team.ts +4 -1
- package/src/generated/model/getGrantDefault.ts +18 -0
- package/src/generated/model/getIdpByIdDefault.ts +18 -0
- package/src/generated/model/getIdpRevisionByIdDefault.ts +18 -0
- package/src/generated/model/getMyPasswordStateDefault.ts +18 -0
- package/src/generated/model/getMySessionCsrfTokenDefault.ts +18 -0
- package/src/generated/model/getMySessionDefault.ts +18 -0
- package/src/generated/model/getMyUserDefault.ts +18 -0
- package/src/generated/model/getMyUserSchemaDefault.ts +18 -0
- package/src/generated/model/getPolicy200.ts +62 -0
- package/src/generated/model/getPolicyDefault.ts +72 -0
- package/src/generated/model/getPolicyParams.ts +15 -0
- package/src/generated/model/getPolicyRevision200.ts +62 -0
- package/src/generated/model/getPolicyRevisionDefault.ts +72 -0
- package/src/generated/model/getPolicyRevisionParams.ts +15 -0
- package/src/generated/model/getProject200.ts +64 -6
- package/src/generated/model/getReleaseById200PointersItem.ts +2 -0
- package/src/generated/model/getReleaseById200PointersItemKind.ts +1 -0
- package/src/generated/model/getReleaseByIdDefault.ts +18 -0
- package/src/generated/model/getSchemaByIdDefault.ts +18 -0
- package/src/generated/model/getSessionDefault.ts +18 -0
- package/src/generated/model/getTeamDefault.ts +18 -0
- package/src/generated/model/getUserByIDDefault.ts +18 -0
- package/src/generated/model/getUserPasswordStateDefault.ts +18 -0
- package/src/generated/model/getVariableDefault.ts +18 -0
- package/src/generated/model/getVariablesDefault.ts +18 -0
- package/src/generated/model/index.ts +38 -21
- package/src/generated/model/initClaimDefault.ts +18 -0
- package/src/generated/model/issueChallengeDefault.ts +18 -0
- package/src/generated/model/listBrandingDefault.ts +18 -0
- package/src/generated/model/listDeployments200DeploymentsItemReleasePointersItem.ts +2 -0
- package/src/generated/model/listDeployments200DeploymentsItemReleasePointersItemKind.ts +1 -0
- package/src/generated/model/listDeploymentsDefault.ts +18 -0
- package/src/generated/model/listEvents200DataItem.ts +788 -0
- package/src/generated/model/listEventsDefault.ts +18 -0
- package/src/generated/model/listFlowDefinitionsDefault.ts +18 -0
- package/src/generated/model/listIdpRevisionsDefault.ts +18 -0
- package/src/generated/model/listMyIdentityLinksDefault.ts +18 -0
- package/src/generated/model/listMyPasskeysDefault.ts +18 -0
- package/src/generated/model/listMyProjectsDefault.ts +18 -0
- package/src/generated/model/listMyProjectsParams.ts +8 -0
- package/src/generated/model/listMyTeamsDefault.ts +18 -0
- package/src/generated/model/listPolicies200.ts +21 -0
- package/src/generated/model/listPolicies200PoliciesItem.ts +62 -0
- package/src/generated/model/listPoliciesDefault.ts +72 -0
- package/src/generated/model/listPoliciesOperation.ts +14 -0
- package/src/generated/model/listPoliciesParams.ts +33 -0
- package/src/generated/model/listPolicyRevisions200.ts +20 -0
- package/src/generated/model/listPolicyRevisions200RevisionsItem.ts +62 -0
- package/src/generated/model/listPolicyRevisionsDefault.ts +72 -0
- package/src/generated/model/listPolicyRevisionsParams.ts +28 -0
- package/src/generated/model/listPreviewsDefault.ts +9 -0
- package/src/generated/model/listProjectAdmins200.ts +20 -0
- package/src/generated/model/listProjectAdmins200AdminsItem.ts +31 -0
- package/src/generated/model/listProjectAdmins200AdminsItemSourcesItem.ts +57 -0
- package/src/generated/model/listProjectAdmins200AdminsItemUser.ts +40 -0
- package/src/generated/model/{createAuthAttempt409.ts → listProjectAdmins400.ts} +3 -3
- package/src/generated/model/{createAuthAttempt409Details.ts → listProjectAdmins400Details.ts} +1 -1
- package/src/generated/model/{issueChallenge409.ts → listProjectAdmins401.ts} +3 -3
- package/src/generated/model/{issueChallenge409Details.ts → listProjectAdmins401Details.ts} +1 -1
- package/src/generated/model/{getAuthAttempt409.ts → listProjectAdmins403.ts} +3 -3
- package/src/generated/model/{getHealth4xxDetails.ts → listProjectAdmins403Details.ts} +1 -1
- package/src/generated/model/{getHealth4xx.ts → listProjectAdmins404.ts} +3 -3
- package/src/generated/model/{getAuthAttempt409Details.ts → listProjectAdmins404Details.ts} +1 -1
- package/src/generated/model/listProjectAdminsDefault.ts +81 -0
- package/src/generated/model/listProjectAdminsParams.ts +23 -0
- package/src/generated/model/listReleasesDefault.ts +18 -0
- package/src/generated/model/listSchemasDefault.ts +18 -0
- package/src/generated/model/listUserIdentityLinksDefault.ts +18 -0
- package/src/generated/model/listUserPasskeysDefault.ts +18 -0
- package/src/generated/model/listUserTeamsDefault.ts +18 -0
- package/src/generated/model/patchMyUserDefault.ts +18 -0
- package/src/generated/model/patchProject200.ts +64 -6
- package/src/generated/model/patchProjectDefault.ts +18 -0
- package/src/generated/model/patchUserByIDDefault.ts +18 -0
- package/src/generated/model/publishPolicy201.ts +62 -0
- package/src/generated/model/publishPolicyBody.ts +47 -0
- package/src/generated/model/publishPolicyDefault.ts +99 -0
- package/src/generated/model/publishPolicyParams.ts +15 -0
- package/src/generated/model/queryGrants200GrantsItemTeam.ts +4 -1
- package/src/generated/model/queryGrantsDefault.ts +9 -0
- package/src/generated/model/queryIdpsDefault.ts +9 -0
- package/src/generated/model/queryProjectsDefault.ts +9 -0
- package/src/generated/model/querySessionsDefault.ts +9 -0
- package/src/generated/model/queryTeamsDefault.ts +9 -0
- package/src/generated/model/queryUsersDefault.ts +9 -0
- package/src/generated/model/removeOriginDefault.ts +27 -0
- package/src/generated/model/removePreviewDefault.ts +18 -0
- package/src/generated/model/revokeMySessionDefault.ts +18 -0
- package/src/generated/model/revokeRelease200PointersItem.ts +2 -0
- package/src/generated/model/revokeRelease200PointersItemKind.ts +1 -0
- package/src/generated/model/revokeRelease409DetailsOriginsItem.ts +9 -1
- package/src/generated/model/revokeReleaseDefault.ts +63 -0
- package/src/generated/model/revokeSessionDefault.ts +18 -0
- package/src/generated/model/rollbackDeployment200ReleasePointersItem.ts +2 -0
- package/src/generated/model/rollbackDeployment200ReleasePointersItemKind.ts +1 -0
- package/src/generated/model/rollbackDeployment201ReleasePointersItem.ts +2 -0
- package/src/generated/model/rollbackDeployment201ReleasePointersItemKind.ts +1 -0
- package/src/generated/model/rollbackDeployment409.ts +3 -1
- package/src/generated/model/rollbackDeploymentDefault.ts +99 -0
- package/src/generated/model/setUserPasswordDefault.ts +18 -0
- package/src/generated/model/submitFlowStep200Step.ts +19 -0
- package/src/generated/model/submitFlowStep200StepPurpose.ts +26 -0
- package/src/generated/model/submitFlowStep400Step.ts +19 -0
- package/src/generated/model/submitFlowStep400StepPurpose.ts +26 -0
- package/src/generated/model/submitFlowStepDefault.ts +36 -0
- package/src/generated/model/updateTeamDefault.ts +18 -0
- package/src/generated/model/updateVariablesDefault.ts +18 -0
- package/src/generated/model/verifyChallengeProofDefault.ts +18 -0
- package/src/generated/operations.ts +189 -29
- package/src/runtime/config.spec.ts +2 -2
- package/src/runtime/fetch.spec.ts +13 -1
- package/src/runtime/fetch.ts +15 -2
- package/dist/fetch-DD3lSbnp.d.mts.map +0 -1
- package/dist/index-DuuFQkA8.d.mts.map +0 -1
- package/dist/zitadelNextGen-BdUDEEuX.d.mts.map +0 -1
- package/src/generated/model/getHealthDefault.ts +0 -27
- package/src/generated/model/getProject200OriginsItem.ts +0 -23
- package/src/generated/model/getProject200OriginsItemKind.ts +0 -15
- package/src/generated/model/getProject200PasswordHash.ts +0 -42
- package/src/generated/model/getProject200PasswordHashAlgorithm.ts +0 -24
- package/src/generated/model/getProject200PasswordHashParams.ts +0 -47
- package/src/generated/model/getProject200PasswordHashParamsHash.ts +0 -24
- package/src/generated/model/patchProject200OriginsItem.ts +0 -23
- package/src/generated/model/patchProject200OriginsItemKind.ts +0 -15
- package/src/generated/model/patchProject200PasswordHash.ts +0 -42
- package/src/generated/model/patchProject200PasswordHashAlgorithm.ts +0 -24
- package/src/generated/model/patchProject200PasswordHashParams.ts +0 -47
- package/src/generated/model/patchProject200PasswordHashParamsHash.ts +0 -24
|
@@ -81,7 +81,6 @@ import type {
|
|
|
81
81
|
GetFlowStep200,
|
|
82
82
|
GetGrant200,
|
|
83
83
|
GetGrantParams,
|
|
84
|
-
GetHealthDefault,
|
|
85
84
|
GetIdpById200,
|
|
86
85
|
GetIdpByIdParams,
|
|
87
86
|
GetIdpRevisionById200,
|
|
@@ -97,6 +96,10 @@ import type {
|
|
|
97
96
|
GetMyUserParams,
|
|
98
97
|
GetMyUserSchema200,
|
|
99
98
|
GetMyUserSchemaParams,
|
|
99
|
+
GetPolicy200,
|
|
100
|
+
GetPolicyParams,
|
|
101
|
+
GetPolicyRevision200,
|
|
102
|
+
GetPolicyRevisionParams,
|
|
100
103
|
GetProject200,
|
|
101
104
|
GetReadyDefault,
|
|
102
105
|
GetReleaseById200,
|
|
@@ -133,8 +136,14 @@ import type {
|
|
|
133
136
|
ListMyProjectsParams,
|
|
134
137
|
ListMyTeams200,
|
|
135
138
|
ListMyTeamsParams,
|
|
139
|
+
ListPolicies200,
|
|
140
|
+
ListPoliciesParams,
|
|
141
|
+
ListPolicyRevisions200,
|
|
142
|
+
ListPolicyRevisionsParams,
|
|
136
143
|
ListPreviews200,
|
|
137
144
|
ListPreviewsParams,
|
|
145
|
+
ListProjectAdmins200,
|
|
146
|
+
ListProjectAdminsParams,
|
|
138
147
|
ListReleases200,
|
|
139
148
|
ListReleasesParams,
|
|
140
149
|
ListSchemas200,
|
|
@@ -152,6 +161,9 @@ import type {
|
|
|
152
161
|
PatchProjectBody,
|
|
153
162
|
PatchUserByID200,
|
|
154
163
|
PatchUserByIDBody,
|
|
164
|
+
PublishPolicy201,
|
|
165
|
+
PublishPolicyBody,
|
|
166
|
+
PublishPolicyParams,
|
|
155
167
|
QueryGrants200,
|
|
156
168
|
QueryGrantsBody,
|
|
157
169
|
QueryGrantsParams,
|
|
@@ -192,31 +204,6 @@ import type {
|
|
|
192
204
|
|
|
193
205
|
import { customFetch } from '../../runtime/fetch.ts';
|
|
194
206
|
|
|
195
|
-
export const getGetHealthUrl = () => {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return `${getProxyPath()}/healthz`
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Check whether the server is healthy
|
|
205
|
-
* @summary Check server health
|
|
206
|
-
*/
|
|
207
|
-
export const getHealth = async ( options?: Parameters<typeof customFetch>[1]): Promise<GetHealthDefault> => {
|
|
208
|
-
|
|
209
|
-
return customFetch<GetHealthDefault>(getGetHealthUrl(),
|
|
210
|
-
{
|
|
211
|
-
...options,
|
|
212
|
-
method: 'GET'
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
);}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
207
|
export const getGetLiveUrl = () => {
|
|
221
208
|
|
|
222
209
|
|
|
@@ -226,7 +213,11 @@ export const getGetLiveUrl = () => {
|
|
|
226
213
|
}
|
|
227
214
|
|
|
228
215
|
/**
|
|
229
|
-
*
|
|
216
|
+
* Answers `ok` while the server process serves HTTP, and checks nothing behind it.
|
|
217
|
+
*
|
|
218
|
+
* Point a liveness probe here. It never checks the database, so an outage
|
|
219
|
+
* of the database does not restart every instance; `GET /readyz` takes an
|
|
220
|
+
* instance out of rotation instead.
|
|
230
221
|
* @summary Check server liveness
|
|
231
222
|
*/
|
|
232
223
|
export const getLive = async ( options?: Parameters<typeof customFetch>[1]): Promise<GetLiveDefault> => {
|
|
@@ -251,7 +242,11 @@ export const getGetReadyUrl = () => {
|
|
|
251
242
|
}
|
|
252
243
|
|
|
253
244
|
/**
|
|
254
|
-
*
|
|
245
|
+
* Answers whether the server can serve requests, which takes its database answering within a second.
|
|
246
|
+
*
|
|
247
|
+
* Point a readiness probe here, so that a server whose database does not
|
|
248
|
+
* answer gets no requests until it does. The check is one round trip to the
|
|
249
|
+
* database.
|
|
255
250
|
* @summary Check server readiness
|
|
256
251
|
*/
|
|
257
252
|
export const getReady = async ( options?: Parameters<typeof customFetch>[1]): Promise<GetReadyDefault> => {
|
|
@@ -972,14 +967,20 @@ export const getListMyProjectsUrl = (params?: ListMyProjectsParams,) => {
|
|
|
972
967
|
}
|
|
973
968
|
|
|
974
969
|
/**
|
|
975
|
-
* The projects the signed-in user
|
|
976
|
-
* through a team they are a member of.
|
|
977
|
-
*
|
|
970
|
+
* The projects the signed-in user can act on: those they hold an active grant
|
|
971
|
+
* on, either directly or through a team they are a member of. For a platform
|
|
972
|
+
* operator (ADR 075) that is every project of the deployment. Ordered by
|
|
973
|
+
* project id and paged with an opaque cursor.
|
|
978
974
|
*
|
|
979
975
|
* This is not the same question as `queryProjects`, which answers with the one
|
|
980
976
|
* project the calling credential is bound to. Here the session is the caller
|
|
981
977
|
* and the grants are the answer, so the list spans projects.
|
|
982
978
|
*
|
|
979
|
+
* With `name_contains`, only the projects whose name contains that text are
|
|
980
|
+
* listed. The search runs on the server together with the grants, so it
|
|
981
|
+
* reaches every project the user can act on, however many there are, and
|
|
982
|
+
* pages like the full list.
|
|
983
|
+
*
|
|
983
984
|
* With `project_id`, the projects are listed only when the session belongs to
|
|
984
985
|
* that project. It names the project the session was signed in to, not one to
|
|
985
986
|
* list.
|
|
@@ -1092,7 +1093,10 @@ export const getCreateFlowUrl = () => {
|
|
|
1092
1093
|
* pattern with no live preview answers `403` with `proj.preview_not_live`;
|
|
1093
1094
|
* nothing deployed to the target answers `409` with `rel.not_deployed`; a
|
|
1094
1095
|
* revoked release answers `409` with `rel.revoked`. A request with no
|
|
1095
|
-
* `Origin` passes the gate and still needs a deployment target.
|
|
1096
|
+
* `Origin` passes the gate and still needs a deployment target. A loopback
|
|
1097
|
+
* origin passes it too, and so does the server's own origin, from which its
|
|
1098
|
+
* console previews a project's login; a step submitted from the server's
|
|
1099
|
+
* own origin is still refused unless the project lists it.
|
|
1096
1100
|
*
|
|
1097
1101
|
* The response contains an `id` field — the flow handle. Use it as the path
|
|
1098
1102
|
* parameter for all subsequent `/flow/{id}/submit` calls.
|
|
@@ -1269,10 +1273,10 @@ export const getCreateAuthAttemptUrl = () => {
|
|
|
1269
1273
|
* also include session_id and that session's session_token to add factors to an existing session.
|
|
1270
1274
|
*
|
|
1271
1275
|
* The project comes from the project secret. A body `project_id` that disagrees
|
|
1272
|
-
* answers `403` with `proj.mismatch`.
|
|
1273
|
-
*
|
|
1274
|
-
*
|
|
1275
|
-
*
|
|
1276
|
+
* answers `403` with `proj.mismatch`. Sealed `deployment_id` / `release_id` are
|
|
1277
|
+
* filled only when create runs with a runtime resolution already on the
|
|
1278
|
+
* context (the flow create path); this HTTP entry point does not resolve
|
|
1279
|
+
* Origin or refuse a revoked release itself.
|
|
1276
1280
|
* @summary Create a new authentication attempt
|
|
1277
1281
|
*/
|
|
1278
1282
|
export const createAuthAttempt = async (createAuthAttemptBody: CreateAuthAttemptBody, options?: Parameters<typeof customFetch>[1]): Promise<CreateAuthAttempt201> => {
|
|
@@ -1318,9 +1322,6 @@ export const getGetAuthAttemptUrl = (attemptId: string,) => {
|
|
|
1318
1322
|
*
|
|
1319
1323
|
* Use this for polling during long-running factor verifications (e.g., waiting for
|
|
1320
1324
|
* a federated IdP callback or a device flow).
|
|
1321
|
-
*
|
|
1322
|
-
* Reuses the deployment sealed when the attempt was created. If that release
|
|
1323
|
-
* was revoked since, the response is `409` with `rel.revoked`.
|
|
1324
1325
|
* @summary Get authentication attempt state
|
|
1325
1326
|
*/
|
|
1326
1327
|
export const getAuthAttempt = async (attemptId: string, options?: Parameters<typeof customFetch>[1]): Promise<GetAuthAttempt200> => {
|
|
@@ -1351,9 +1352,6 @@ export const getIssueChallengeUrl = (attemptId: string,) => {
|
|
|
1351
1352
|
* (password, passkey, TOTP, OTP via SMS, etc.). The server responds with challenge details
|
|
1352
1353
|
* including method, metadata, and any UI hints. The client then verifies the proof
|
|
1353
1354
|
* by calling POST /auth_attempts/{attempt_id}/challenges/{challenge_id}/verify.
|
|
1354
|
-
*
|
|
1355
|
-
* Reuses the deployment sealed when the attempt was created. If that release
|
|
1356
|
-
* was revoked since, the response is `409` with `rel.revoked`.
|
|
1357
1355
|
* @summary Issue a factor challenge
|
|
1358
1356
|
*/
|
|
1359
1357
|
export const issueChallenge = async (attemptId: string,
|
|
@@ -1404,9 +1402,6 @@ export const getVerifyChallengeProofUrl = (attemptId: string,
|
|
|
1404
1402
|
*
|
|
1405
1403
|
* On successful verification, the factor is written to the auth attempt.
|
|
1406
1404
|
* The attempt moves to the next pending challenge or completes if all required factors are verified.
|
|
1407
|
-
*
|
|
1408
|
-
* Reuses the deployment sealed when the attempt was created. If that release
|
|
1409
|
-
* was revoked since, the response is `409` with `rel.revoked`.
|
|
1410
1405
|
* @summary Verify a factor proof
|
|
1411
1406
|
*/
|
|
1412
1407
|
export const verifyChallengeProof = async (attemptId: string,
|
|
@@ -1458,8 +1453,7 @@ export const getCreateHandoffUrl = (attemptId: string,) => {
|
|
|
1458
1453
|
* - Audience-bound (requires matching project key for exchange)
|
|
1459
1454
|
* - Idempotency-safe within a 5-minute window (see conventions)
|
|
1460
1455
|
*
|
|
1461
|
-
*
|
|
1462
|
-
* was revoked since, the response is `409` with `rel.revoked`.
|
|
1456
|
+
* Revoke refusal for a sealed release happens at handoff exchange, not here.
|
|
1463
1457
|
* @summary Complete authentication and create handoff token
|
|
1464
1458
|
*/
|
|
1465
1459
|
export const createHandoff = async (attemptId: string, options?: Parameters<typeof customFetch>[1]): Promise<CreateHandoff200> => {
|
|
@@ -1628,6 +1622,67 @@ return customFetch<PatchProject200>(getPatchProjectUrl(projectId),
|
|
|
1628
1622
|
|
|
1629
1623
|
|
|
1630
1624
|
|
|
1625
|
+
export const getListProjectAdminsUrl = (projectId: string,
|
|
1626
|
+
params?: ListProjectAdminsParams,) => {
|
|
1627
|
+
const normalizedParams = new URLSearchParams();
|
|
1628
|
+
|
|
1629
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1630
|
+
|
|
1631
|
+
if (value !== undefined) {
|
|
1632
|
+
normalizedParams.append(key, value === null ? 'null' : String(value))
|
|
1633
|
+
}
|
|
1634
|
+
});
|
|
1635
|
+
|
|
1636
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1637
|
+
|
|
1638
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/projects/${encodeURIComponent(String(projectId))}/admins?${stringifiedParams}` : `${getProxyPath()}/projects/${encodeURIComponent(String(projectId))}/admins`
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* Lists the people who can administer the project, and how each of them
|
|
1643
|
+
* gets that access. A person appears once, with one entry in `sources` per
|
|
1644
|
+
* way they hold it:
|
|
1645
|
+
*
|
|
1646
|
+
* - `owning_team`: an active member of the team that owns the project
|
|
1647
|
+
* (ADR 054 §2). Removing a grant does not remove this access; it ends
|
|
1648
|
+
* only when the person leaves the team or the project changes owner.
|
|
1649
|
+
* - `grant`: an unexpired `admin` grant on the project, either to the
|
|
1650
|
+
* person (`grant_id` only) or to a team they are an active member of
|
|
1651
|
+
* (`grant_id` and `team`). Revoking that grant removes this source.
|
|
1652
|
+
*
|
|
1653
|
+
* The list follows the authorization check: team membership is read from
|
|
1654
|
+
* the same membership projection the check expands, so a person who left a
|
|
1655
|
+
* team, or whose team or user was deactivated, is not listed through it.
|
|
1656
|
+
* Grants that expired or carry a lower role are left out. A person whose
|
|
1657
|
+
* only access is a `viewer` or `editor` grant is not an admin and is not
|
|
1658
|
+
* listed. Like the check, the list does not look at a person's user status
|
|
1659
|
+
* beyond that, so a direct grant to a suspended person is listed.
|
|
1660
|
+
*
|
|
1661
|
+
* A person whose access comes only through teams the caller is not a
|
|
1662
|
+
* member of is left out, and a team the caller is not in is named by
|
|
1663
|
+
* `team_id` only. The grant to such a team still shows in the project's
|
|
1664
|
+
* grants.
|
|
1665
|
+
*
|
|
1666
|
+
* Ordered by `user_id` and paginated with `page_token`.
|
|
1667
|
+
*
|
|
1668
|
+
* Accepts either a project secret (`oauth2`) or a user-bound Console
|
|
1669
|
+
* session cookie (`nextgenSession`) that can read the project.
|
|
1670
|
+
* @summary List project admins
|
|
1671
|
+
*/
|
|
1672
|
+
export const listProjectAdmins = async (projectId: string,
|
|
1673
|
+
params?: ListProjectAdminsParams, options?: Parameters<typeof customFetch>[1]): Promise<ListProjectAdmins200> => {
|
|
1674
|
+
|
|
1675
|
+
return customFetch<ListProjectAdmins200>(getListProjectAdminsUrl(projectId,params),
|
|
1676
|
+
{
|
|
1677
|
+
...options,
|
|
1678
|
+
method: 'GET'
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
}
|
|
1682
|
+
);}
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
|
|
1631
1686
|
export const getInitClaimUrl = (projectId: string,) => {
|
|
1632
1687
|
|
|
1633
1688
|
|
|
@@ -3109,6 +3164,219 @@ export const getIdpRevisionById = async (revisionId: string,
|
|
|
3109
3164
|
|
|
3110
3165
|
|
|
3111
3166
|
|
|
3167
|
+
export const getListPoliciesUrl = (params: ListPoliciesParams,) => {
|
|
3168
|
+
const normalizedParams = new URLSearchParams();
|
|
3169
|
+
|
|
3170
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
3171
|
+
|
|
3172
|
+
if (value !== undefined) {
|
|
3173
|
+
normalizedParams.append(key, value === null ? 'null' : String(value))
|
|
3174
|
+
}
|
|
3175
|
+
});
|
|
3176
|
+
|
|
3177
|
+
const stringifiedParams = normalizedParams.toString();
|
|
3178
|
+
|
|
3179
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/policies?${stringifiedParams}` : `${getProxyPath()}/policies`
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
/**
|
|
3183
|
+
* Lists the project's policies, one per operation, each as its newest
|
|
3184
|
+
* revision, ordered by `created_at` (first publish) and then `id`. Filter
|
|
3185
|
+
* by `operation` to read the policy of one operation; a project that never
|
|
3186
|
+
* published one gets an empty list.
|
|
3187
|
+
*
|
|
3188
|
+
* The lookup is scoped to the project in `project_id`.
|
|
3189
|
+
* @summary List policies
|
|
3190
|
+
*/
|
|
3191
|
+
export const listPolicies = async (params: ListPoliciesParams, options?: Parameters<typeof customFetch>[1]): Promise<ListPolicies200> => {
|
|
3192
|
+
|
|
3193
|
+
return customFetch<ListPolicies200>(getListPoliciesUrl(params),
|
|
3194
|
+
{
|
|
3195
|
+
...options,
|
|
3196
|
+
method: 'GET'
|
|
3197
|
+
|
|
3198
|
+
|
|
3199
|
+
}
|
|
3200
|
+
);}
|
|
3201
|
+
|
|
3202
|
+
|
|
3203
|
+
|
|
3204
|
+
export const getPublishPolicyUrl = (params: PublishPolicyParams,) => {
|
|
3205
|
+
const normalizedParams = new URLSearchParams();
|
|
3206
|
+
|
|
3207
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
3208
|
+
|
|
3209
|
+
if (value !== undefined) {
|
|
3210
|
+
normalizedParams.append(key, value === null ? 'null' : String(value))
|
|
3211
|
+
}
|
|
3212
|
+
});
|
|
3213
|
+
|
|
3214
|
+
const stringifiedParams = normalizedParams.toString();
|
|
3215
|
+
|
|
3216
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/policies?${stringifiedParams}` : `${getProxyPath()}/policies`
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
/**
|
|
3220
|
+
* Publishes the project's policy for an operation as a new immutable
|
|
3221
|
+
* revision, creating the policy on its first publish. The newest revision
|
|
3222
|
+
* applies to the next time the operation runs; nothing already stored is
|
|
3223
|
+
* re-evaluated, so a stricter password policy applies the next time a
|
|
3224
|
+
* password is set.
|
|
3225
|
+
*
|
|
3226
|
+
* The request is typed by `operation`: an unknown operation or setting, or
|
|
3227
|
+
* a value of the wrong type or outside its bounds, answers `req.invalid`
|
|
3228
|
+
* like any malformed request. The operation's template then checks the
|
|
3229
|
+
* config again, together with the rules that relate settings to each other
|
|
3230
|
+
* (a `min_length` above `max_length`), and answers `pol.invalid`. Its
|
|
3231
|
+
* `details.details.violations` lists everything that failed, settings
|
|
3232
|
+
* first, then rules: `{"setting": "min_length"}` for one setting, or
|
|
3233
|
+
* `{"config_rule": "min_length_not_above_max_length", "settings":
|
|
3234
|
+
* ["min_length", "max_length"]}` for a rule across settings, with the
|
|
3235
|
+
* settings it reads. A setting left out is off, and `{}` switches every
|
|
3236
|
+
* rule off; there are no defaults.
|
|
3237
|
+
* @summary Publish a policy
|
|
3238
|
+
*/
|
|
3239
|
+
export const publishPolicy = async (publishPolicyBody: PublishPolicyBody,
|
|
3240
|
+
params: PublishPolicyParams, options?: Parameters<typeof customFetch>[1]): Promise<PublishPolicy201> => {
|
|
3241
|
+
|
|
3242
|
+
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
|
3243
|
+
if (!h) return {};
|
|
3244
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
3245
|
+
if (Symbol.iterator in h) {
|
|
3246
|
+
return Object.fromEntries(
|
|
3247
|
+
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
|
3248
|
+
);
|
|
3249
|
+
}
|
|
3250
|
+
const headers: Record<string, string | readonly string[]> = {};
|
|
3251
|
+
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
|
3252
|
+
if (value !== undefined) headers[name] = value;
|
|
3253
|
+
}
|
|
3254
|
+
return headers;
|
|
3255
|
+
};
|
|
3256
|
+
return customFetch<PublishPolicy201>(getPublishPolicyUrl(params),
|
|
3257
|
+
{
|
|
3258
|
+
...options,
|
|
3259
|
+
method: 'POST',
|
|
3260
|
+
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
|
3261
|
+
body: JSON.stringify(publishPolicyBody)
|
|
3262
|
+
}
|
|
3263
|
+
);}
|
|
3264
|
+
|
|
3265
|
+
|
|
3266
|
+
|
|
3267
|
+
export const getGetPolicyUrl = (policyId: string,
|
|
3268
|
+
params: GetPolicyParams,) => {
|
|
3269
|
+
const normalizedParams = new URLSearchParams();
|
|
3270
|
+
|
|
3271
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
3272
|
+
|
|
3273
|
+
if (value !== undefined) {
|
|
3274
|
+
normalizedParams.append(key, value === null ? 'null' : String(value))
|
|
3275
|
+
}
|
|
3276
|
+
});
|
|
3277
|
+
|
|
3278
|
+
const stringifiedParams = normalizedParams.toString();
|
|
3279
|
+
|
|
3280
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/policies/${encodeURIComponent(String(policyId))}?${stringifiedParams}` : `${getProxyPath()}/policies/${encodeURIComponent(String(policyId))}`
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
/**
|
|
3284
|
+
* Reads a policy as its newest revision, the one that applies the next time
|
|
3285
|
+
* its operation runs.
|
|
3286
|
+
*
|
|
3287
|
+
* The lookup is scoped to the project in `project_id`: a policy of another
|
|
3288
|
+
* project answers not found exactly as an unknown id does.
|
|
3289
|
+
* @summary Get a policy
|
|
3290
|
+
*/
|
|
3291
|
+
export const getPolicy = async (policyId: string,
|
|
3292
|
+
params: GetPolicyParams, options?: Parameters<typeof customFetch>[1]): Promise<GetPolicy200> => {
|
|
3293
|
+
|
|
3294
|
+
return customFetch<GetPolicy200>(getGetPolicyUrl(policyId,params),
|
|
3295
|
+
{
|
|
3296
|
+
...options,
|
|
3297
|
+
method: 'GET'
|
|
3298
|
+
|
|
3299
|
+
|
|
3300
|
+
}
|
|
3301
|
+
);}
|
|
3302
|
+
|
|
3303
|
+
|
|
3304
|
+
|
|
3305
|
+
export const getListPolicyRevisionsUrl = (policyId: string,
|
|
3306
|
+
params: ListPolicyRevisionsParams,) => {
|
|
3307
|
+
const normalizedParams = new URLSearchParams();
|
|
3308
|
+
|
|
3309
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
3310
|
+
|
|
3311
|
+
if (value !== undefined) {
|
|
3312
|
+
normalizedParams.append(key, value === null ? 'null' : String(value))
|
|
3313
|
+
}
|
|
3314
|
+
});
|
|
3315
|
+
|
|
3316
|
+
const stringifiedParams = normalizedParams.toString();
|
|
3317
|
+
|
|
3318
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/policies/${encodeURIComponent(String(policyId))}/revisions?${stringifiedParams}` : `${getProxyPath()}/policies/${encodeURIComponent(String(policyId))}/revisions`
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3321
|
+
/**
|
|
3322
|
+
* Returns every revision of one policy, newest first, paginated with a
|
|
3323
|
+
* cursor. The order is fixed, so there is no `sorting`.
|
|
3324
|
+
*
|
|
3325
|
+
* The lookup is scoped to the project in `project_id`: a policy of another
|
|
3326
|
+
* project answers not found exactly as an unknown id does.
|
|
3327
|
+
* @summary List the revisions of a policy
|
|
3328
|
+
*/
|
|
3329
|
+
export const listPolicyRevisions = async (policyId: string,
|
|
3330
|
+
params: ListPolicyRevisionsParams, options?: Parameters<typeof customFetch>[1]): Promise<ListPolicyRevisions200> => {
|
|
3331
|
+
|
|
3332
|
+
return customFetch<ListPolicyRevisions200>(getListPolicyRevisionsUrl(policyId,params),
|
|
3333
|
+
{
|
|
3334
|
+
...options,
|
|
3335
|
+
method: 'GET'
|
|
3336
|
+
|
|
3337
|
+
|
|
3338
|
+
}
|
|
3339
|
+
);}
|
|
3340
|
+
|
|
3341
|
+
|
|
3342
|
+
|
|
3343
|
+
export const getGetPolicyRevisionUrl = (revisionId: string,
|
|
3344
|
+
params: GetPolicyRevisionParams,) => {
|
|
3345
|
+
const normalizedParams = new URLSearchParams();
|
|
3346
|
+
|
|
3347
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
3348
|
+
|
|
3349
|
+
if (value !== undefined) {
|
|
3350
|
+
normalizedParams.append(key, value === null ? 'null' : String(value))
|
|
3351
|
+
}
|
|
3352
|
+
});
|
|
3353
|
+
|
|
3354
|
+
const stringifiedParams = normalizedParams.toString();
|
|
3355
|
+
|
|
3356
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/policies/revisions/${encodeURIComponent(String(revisionId))}?${stringifiedParams}` : `${getProxyPath()}/policies/revisions/${encodeURIComponent(String(revisionId))}`
|
|
3357
|
+
}
|
|
3358
|
+
|
|
3359
|
+
/**
|
|
3360
|
+
* Reads one revision of a policy, newest or not.
|
|
3361
|
+
*
|
|
3362
|
+
* The lookup is scoped to the project in `project_id`: a revision of another
|
|
3363
|
+
* project answers not found exactly as an unknown id does.
|
|
3364
|
+
* @summary Get a policy revision
|
|
3365
|
+
*/
|
|
3366
|
+
export const getPolicyRevision = async (revisionId: string,
|
|
3367
|
+
params: GetPolicyRevisionParams, options?: Parameters<typeof customFetch>[1]): Promise<GetPolicyRevision200> => {
|
|
3368
|
+
|
|
3369
|
+
return customFetch<GetPolicyRevision200>(getGetPolicyRevisionUrl(revisionId,params),
|
|
3370
|
+
{
|
|
3371
|
+
...options,
|
|
3372
|
+
method: 'GET'
|
|
3373
|
+
|
|
3374
|
+
|
|
3375
|
+
}
|
|
3376
|
+
);}
|
|
3377
|
+
|
|
3378
|
+
|
|
3379
|
+
|
|
3112
3380
|
export const getCreateReleaseUrl = (params: CreateReleaseParams,) => {
|
|
3113
3381
|
const normalizedParams = new URLSearchParams();
|
|
3114
3382
|
|
|
@@ -3241,7 +3509,9 @@ export const getBuildReleaseUrl = (params: BuildReleaseParams,) => {
|
|
|
3241
3509
|
* allocates nothing, however long ago it was built. Otherwise every resource is compared against the
|
|
3242
3510
|
* project's newest revision of the same handle: unchanged content reuses
|
|
3243
3511
|
* that revision, changed content allocates a new one, and the request
|
|
3244
|
-
* answers `201` with the new release.
|
|
3512
|
+
* answers `201` with the new release. A policy whose config matches only an
|
|
3513
|
+
* older revision allocates a new one too, so a request that resolves no
|
|
3514
|
+
* release, which reads the newest revision, applies it as well. Metadata is excluded from the
|
|
3245
3515
|
* comparison, so the same content under a different `message` is the same
|
|
3246
3516
|
* release.
|
|
3247
3517
|
*
|
|
@@ -3255,8 +3525,8 @@ export const getBuildReleaseUrl = (params: BuildReleaseParams,) => {
|
|
|
3255
3525
|
*
|
|
3256
3526
|
* Building writes revisions, so besides `release.write` it needs the write
|
|
3257
3527
|
* scope of every kind the bundle carries a resource of: `schema.write`,
|
|
3258
|
-
* `flow_definition.write`, `branding.write
|
|
3259
|
-
* per-kind create endpoints do. A missing scope answers `403` with `rel.permission_denied`,
|
|
3528
|
+
* `flow_definition.write`, `branding.write`, `idp.write` and
|
|
3529
|
+
* `policy.write`, as the per-kind create endpoints do. A missing scope answers `403` with `rel.permission_denied`,
|
|
3260
3530
|
* naming the kind. An empty kind needs no scope.
|
|
3261
3531
|
*
|
|
3262
3532
|
* Building a release does not deploy it. A release is not tied to an
|
|
@@ -3910,11 +4180,11 @@ export const getCreateDeploymentUrl = (params: CreateDeploymentParams,) => {
|
|
|
3910
4180
|
* - `400 dep.invalid`: both or neither of `release_id` and `content_hash`;
|
|
3911
4181
|
* a primary origin named exactly; `primary` mixed with preview URLs;
|
|
3912
4182
|
* `primary` on a project with no primary origin; `ttl` with `primary`;
|
|
3913
|
-
* `ttl` above
|
|
4183
|
+
* `ttl` above 365 days (`P365D`).
|
|
3914
4184
|
* - `400 dep.variables_missing`: a referenced variable has no value for
|
|
3915
4185
|
* the kind; `details` names the kind and every missing variable.
|
|
3916
4186
|
* - `403 proj.origin_not_allowed`: a preview URL matches no preview
|
|
3917
|
-
* pattern.
|
|
4187
|
+
* pattern, or is a loopback URL.
|
|
3918
4188
|
* - `404 rel.not_found`: the release id or digest names no release here.
|
|
3919
4189
|
* - `409 dep.conflict`: `expected_deployment_id` is not the deployment
|
|
3920
4190
|
* this write replaces; `details.deployment` is that deployment.
|