@leaflow/sdk 0.0.0-dev.367.g5d66ccc → 0.0.0-dev.371.gc7cf9b8
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/account/v1/generated/functions.d.ts +76 -2
- package/dist/account/v1/generated/functions.js +77 -1
- package/dist/account/v1/generated/models.d.ts +88 -43
- package/dist/account/v1/generated/models.js +19 -9
- package/dist/account/v1/generated/schemas.zod.d.ts +15 -1
- package/dist/account/v1/generated/schemas.zod.js +14 -1
- package/dist/account/v1/generated/validators/accountDeletionObjectionResource.zod.d.ts +32 -0
- package/dist/account/v1/generated/validators/accountDeletionObjectionResource.zod.js +32 -0
- package/dist/account/v1/generated/validators/accountDeletionResource.zod.d.ts +69 -0
- package/dist/account/v1/generated/validators/accountDeletionResource.zod.js +53 -0
- package/dist/account/v1/generated/validators/accountDeletionState.zod.d.ts +34 -0
- package/dist/account/v1/generated/validators/accountDeletionState.zod.js +29 -0
- package/dist/account/v1/generated/validators/requestAccountDeletionRequestBody.zod.d.ts +31 -0
- package/dist/account/v1/generated/validators/requestAccountDeletionRequestBody.zod.js +31 -0
- package/dist/assistant/v1/generated/validators/platformListResponseBody.zod.d.ts +1 -1
- package/dist/assistant/v1/generated/validators/platformResource.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/models.d.ts +29 -0
- package/dist/billing/type/order/v1/generated/models.js +9 -0
- package/dist/billing/type/order/v1/generated/validators/accountDeletionObjection.zod.d.ts +19 -0
- package/dist/billing/type/order/v1/generated/validators/accountDeletionObjection.zod.js +19 -0
- package/dist/billing/type/order/v1/generated/validators/accountDeletionReadiness.zod.d.ts +45 -0
- package/dist/billing/type/order/v1/generated/validators/accountDeletionReadiness.zod.js +14 -0
- package/dist/billing/type/order/v1/generated/validators/accountDeletionReadinessItem.zod.d.ts +43 -0
- package/dist/billing/type/order/v1/generated/validators/accountDeletionReadinessItem.zod.js +19 -0
- package/dist/billing/type/order/v1/generated/validators/cancellation.zod.d.ts +2 -2
- package/dist/billing/type/order/v1/generated/validators/cancellationItem.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/cancellationList.zod.d.ts +2 -2
- package/dist/billing/type/order/v1/generated/validators/contact.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/contactList.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/discount.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/discountList.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/featureGrant.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/featureGrantList.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/featureGrantStatus.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/invoice.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/invoiceList.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/subscription.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/subscriptionCancellation.zod.d.ts +1 -1
- package/dist/billing/type/order/v1/generated/validators/subscriptionList.zod.d.ts +1 -1
- package/dist/billing/v1/generated/functions.d.ts +34 -8
- package/dist/billing/v1/generated/functions.js +28 -7
- package/dist/billing/v1/generated/models.d.ts +29 -0
- package/dist/billing/v1/generated/models.js +9 -0
- package/dist/billing/v1/generated/schemas.zod.d.ts +9 -9
- package/dist/billing/v1/generated/schemas.zod.js +7 -7
- package/dist/billing/v1/generated/validators/accountDeletionObjection.zod.d.ts +19 -0
- package/dist/billing/v1/generated/validators/accountDeletionObjection.zod.js +19 -0
- package/dist/billing/v1/generated/validators/accountDeletionReadiness.zod.d.ts +45 -0
- package/dist/billing/v1/generated/validators/accountDeletionReadiness.zod.js +14 -0
- package/dist/billing/v1/generated/validators/accountDeletionReadinessItem.zod.d.ts +43 -0
- package/dist/billing/v1/generated/validators/accountDeletionReadinessItem.zod.js +19 -0
- package/dist/billing/v1/generated/validators/cancellation.zod.d.ts +2 -2
- package/dist/billing/v1/generated/validators/cancellationItem.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/cancellationList.zod.d.ts +2 -2
- package/dist/billing/v1/generated/validators/contact.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/contactList.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/discount.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/discountList.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/featureGrant.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/featureGrantList.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/featureGrantStatus.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/invoice.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/invoiceList.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/listCancellationsParams.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/listFeatureGrantsParams.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/subscription.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/subscriptionCancellation.zod.d.ts +1 -1
- package/dist/billing/v1/generated/validators/subscriptionList.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/models.d.ts +29 -0
- package/dist/canopy/v1/generated/models.js +9 -0
- package/dist/canopy/v1/generated/validators/accountDeletionObjection.zod.d.ts +52 -0
- package/dist/canopy/v1/generated/validators/accountDeletionObjection.zod.js +52 -0
- package/dist/canopy/v1/generated/validators/accountDeletionReadiness.zod.d.ts +78 -0
- package/dist/canopy/v1/generated/validators/accountDeletionReadiness.zod.js +47 -0
- package/dist/canopy/v1/generated/validators/accountDeletionReadinessItem.zod.d.ts +76 -0
- package/dist/canopy/v1/generated/validators/accountDeletionReadinessItem.zod.js +52 -0
- package/dist/canopy/v1/generated/validators/cancellation.zod.d.ts +2 -2
- package/dist/canopy/v1/generated/validators/cancellationItem.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/cancellationList.zod.d.ts +2 -2
- package/dist/canopy/v1/generated/validators/contact.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/contactList.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/discount.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/discountList.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/featureGrant.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/featureGrantList.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/featureGrantStatus.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/invoice.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/invoiceList.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/subscription.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/subscriptionCancellation.zod.d.ts +1 -1
- package/dist/canopy/v1/generated/validators/subscriptionList.zod.d.ts +1 -1
- package/dist/membership/v1/generated/functions.d.ts +3 -3
- package/dist/membership/v1/generated/functions.js +3 -3
- package/dist/membership/v1/generated/models.d.ts +29 -0
- package/dist/membership/v1/generated/models.js +9 -0
- package/dist/membership/v1/generated/schemas.zod.d.ts +3 -3
- package/dist/membership/v1/generated/schemas.zod.js +3 -3
- package/dist/membership/v1/generated/validators/accountDeletionObjection.zod.d.ts +19 -0
- package/dist/membership/v1/generated/validators/accountDeletionObjection.zod.js +19 -0
- package/dist/membership/v1/generated/validators/accountDeletionReadiness.zod.d.ts +45 -0
- package/dist/membership/v1/generated/validators/accountDeletionReadiness.zod.js +14 -0
- package/dist/membership/v1/generated/validators/accountDeletionReadinessItem.zod.d.ts +43 -0
- package/dist/membership/v1/generated/validators/accountDeletionReadinessItem.zod.js +19 -0
- package/dist/membership/v1/generated/validators/cancellation.zod.d.ts +2 -2
- package/dist/membership/v1/generated/validators/cancellationItem.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/cancellationList.zod.d.ts +2 -2
- package/dist/membership/v1/generated/validators/contact.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/contactList.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/discount.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/discountList.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/featureGrant.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/featureGrantList.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/featureGrantStatus.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/invoice.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/invoiceList.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/subscription.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/subscriptionCancellation.zod.d.ts +1 -1
- package/dist/membership/v1/generated/validators/subscriptionList.zod.d.ts +1 -1
- package/dist/routes.d.ts +32 -0
- package/dist/routes.js +36 -0
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* Looking up slugs and claiming custom slugs are rate limited per account. A request over the limit fails with 429, and `meta.retry_after_seconds` on the error states how many seconds to wait before retrying.
|
|
24
24
|
* OpenAPI spec version: 1.0.0
|
|
25
25
|
*/
|
|
26
|
-
import type { AcceptConsentsRequestBody, AcceptInvitationByTokenRequestBody, AcceptedInvitationResponseBody, AccountResource, AgreementListResponseBody, ConsentListResponseBody, CreateProjectRequestBody, Error, IdentityVerificationResource, InvitationPreviewResource, LengthAwarePageInvitationResource, LengthAwarePageProjectAccessResource, ListMyInvitationsParams, ListProjectsParams, LocaleOptionsResource, PreviewInvitationByTokenParams, ProjectAccessList, ProjectAccessResource, ProjectSlugAvailabilityResource, RegisterRequestBody, ScopedTokenResponseBody, SearchProjectsRequestBody, SettingsResource, SubmitIdentityVerificationRequestBody, UpdateAccountRequestBody } from "./models.js";
|
|
26
|
+
import type { AcceptConsentsRequestBody, AcceptInvitationByTokenRequestBody, AcceptedInvitationResponseBody, AccountDeletionResource, AccountResource, AgreementListResponseBody, ConsentListResponseBody, CreateProjectRequestBody, Error, IdentityVerificationResource, InvitationPreviewResource, LengthAwarePageInvitationResource, LengthAwarePageProjectAccessResource, ListMyInvitationsParams, ListProjectsParams, LocaleOptionsResource, PreviewInvitationByTokenParams, ProjectAccessList, ProjectAccessResource, ProjectSlugAvailabilityResource, RegisterRequestBody, RequestAccountDeletionRequestBody, ScopedTokenResponseBody, SearchProjectsRequestBody, SettingsResource, SubmitIdentityVerificationRequestBody, UpdateAccountRequestBody } from "./models.js";
|
|
27
27
|
export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
|
|
28
28
|
export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
|
|
29
29
|
export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
|
|
@@ -166,7 +166,7 @@ export declare const getRegisterUrl: () => string;
|
|
|
166
166
|
/**
|
|
167
167
|
* Call this after signing in at auth.leaflow.net, carrying the access token. The name and email address are taken from the sign-in claims and are not read from the request body.
|
|
168
168
|
*
|
|
169
|
-
* `consents` must cover every agreement returned by `GET /account/v1/agreements`, at the same versions. A missing agreement answers 400 and a stale version answers 409, in which case fetch the list again. An account that already exists answers 409.
|
|
169
|
+
* `consents` must cover every agreement returned by `GET /account/v1/agreements`, at the same versions. A missing agreement answers 400 and a stale version answers 409, in which case fetch the list again. An account that already exists answers 409, and one that has been deleted answers 410 `USER_DELETED`: the same sign-in cannot register again.
|
|
170
170
|
* @summary Register an account
|
|
171
171
|
*/
|
|
172
172
|
export declare const register: (registerRequestBody: RegisterRequestBody, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<registerResponse>;
|
|
@@ -188,6 +188,8 @@ export type getAccountResponse = getAccountResponseSuccess | getAccountResponseE
|
|
|
188
188
|
export declare const getGetAccountUrl: () => string;
|
|
189
189
|
/**
|
|
190
190
|
* `pending_agreements` holds the agreements not yet consented to. While it is not empty, obtain consent and call `POST /account/v1/me/consents`.
|
|
191
|
+
*
|
|
192
|
+
* `status` is `DELETING` while a deletion is open; see `GET /account/v1/me/deletion`. A deleted account answers 410 `USER_DELETED`.
|
|
191
193
|
* @summary Get the current account
|
|
192
194
|
*/
|
|
193
195
|
export declare const getAccount: (options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getAccountResponse>;
|
|
@@ -212,6 +214,78 @@ export declare const getUpdateAccountUrl: () => string;
|
|
|
212
214
|
* @summary Update the country and language of the current account
|
|
213
215
|
*/
|
|
214
216
|
export declare const updateAccount: (updateAccountRequestBody: UpdateAccountRequestBody, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<updateAccountResponse>;
|
|
217
|
+
export type getAccountDeletionResponse200 = {
|
|
218
|
+
data: AccountDeletionResource;
|
|
219
|
+
status: 200;
|
|
220
|
+
};
|
|
221
|
+
export type getAccountDeletionResponseDefault = {
|
|
222
|
+
data: Error;
|
|
223
|
+
status: Exclude<HTTPStatusCodes, 200>;
|
|
224
|
+
};
|
|
225
|
+
export type getAccountDeletionResponseSuccess = getAccountDeletionResponse200 & {
|
|
226
|
+
headers: Headers;
|
|
227
|
+
};
|
|
228
|
+
export type getAccountDeletionResponseError = getAccountDeletionResponseDefault & {
|
|
229
|
+
headers: Headers;
|
|
230
|
+
};
|
|
231
|
+
export type getAccountDeletionResponse = getAccountDeletionResponseSuccess | getAccountDeletionResponseError;
|
|
232
|
+
export declare const getGetAccountDeletionUrl: () => string;
|
|
233
|
+
/**
|
|
234
|
+
* `state` is `none` while no deletion is open. `blocking_projects` lists the projects the caller still owns; a deletion cannot be requested while it is not empty, so each of them must be transferred or deleted first.
|
|
235
|
+
*
|
|
236
|
+
* Conditions held by other services, such as an unpaid balance or a billing account still paying for a project, are not listed here. Read them from those services before requesting; they are checked again after the request, and a refusal shows up in `rejected_at` and `objections`.
|
|
237
|
+
* @summary Get the deletion of the current account
|
|
238
|
+
*/
|
|
239
|
+
export declare const getAccountDeletion: (options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getAccountDeletionResponse>;
|
|
240
|
+
export type requestAccountDeletionResponse202 = {
|
|
241
|
+
data: AccountDeletionResource;
|
|
242
|
+
status: 202;
|
|
243
|
+
};
|
|
244
|
+
export type requestAccountDeletionResponseDefault = {
|
|
245
|
+
data: Error;
|
|
246
|
+
status: Exclude<HTTPStatusCodes, 202>;
|
|
247
|
+
};
|
|
248
|
+
export type requestAccountDeletionResponseSuccess = requestAccountDeletionResponse202 & {
|
|
249
|
+
headers: Headers;
|
|
250
|
+
};
|
|
251
|
+
export type requestAccountDeletionResponseError = requestAccountDeletionResponseDefault & {
|
|
252
|
+
headers: Headers;
|
|
253
|
+
};
|
|
254
|
+
export type requestAccountDeletionResponse = requestAccountDeletionResponseSuccess | requestAccountDeletionResponseError;
|
|
255
|
+
export declare const getRequestAccountDeletionUrl: () => string;
|
|
256
|
+
/**
|
|
257
|
+
* The account is frozen at once: it can no longer enter a project or change anything in one. The answer is 202 with `state` `checking` while the services holding data for the account are asked whether it can be closed. Poll `GET /account/v1/me/deletion` until `state` leaves `checking`, which normally takes a few seconds.
|
|
258
|
+
*
|
|
259
|
+
* - If any service refuses, the account returns to use, `state` becomes `none`, and `rejected_at` and `objections` say why.
|
|
260
|
+
* - Otherwise `state` becomes `scheduled`, and the account is deleted at `scheduled_at`, fifteen days after the request. The conditions are checked once more at that time.
|
|
261
|
+
*
|
|
262
|
+
* The deletion can be cancelled with `DELETE /account/v1/me/deletion` until `scheduled_at`, and not after. Once carried out it cannot be undone, and the same sign-in cannot register again. Any remaining balance and prepaid benefits are forfeited, which `acknowledge_forfeiture` confirms.
|
|
263
|
+
*
|
|
264
|
+
* Requesting again while a deletion is open returns it unchanged. Fails with 412 `USER_OWNS_PROJECTS` while `blocking_projects` is not empty, and with 401 `INSUFFICIENT_USER_AUTHENTICATION` unless the caller signed in within the last `meta.max_age` seconds; sign in again with that `max_age` and retry.
|
|
265
|
+
* @summary Request deletion of the current account
|
|
266
|
+
*/
|
|
267
|
+
export declare const requestAccountDeletion: (requestAccountDeletionRequestBody: RequestAccountDeletionRequestBody, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<requestAccountDeletionResponse>;
|
|
268
|
+
export type cancelAccountDeletionResponse200 = {
|
|
269
|
+
data: AccountDeletionResource;
|
|
270
|
+
status: 200;
|
|
271
|
+
};
|
|
272
|
+
export type cancelAccountDeletionResponseDefault = {
|
|
273
|
+
data: Error;
|
|
274
|
+
status: Exclude<HTTPStatusCodes, 200>;
|
|
275
|
+
};
|
|
276
|
+
export type cancelAccountDeletionResponseSuccess = cancelAccountDeletionResponse200 & {
|
|
277
|
+
headers: Headers;
|
|
278
|
+
};
|
|
279
|
+
export type cancelAccountDeletionResponseError = cancelAccountDeletionResponseDefault & {
|
|
280
|
+
headers: Headers;
|
|
281
|
+
};
|
|
282
|
+
export type cancelAccountDeletionResponse = cancelAccountDeletionResponseSuccess | cancelAccountDeletionResponseError;
|
|
283
|
+
export declare const getCancelAccountDeletionUrl: () => string;
|
|
284
|
+
/**
|
|
285
|
+
* Returns the account to use. Cancelling when no deletion is open returns `state` `none`. Fails with 409 `ACCOUNT_DELETION_NOT_CANCELLABLE` once `scheduled_at` has passed.
|
|
286
|
+
* @summary Cancel the deletion of the current account
|
|
287
|
+
*/
|
|
288
|
+
export declare const cancelAccountDeletion: (options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<cancelAccountDeletionResponse>;
|
|
215
289
|
export type getIdentityVerificationResponse200 = {
|
|
216
290
|
data: IdentityVerificationResource;
|
|
217
291
|
status: 200;
|
|
@@ -113,7 +113,7 @@ export const getRegisterUrl = () => {
|
|
|
113
113
|
/**
|
|
114
114
|
* Call this after signing in at auth.leaflow.net, carrying the access token. The name and email address are taken from the sign-in claims and are not read from the request body.
|
|
115
115
|
*
|
|
116
|
-
* `consents` must cover every agreement returned by `GET /account/v1/agreements`, at the same versions. A missing agreement answers 400 and a stale version answers 409, in which case fetch the list again. An account that already exists answers 409.
|
|
116
|
+
* `consents` must cover every agreement returned by `GET /account/v1/agreements`, at the same versions. A missing agreement answers 400 and a stale version answers 409, in which case fetch the list again. An account that already exists answers 409, and one that has been deleted answers 410 `USER_DELETED`: the same sign-in cannot register again.
|
|
117
117
|
* @summary Register an account
|
|
118
118
|
*/
|
|
119
119
|
export const register = async (registerRequestBody, options, fetchFn) => {
|
|
@@ -147,6 +147,8 @@ export const getGetAccountUrl = () => {
|
|
|
147
147
|
};
|
|
148
148
|
/**
|
|
149
149
|
* `pending_agreements` holds the agreements not yet consented to. While it is not empty, obtain consent and call `POST /account/v1/me/consents`.
|
|
150
|
+
*
|
|
151
|
+
* `status` is `DELETING` while a deletion is open; see `GET /account/v1/me/deletion`. A deleted account answers 410 `USER_DELETED`.
|
|
150
152
|
* @summary Get the current account
|
|
151
153
|
*/
|
|
152
154
|
export const getAccount = async (options, fetchFn) => {
|
|
@@ -191,6 +193,80 @@ export const updateAccount = async (updateAccountRequestBody, options, fetchFn)
|
|
|
191
193
|
const data = body ? JSON.parse(body) : {};
|
|
192
194
|
return { data, status: res.status, headers: res.headers };
|
|
193
195
|
};
|
|
196
|
+
export const getGetAccountDeletionUrl = () => {
|
|
197
|
+
return `https://account.leaflow.cloud/account/v1/me/deletion`;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* `state` is `none` while no deletion is open. `blocking_projects` lists the projects the caller still owns; a deletion cannot be requested while it is not empty, so each of them must be transferred or deleted first.
|
|
201
|
+
*
|
|
202
|
+
* Conditions held by other services, such as an unpaid balance or a billing account still paying for a project, are not listed here. Read them from those services before requesting; they are checked again after the request, and a refusal shows up in `rejected_at` and `objections`.
|
|
203
|
+
* @summary Get the deletion of the current account
|
|
204
|
+
*/
|
|
205
|
+
export const getAccountDeletion = async (options, fetchFn) => {
|
|
206
|
+
const res = await (fetchFn ?? fetch)(getGetAccountDeletionUrl(), {
|
|
207
|
+
...options,
|
|
208
|
+
method: "GET",
|
|
209
|
+
});
|
|
210
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
211
|
+
const data = body ? JSON.parse(body) : {};
|
|
212
|
+
return { data, status: res.status, headers: res.headers };
|
|
213
|
+
};
|
|
214
|
+
export const getRequestAccountDeletionUrl = () => {
|
|
215
|
+
return `https://account.leaflow.cloud/account/v1/me/deletion`;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* The account is frozen at once: it can no longer enter a project or change anything in one. The answer is 202 with `state` `checking` while the services holding data for the account are asked whether it can be closed. Poll `GET /account/v1/me/deletion` until `state` leaves `checking`, which normally takes a few seconds.
|
|
219
|
+
*
|
|
220
|
+
* - If any service refuses, the account returns to use, `state` becomes `none`, and `rejected_at` and `objections` say why.
|
|
221
|
+
* - Otherwise `state` becomes `scheduled`, and the account is deleted at `scheduled_at`, fifteen days after the request. The conditions are checked once more at that time.
|
|
222
|
+
*
|
|
223
|
+
* The deletion can be cancelled with `DELETE /account/v1/me/deletion` until `scheduled_at`, and not after. Once carried out it cannot be undone, and the same sign-in cannot register again. Any remaining balance and prepaid benefits are forfeited, which `acknowledge_forfeiture` confirms.
|
|
224
|
+
*
|
|
225
|
+
* Requesting again while a deletion is open returns it unchanged. Fails with 412 `USER_OWNS_PROJECTS` while `blocking_projects` is not empty, and with 401 `INSUFFICIENT_USER_AUTHENTICATION` unless the caller signed in within the last `meta.max_age` seconds; sign in again with that `max_age` and retry.
|
|
226
|
+
* @summary Request deletion of the current account
|
|
227
|
+
*/
|
|
228
|
+
export const requestAccountDeletion = async (requestAccountDeletionRequestBody, options, fetchFn) => {
|
|
229
|
+
const getHeaders = (h) => {
|
|
230
|
+
if (!h)
|
|
231
|
+
return {};
|
|
232
|
+
if (h instanceof Headers)
|
|
233
|
+
return Object.fromEntries(h.entries());
|
|
234
|
+
if (Symbol.iterator in h) {
|
|
235
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
236
|
+
}
|
|
237
|
+
const headers = {};
|
|
238
|
+
for (const [name, value] of Object.entries(h)) {
|
|
239
|
+
if (value !== undefined)
|
|
240
|
+
headers[name] = value;
|
|
241
|
+
}
|
|
242
|
+
return headers;
|
|
243
|
+
};
|
|
244
|
+
const res = await (fetchFn ?? fetch)(getRequestAccountDeletionUrl(), {
|
|
245
|
+
...options,
|
|
246
|
+
method: "POST",
|
|
247
|
+
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
248
|
+
body: JSON.stringify(requestAccountDeletionRequestBody),
|
|
249
|
+
});
|
|
250
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
251
|
+
const data = body ? JSON.parse(body) : {};
|
|
252
|
+
return { data, status: res.status, headers: res.headers };
|
|
253
|
+
};
|
|
254
|
+
export const getCancelAccountDeletionUrl = () => {
|
|
255
|
+
return `https://account.leaflow.cloud/account/v1/me/deletion`;
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Returns the account to use. Cancelling when no deletion is open returns `state` `none`. Fails with 409 `ACCOUNT_DELETION_NOT_CANCELLABLE` once `scheduled_at` has passed.
|
|
259
|
+
* @summary Cancel the deletion of the current account
|
|
260
|
+
*/
|
|
261
|
+
export const cancelAccountDeletion = async (options, fetchFn) => {
|
|
262
|
+
const res = await (fetchFn ?? fetch)(getCancelAccountDeletionUrl(), {
|
|
263
|
+
...options,
|
|
264
|
+
method: "DELETE",
|
|
265
|
+
});
|
|
266
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
267
|
+
const data = body ? JSON.parse(body) : {};
|
|
268
|
+
return { data, status: res.status, headers: res.headers };
|
|
269
|
+
};
|
|
194
270
|
export const getGetIdentityVerificationUrl = () => {
|
|
195
271
|
return `https://account.leaflow.cloud/account/v1/me/identity-verification`;
|
|
196
272
|
};
|
|
@@ -156,6 +156,94 @@ export interface AccountResource {
|
|
|
156
156
|
pending_agreements: AgreementResource[] | null;
|
|
157
157
|
status: AccountResourceStatus;
|
|
158
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* `none` while no deletion is open. `checking` while the services holding data for the account are asked whether it can be closed. `scheduled` once they agree; it is carried out at `scheduled_at` and can be cancelled until then. `executing` once `scheduled_at` has passed; it can no longer be cancelled
|
|
161
|
+
*/
|
|
162
|
+
export type AccountDeletionState = (typeof AccountDeletionState)[keyof typeof AccountDeletionState];
|
|
163
|
+
export declare const AccountDeletionState: {
|
|
164
|
+
readonly none: "none";
|
|
165
|
+
readonly checking: "checking";
|
|
166
|
+
readonly scheduled: "scheduled";
|
|
167
|
+
readonly executing: "executing";
|
|
168
|
+
};
|
|
169
|
+
export type ProjectTraitResourceEffect = (typeof ProjectTraitResourceEffect)[keyof typeof ProjectTraitResourceEffect];
|
|
170
|
+
export declare const ProjectTraitResourceEffect: {
|
|
171
|
+
readonly NoWrite: "NoWrite";
|
|
172
|
+
readonly NoAccess: "NoAccess";
|
|
173
|
+
};
|
|
174
|
+
export interface ProjectTraitResource {
|
|
175
|
+
key: string;
|
|
176
|
+
value: string;
|
|
177
|
+
effect: ProjectTraitResourceEffect;
|
|
178
|
+
reason: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* `active` until deletion is requested; `deleting` while the resources under the project are being removed, when `deletion_requested_at` is set; `deleted` once removal has finished, when `deleted_at` is set
|
|
182
|
+
*/
|
|
183
|
+
export type ProjectStatus = (typeof ProjectStatus)[keyof typeof ProjectStatus];
|
|
184
|
+
export declare const ProjectStatus: {
|
|
185
|
+
readonly active: "active";
|
|
186
|
+
readonly deleting: "deleting";
|
|
187
|
+
readonly deleted: "deleted";
|
|
188
|
+
};
|
|
189
|
+
export interface ProjectResource {
|
|
190
|
+
traits: ProjectTraitResource[];
|
|
191
|
+
/** @nullable */
|
|
192
|
+
deletion_requested_at: string | null;
|
|
193
|
+
created_at: string;
|
|
194
|
+
created_by: string;
|
|
195
|
+
/**
|
|
196
|
+
* When the project was deleted
|
|
197
|
+
* @nullable
|
|
198
|
+
*/
|
|
199
|
+
deleted_at: string | null;
|
|
200
|
+
description: string;
|
|
201
|
+
id: string;
|
|
202
|
+
/**
|
|
203
|
+
* The label naming the project in its address. It equals `id` until a custom slug is chosen. A custom slug does not change once set, and stays with the project after deletion
|
|
204
|
+
* @minLength 1
|
|
205
|
+
* @maxLength 36
|
|
206
|
+
*/
|
|
207
|
+
slug: string;
|
|
208
|
+
status: ProjectStatus;
|
|
209
|
+
name: string;
|
|
210
|
+
updated_at: string;
|
|
211
|
+
}
|
|
212
|
+
export interface AccountDeletionObjectionResource {
|
|
213
|
+
/** The service that refused, such as `billing` */
|
|
214
|
+
service: string;
|
|
215
|
+
/** A stable code defined by that service, such as `ARREARS`. The service documents what each code means and how to resolve it */
|
|
216
|
+
code: string;
|
|
217
|
+
}
|
|
218
|
+
export interface AccountDeletionResource {
|
|
219
|
+
state: AccountDeletionState;
|
|
220
|
+
/**
|
|
221
|
+
* Null while `state` is `none`
|
|
222
|
+
* @nullable
|
|
223
|
+
*/
|
|
224
|
+
requested_at: string | null;
|
|
225
|
+
/**
|
|
226
|
+
* When the deletion is carried out. Null while `state` is `none`
|
|
227
|
+
* @nullable
|
|
228
|
+
*/
|
|
229
|
+
scheduled_at: string | null;
|
|
230
|
+
/** True when an operator requested the deletion rather than the account holder. False while `state` is `none` */
|
|
231
|
+
requested_by_operator: boolean;
|
|
232
|
+
/** Projects the caller owns that are not being deleted. A deletion cannot be requested while this is not empty */
|
|
233
|
+
blocking_projects: ProjectResource[];
|
|
234
|
+
/**
|
|
235
|
+
* When the most recent request was turned down. Null unless the most recent request was turned down
|
|
236
|
+
* @nullable
|
|
237
|
+
*/
|
|
238
|
+
rejected_at: string | null;
|
|
239
|
+
/** Why the most recent request was turned down. Empty unless `rejected_at` is set */
|
|
240
|
+
objections: AccountDeletionObjectionResource[];
|
|
241
|
+
}
|
|
242
|
+
export declare const RequestAccountDeletionRequestBodyValue: {
|
|
243
|
+
/** Must be true. Confirms that any remaining balance and prepaid benefits are forfeited when the deletion is carried out */
|
|
244
|
+
readonly acknowledge_forfeiture: true;
|
|
245
|
+
};
|
|
246
|
+
export type RequestAccountDeletionRequestBody = typeof RequestAccountDeletionRequestBodyValue;
|
|
159
247
|
/**
|
|
160
248
|
* The language used for the interface and for email. It is independent of `country`, and neither can be inferred from the other
|
|
161
249
|
*/
|
|
@@ -297,49 +385,6 @@ export interface AcceptInvitationByTokenRequestBody {
|
|
|
297
385
|
*/
|
|
298
386
|
token: string;
|
|
299
387
|
}
|
|
300
|
-
export type ProjectTraitResourceEffect = (typeof ProjectTraitResourceEffect)[keyof typeof ProjectTraitResourceEffect];
|
|
301
|
-
export declare const ProjectTraitResourceEffect: {
|
|
302
|
-
readonly NoWrite: "NoWrite";
|
|
303
|
-
readonly NoAccess: "NoAccess";
|
|
304
|
-
};
|
|
305
|
-
export interface ProjectTraitResource {
|
|
306
|
-
key: string;
|
|
307
|
-
value: string;
|
|
308
|
-
effect: ProjectTraitResourceEffect;
|
|
309
|
-
reason: string;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* `active` until deletion is requested; `deleting` while the resources under the project are being removed, when `deletion_requested_at` is set; `deleted` once removal has finished, when `deleted_at` is set
|
|
313
|
-
*/
|
|
314
|
-
export type ProjectStatus = (typeof ProjectStatus)[keyof typeof ProjectStatus];
|
|
315
|
-
export declare const ProjectStatus: {
|
|
316
|
-
readonly active: "active";
|
|
317
|
-
readonly deleting: "deleting";
|
|
318
|
-
readonly deleted: "deleted";
|
|
319
|
-
};
|
|
320
|
-
export interface ProjectResource {
|
|
321
|
-
traits: ProjectTraitResource[];
|
|
322
|
-
/** @nullable */
|
|
323
|
-
deletion_requested_at: string | null;
|
|
324
|
-
created_at: string;
|
|
325
|
-
created_by: string;
|
|
326
|
-
/**
|
|
327
|
-
* When the project was deleted
|
|
328
|
-
* @nullable
|
|
329
|
-
*/
|
|
330
|
-
deleted_at: string | null;
|
|
331
|
-
description: string;
|
|
332
|
-
id: string;
|
|
333
|
-
/**
|
|
334
|
-
* The label naming the project in its address. It equals `id` until a custom slug is chosen. A custom slug does not change once set, and stays with the project after deletion
|
|
335
|
-
* @minLength 1
|
|
336
|
-
* @maxLength 36
|
|
337
|
-
*/
|
|
338
|
-
slug: string;
|
|
339
|
-
status: ProjectStatus;
|
|
340
|
-
name: string;
|
|
341
|
-
updated_at: string;
|
|
342
|
-
}
|
|
343
388
|
export interface AcceptedInvitationResponseBody {
|
|
344
389
|
project: ProjectResource;
|
|
345
390
|
}
|
|
@@ -33,6 +33,25 @@ export const AccountResourceStatus = {
|
|
|
33
33
|
BANNED: "BANNED",
|
|
34
34
|
DELETING: "DELETING",
|
|
35
35
|
};
|
|
36
|
+
export const AccountDeletionState = {
|
|
37
|
+
none: "none",
|
|
38
|
+
checking: "checking",
|
|
39
|
+
scheduled: "scheduled",
|
|
40
|
+
executing: "executing",
|
|
41
|
+
};
|
|
42
|
+
export const ProjectTraitResourceEffect = {
|
|
43
|
+
NoWrite: "NoWrite",
|
|
44
|
+
NoAccess: "NoAccess",
|
|
45
|
+
};
|
|
46
|
+
export const ProjectStatus = {
|
|
47
|
+
active: "active",
|
|
48
|
+
deleting: "deleting",
|
|
49
|
+
deleted: "deleted",
|
|
50
|
+
};
|
|
51
|
+
export const RequestAccountDeletionRequestBodyValue = {
|
|
52
|
+
/** Must be true. Confirms that any remaining balance and prepaid benefits are forfeited when the deletion is carried out */
|
|
53
|
+
acknowledge_forfeiture: true,
|
|
54
|
+
};
|
|
36
55
|
export const Locale = {
|
|
37
56
|
"zh-Hans": "zh-Hans",
|
|
38
57
|
"zh-Hant-HK": "zh-Hant-HK",
|
|
@@ -45,15 +64,6 @@ export const IdentityVerificationResourceStatus = {
|
|
|
45
64
|
ENTERPRISE: "ENTERPRISE",
|
|
46
65
|
REJECTED: "REJECTED",
|
|
47
66
|
};
|
|
48
|
-
export const ProjectTraitResourceEffect = {
|
|
49
|
-
NoWrite: "NoWrite",
|
|
50
|
-
NoAccess: "NoAccess",
|
|
51
|
-
};
|
|
52
|
-
export const ProjectStatus = {
|
|
53
|
-
active: "active",
|
|
54
|
-
deleting: "deleting",
|
|
55
|
-
deleted: "deleted",
|
|
56
|
-
};
|
|
57
67
|
export const RuleResourceEffect = {
|
|
58
68
|
allow: "allow",
|
|
59
69
|
deny: "deny",
|
|
@@ -43,7 +43,7 @@ export declare const AcceptAgreementsBody: zod.ZodObject<{
|
|
|
43
43
|
/**
|
|
44
44
|
* Call this after signing in at auth.leaflow.net, carrying the access token. The name and email address are taken from the sign-in claims and are not read from the request body.
|
|
45
45
|
*
|
|
46
|
-
* `consents` must cover every agreement returned by `GET /account/v1/agreements`, at the same versions. A missing agreement answers 400 and a stale version answers 409, in which case fetch the list again. An account that already exists answers 409.
|
|
46
|
+
* `consents` must cover every agreement returned by `GET /account/v1/agreements`, at the same versions. A missing agreement answers 400 and a stale version answers 409, in which case fetch the list again. An account that already exists answers 409, and one that has been deleted answers 410 `USER_DELETED`: the same sign-in cannot register again.
|
|
47
47
|
* @summary Register an account
|
|
48
48
|
*/
|
|
49
49
|
export declare const RegisterBody: zod.ZodObject<{
|
|
@@ -74,6 +74,20 @@ export declare const UpdateAccountBody: zod.ZodObject<{
|
|
|
74
74
|
en: "en";
|
|
75
75
|
}>>;
|
|
76
76
|
}, zod.z.core.$strict>;
|
|
77
|
+
/**
|
|
78
|
+
* The account is frozen at once: it can no longer enter a project or change anything in one. The answer is 202 with `state` `checking` while the services holding data for the account are asked whether it can be closed. Poll `GET /account/v1/me/deletion` until `state` leaves `checking`, which normally takes a few seconds.
|
|
79
|
+
*
|
|
80
|
+
* - If any service refuses, the account returns to use, `state` becomes `none`, and `rejected_at` and `objections` say why.
|
|
81
|
+
* - Otherwise `state` becomes `scheduled`, and the account is deleted at `scheduled_at`, fifteen days after the request. The conditions are checked once more at that time.
|
|
82
|
+
*
|
|
83
|
+
* The deletion can be cancelled with `DELETE /account/v1/me/deletion` until `scheduled_at`, and not after. Once carried out it cannot be undone, and the same sign-in cannot register again. Any remaining balance and prepaid benefits are forfeited, which `acknowledge_forfeiture` confirms.
|
|
84
|
+
*
|
|
85
|
+
* Requesting again while a deletion is open returns it unchanged. Fails with 412 `USER_OWNS_PROJECTS` while `blocking_projects` is not empty, and with 401 `INSUFFICIENT_USER_AUTHENTICATION` unless the caller signed in within the last `meta.max_age` seconds; sign in again with that `max_age` and retry.
|
|
86
|
+
* @summary Request deletion of the current account
|
|
87
|
+
*/
|
|
88
|
+
export declare const RequestAccountDeletionBody: zod.ZodObject<{
|
|
89
|
+
acknowledge_forfeiture: zod.ZodLiteral<true>;
|
|
90
|
+
}, zod.z.core.$strict>;
|
|
77
91
|
/**
|
|
78
92
|
* A submission awaiting review, and an account already verified, are both refused. A rejected submission may be corrected and sent again.
|
|
79
93
|
* @summary Submit identity verification
|
|
@@ -28,6 +28,7 @@ import { AcceptConsentsRequestBody } from "./validators/acceptConsentsRequestBod
|
|
|
28
28
|
import { AcceptInvitationByTokenRequestBody } from "./validators/acceptInvitationByTokenRequestBody.zod.js";
|
|
29
29
|
import { CreateProjectRequestBody } from "./validators/createProjectRequestBody.zod.js";
|
|
30
30
|
import { RegisterRequestBody } from "./validators/registerRequestBody.zod.js";
|
|
31
|
+
import { RequestAccountDeletionRequestBody } from "./validators/requestAccountDeletionRequestBody.zod.js";
|
|
31
32
|
import { SubmitIdentityVerificationRequestBody } from "./validators/submitIdentityVerificationRequestBody.zod.js";
|
|
32
33
|
import { UpdateAccountRequestBody } from "./validators/updateAccountRequestBody.zod.js";
|
|
33
34
|
/**
|
|
@@ -40,7 +41,7 @@ export const AcceptAgreementsBody = AcceptConsentsRequestBody;
|
|
|
40
41
|
/**
|
|
41
42
|
* Call this after signing in at auth.leaflow.net, carrying the access token. The name and email address are taken from the sign-in claims and are not read from the request body.
|
|
42
43
|
*
|
|
43
|
-
* `consents` must cover every agreement returned by `GET /account/v1/agreements`, at the same versions. A missing agreement answers 400 and a stale version answers 409, in which case fetch the list again. An account that already exists answers 409.
|
|
44
|
+
* `consents` must cover every agreement returned by `GET /account/v1/agreements`, at the same versions. A missing agreement answers 400 and a stale version answers 409, in which case fetch the list again. An account that already exists answers 409, and one that has been deleted answers 410 `USER_DELETED`: the same sign-in cannot register again.
|
|
44
45
|
* @summary Register an account
|
|
45
46
|
*/
|
|
46
47
|
export const RegisterBody = RegisterRequestBody;
|
|
@@ -49,6 +50,18 @@ export const RegisterBody = RegisterRequestBody;
|
|
|
49
50
|
* @summary Update the country and language of the current account
|
|
50
51
|
*/
|
|
51
52
|
export const UpdateAccountBody = UpdateAccountRequestBody;
|
|
53
|
+
/**
|
|
54
|
+
* The account is frozen at once: it can no longer enter a project or change anything in one. The answer is 202 with `state` `checking` while the services holding data for the account are asked whether it can be closed. Poll `GET /account/v1/me/deletion` until `state` leaves `checking`, which normally takes a few seconds.
|
|
55
|
+
*
|
|
56
|
+
* - If any service refuses, the account returns to use, `state` becomes `none`, and `rejected_at` and `objections` say why.
|
|
57
|
+
* - Otherwise `state` becomes `scheduled`, and the account is deleted at `scheduled_at`, fifteen days after the request. The conditions are checked once more at that time.
|
|
58
|
+
*
|
|
59
|
+
* The deletion can be cancelled with `DELETE /account/v1/me/deletion` until `scheduled_at`, and not after. Once carried out it cannot be undone, and the same sign-in cannot register again. Any remaining balance and prepaid benefits are forfeited, which `acknowledge_forfeiture` confirms.
|
|
60
|
+
*
|
|
61
|
+
* Requesting again while a deletion is open returns it unchanged. Fails with 412 `USER_OWNS_PROJECTS` while `blocking_projects` is not empty, and with 401 `INSUFFICIENT_USER_AUTHENTICATION` unless the caller signed in within the last `meta.max_age` seconds; sign in again with that `max_age` and retry.
|
|
62
|
+
* @summary Request deletion of the current account
|
|
63
|
+
*/
|
|
64
|
+
export const RequestAccountDeletionBody = RequestAccountDeletionRequestBody;
|
|
52
65
|
/**
|
|
53
66
|
* A submission awaiting review, and an account already verified, are both refused. A rejected submission may be corrected and sent again.
|
|
54
67
|
* @summary Submit identity verification
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Account API
|
|
5
|
+
* Everything that comes before a project is chosen: registration, the account itself, the projects the caller belongs to, and entry into one of them.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* Every request carries `Authorization: Bearer <access token>`, obtained by signing in at auth.leaflow.net. The endpoints that need no token say so.
|
|
10
|
+
*
|
|
11
|
+
* ## Entering a project
|
|
12
|
+
*
|
|
13
|
+
* 1. `QUERY /account/v1/projects` searches the projects the caller belongs to. The first call registers the account, taking the name and email address from the sign-in claims.
|
|
14
|
+
* 2. `POST /account/v1/projects/{projectId}/scoped-tokens` returns a scoped token for the project chosen.
|
|
15
|
+
* 3. Every other service is called with that scoped token.
|
|
16
|
+
*
|
|
17
|
+
* A scoped token cannot be renewed. Repeat step 2 for a new one, and sign in again at auth.leaflow.net once the access token itself has expired.
|
|
18
|
+
*
|
|
19
|
+
* ## Project slugs
|
|
20
|
+
*
|
|
21
|
+
* Every project carries a `slug`, the label naming it in its address. Until a custom slug is chosen the slug is the project's `id`, and the address under the `id` keeps working after a custom slug is chosen. `GET /account/v1/projects/by-slug/{slug}` finds the project named by either label.
|
|
22
|
+
*
|
|
23
|
+
* Looking up slugs and claiming custom slugs are rate limited per account. A request over the limit fails with 429, and `meta.retry_after_seconds` on the error states how many seconds to wait before retrying.
|
|
24
|
+
* OpenAPI spec version: 1.0.0
|
|
25
|
+
*/
|
|
26
|
+
import * as zod from "zod";
|
|
27
|
+
export declare const AccountDeletionObjectionResource: zod.ZodObject<{
|
|
28
|
+
service: zod.ZodString;
|
|
29
|
+
code: zod.ZodString;
|
|
30
|
+
}, zod.z.core.$strict>;
|
|
31
|
+
export type AccountDeletionObjectionResource = zod.input<typeof AccountDeletionObjectionResource>;
|
|
32
|
+
export type AccountDeletionObjectionResourceOutput = zod.output<typeof AccountDeletionObjectionResource>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Account API
|
|
5
|
+
* Everything that comes before a project is chosen: registration, the account itself, the projects the caller belongs to, and entry into one of them.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* Every request carries `Authorization: Bearer <access token>`, obtained by signing in at auth.leaflow.net. The endpoints that need no token say so.
|
|
10
|
+
*
|
|
11
|
+
* ## Entering a project
|
|
12
|
+
*
|
|
13
|
+
* 1. `QUERY /account/v1/projects` searches the projects the caller belongs to. The first call registers the account, taking the name and email address from the sign-in claims.
|
|
14
|
+
* 2. `POST /account/v1/projects/{projectId}/scoped-tokens` returns a scoped token for the project chosen.
|
|
15
|
+
* 3. Every other service is called with that scoped token.
|
|
16
|
+
*
|
|
17
|
+
* A scoped token cannot be renewed. Repeat step 2 for a new one, and sign in again at auth.leaflow.net once the access token itself has expired.
|
|
18
|
+
*
|
|
19
|
+
* ## Project slugs
|
|
20
|
+
*
|
|
21
|
+
* Every project carries a `slug`, the label naming it in its address. Until a custom slug is chosen the slug is the project's `id`, and the address under the `id` keeps working after a custom slug is chosen. `GET /account/v1/projects/by-slug/{slug}` finds the project named by either label.
|
|
22
|
+
*
|
|
23
|
+
* Looking up slugs and claiming custom slugs are rate limited per account. A request over the limit fails with 429, and `meta.retry_after_seconds` on the error states how many seconds to wait before retrying.
|
|
24
|
+
* OpenAPI spec version: 1.0.0
|
|
25
|
+
*/
|
|
26
|
+
import * as zod from "zod";
|
|
27
|
+
export const AccountDeletionObjectionResource = zod.strictObject({
|
|
28
|
+
service: zod.string().describe("The service that refused, such as `billing`"),
|
|
29
|
+
code: zod
|
|
30
|
+
.string()
|
|
31
|
+
.describe("A stable code defined by that service, such as `ARREARS`. The service documents what each code means and how to resolve it"),
|
|
32
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Account API
|
|
5
|
+
* Everything that comes before a project is chosen: registration, the account itself, the projects the caller belongs to, and entry into one of them.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* Every request carries `Authorization: Bearer <access token>`, obtained by signing in at auth.leaflow.net. The endpoints that need no token say so.
|
|
10
|
+
*
|
|
11
|
+
* ## Entering a project
|
|
12
|
+
*
|
|
13
|
+
* 1. `QUERY /account/v1/projects` searches the projects the caller belongs to. The first call registers the account, taking the name and email address from the sign-in claims.
|
|
14
|
+
* 2. `POST /account/v1/projects/{projectId}/scoped-tokens` returns a scoped token for the project chosen.
|
|
15
|
+
* 3. Every other service is called with that scoped token.
|
|
16
|
+
*
|
|
17
|
+
* A scoped token cannot be renewed. Repeat step 2 for a new one, and sign in again at auth.leaflow.net once the access token itself has expired.
|
|
18
|
+
*
|
|
19
|
+
* ## Project slugs
|
|
20
|
+
*
|
|
21
|
+
* Every project carries a `slug`, the label naming it in its address. Until a custom slug is chosen the slug is the project's `id`, and the address under the `id` keeps working after a custom slug is chosen. `GET /account/v1/projects/by-slug/{slug}` finds the project named by either label.
|
|
22
|
+
*
|
|
23
|
+
* Looking up slugs and claiming custom slugs are rate limited per account. A request over the limit fails with 429, and `meta.retry_after_seconds` on the error states how many seconds to wait before retrying.
|
|
24
|
+
* OpenAPI spec version: 1.0.0
|
|
25
|
+
*/
|
|
26
|
+
import * as zod from "zod";
|
|
27
|
+
export declare const AccountDeletionResource: zod.ZodObject<{
|
|
28
|
+
state: zod.ZodEnum<{
|
|
29
|
+
none: "none";
|
|
30
|
+
checking: "checking";
|
|
31
|
+
scheduled: "scheduled";
|
|
32
|
+
executing: "executing";
|
|
33
|
+
}>;
|
|
34
|
+
requested_at: zod.ZodNullable<zod.z.ZodISODateTime>;
|
|
35
|
+
scheduled_at: zod.ZodNullable<zod.z.ZodISODateTime>;
|
|
36
|
+
requested_by_operator: zod.ZodBoolean;
|
|
37
|
+
blocking_projects: zod.ZodArray<zod.ZodObject<{
|
|
38
|
+
traits: zod.ZodArray<zod.ZodObject<{
|
|
39
|
+
key: zod.ZodString;
|
|
40
|
+
value: zod.ZodString;
|
|
41
|
+
effect: zod.ZodEnum<{
|
|
42
|
+
NoWrite: "NoWrite";
|
|
43
|
+
NoAccess: "NoAccess";
|
|
44
|
+
}>;
|
|
45
|
+
reason: zod.ZodString;
|
|
46
|
+
}, zod.z.core.$strict>>;
|
|
47
|
+
deletion_requested_at: zod.ZodNullable<zod.z.ZodISODateTime>;
|
|
48
|
+
created_at: zod.z.ZodISODateTime;
|
|
49
|
+
created_by: zod.ZodString;
|
|
50
|
+
deleted_at: zod.ZodNullable<zod.z.ZodISODateTime>;
|
|
51
|
+
description: zod.ZodString;
|
|
52
|
+
id: zod.ZodUUID;
|
|
53
|
+
slug: zod.ZodString;
|
|
54
|
+
status: zod.ZodEnum<{
|
|
55
|
+
active: "active";
|
|
56
|
+
deleting: "deleting";
|
|
57
|
+
deleted: "deleted";
|
|
58
|
+
}>;
|
|
59
|
+
name: zod.ZodString;
|
|
60
|
+
updated_at: zod.z.ZodISODateTime;
|
|
61
|
+
}, zod.z.core.$strict>>;
|
|
62
|
+
rejected_at: zod.ZodNullable<zod.z.ZodISODateTime>;
|
|
63
|
+
objections: zod.ZodArray<zod.ZodObject<{
|
|
64
|
+
service: zod.ZodString;
|
|
65
|
+
code: zod.ZodString;
|
|
66
|
+
}, zod.z.core.$strict>>;
|
|
67
|
+
}, zod.z.core.$strict>;
|
|
68
|
+
export type AccountDeletionResource = zod.input<typeof AccountDeletionResource>;
|
|
69
|
+
export type AccountDeletionResourceOutput = zod.output<typeof AccountDeletionResource>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Account API
|
|
5
|
+
* Everything that comes before a project is chosen: registration, the account itself, the projects the caller belongs to, and entry into one of them.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* Every request carries `Authorization: Bearer <access token>`, obtained by signing in at auth.leaflow.net. The endpoints that need no token say so.
|
|
10
|
+
*
|
|
11
|
+
* ## Entering a project
|
|
12
|
+
*
|
|
13
|
+
* 1. `QUERY /account/v1/projects` searches the projects the caller belongs to. The first call registers the account, taking the name and email address from the sign-in claims.
|
|
14
|
+
* 2. `POST /account/v1/projects/{projectId}/scoped-tokens` returns a scoped token for the project chosen.
|
|
15
|
+
* 3. Every other service is called with that scoped token.
|
|
16
|
+
*
|
|
17
|
+
* A scoped token cannot be renewed. Repeat step 2 for a new one, and sign in again at auth.leaflow.net once the access token itself has expired.
|
|
18
|
+
*
|
|
19
|
+
* ## Project slugs
|
|
20
|
+
*
|
|
21
|
+
* Every project carries a `slug`, the label naming it in its address. Until a custom slug is chosen the slug is the project's `id`, and the address under the `id` keeps working after a custom slug is chosen. `GET /account/v1/projects/by-slug/{slug}` finds the project named by either label.
|
|
22
|
+
*
|
|
23
|
+
* Looking up slugs and claiming custom slugs are rate limited per account. A request over the limit fails with 429, and `meta.retry_after_seconds` on the error states how many seconds to wait before retrying.
|
|
24
|
+
* OpenAPI spec version: 1.0.0
|
|
25
|
+
*/
|
|
26
|
+
import * as zod from "zod";
|
|
27
|
+
import { AccountDeletionObjectionResource } from "./accountDeletionObjectionResource.zod.js";
|
|
28
|
+
import { AccountDeletionState } from "./accountDeletionState.zod.js";
|
|
29
|
+
import { ProjectResource } from "./projectResource.zod.js";
|
|
30
|
+
export const AccountDeletionResource = zod.strictObject({
|
|
31
|
+
state: AccountDeletionState,
|
|
32
|
+
requested_at: zod.iso
|
|
33
|
+
.datetime({ offset: true })
|
|
34
|
+
.nullable()
|
|
35
|
+
.describe("Null while `state` is `none`"),
|
|
36
|
+
scheduled_at: zod.iso
|
|
37
|
+
.datetime({ offset: true })
|
|
38
|
+
.nullable()
|
|
39
|
+
.describe("When the deletion is carried out. Null while `state` is `none`"),
|
|
40
|
+
requested_by_operator: zod
|
|
41
|
+
.boolean()
|
|
42
|
+
.describe("True when an operator requested the deletion rather than the account holder. False while `state` is `none`"),
|
|
43
|
+
blocking_projects: zod
|
|
44
|
+
.array(ProjectResource)
|
|
45
|
+
.describe("Projects the caller owns that are not being deleted. A deletion cannot be requested while this is not empty"),
|
|
46
|
+
rejected_at: zod.iso
|
|
47
|
+
.datetime({ offset: true })
|
|
48
|
+
.nullable()
|
|
49
|
+
.describe("When the most recent request was turned down. Null unless the most recent request was turned down"),
|
|
50
|
+
objections: zod
|
|
51
|
+
.array(AccountDeletionObjectionResource)
|
|
52
|
+
.describe("Why the most recent request was turned down. Empty unless `rejected_at` is set"),
|
|
53
|
+
});
|