@leaflow/sdk 0.164.0 → 0.166.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.
@@ -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, 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";
26
+ import type { AcceptConsentsRequestBody, AcceptInvitationByTokenRequestBody, AcceptedInvitationResponseBody, AccountDeletionResource, AccountResource, AgreementListResponseBody, ConsentListResponseBody, CreateProjectRequestBody, Error, IdentityVerificationResource, InvitationPreviewResource, LengthAwarePageInvitationResource, LengthAwarePageProjectAccessResource, ListMyInvitationsParams, ListProjectsParams, LocaleOptionsResource, PreviewInvitationByTokenParams, ProjectAccessList, ProjectAccessResource, ProjectSlugAvailabilityResource, RegisterRequestBody, RequestAccountDeletionParams, 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;
@@ -49,7 +49,7 @@ export declare const getGetSettingsUrl: () => string;
49
49
  /**
50
50
  * No token required.
51
51
  *
52
- * While `registration_mode` is not `OPEN`, `POST /account/v1/register` answers 403: `CLOSED` refuses everyone, and `INVITE_ONLY` accepts only an email address holding a project invitation. `project_creation_mode` behaves the same way, and `VERIFIED_ONLY` requires identity verification to have completed.
52
+ * While `registration_mode` is not `OPEN`, `POST /account/v1/me:register` answers 403: `CLOSED` refuses everyone, and `INVITE_ONLY` accepts only an email address holding a project invitation. `project_creation_mode` behaves the same way, and `VERIFIED_ONLY` requires identity verification to have completed.
53
53
  *
54
54
  * Both quotas are `0` when unlimited. The decision itself is made at the moment of writing.
55
55
  * @summary Get registration and project creation settings
@@ -97,7 +97,7 @@ export type listAgreementsResponseError = listAgreementsResponseDefault & {
97
97
  export type listAgreementsResponse = listAgreementsResponseSuccess | listAgreementsResponseError;
98
98
  export declare const getListAgreementsUrl: () => string;
99
99
  /**
100
- * No token required. Send the `type` and `version` of each one back unchanged to `POST /account/v1/register`.
100
+ * No token required. Send the `type` and `version` of each one back unchanged to `POST /account/v1/me:register`.
101
101
  *
102
102
  * The array is empty while no agreement is in force, and registration then takes no `consents`.
103
103
  * @summary List the agreements registration requires
@@ -214,29 +214,6 @@ export declare const getUpdateAccountUrl: () => string;
214
214
  * @summary Update the country and language of the current account
215
215
  */
216
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
217
  export type requestAccountDeletionResponse202 = {
241
218
  data: AccountDeletionResource;
242
219
  status: 202;
@@ -252,19 +229,42 @@ export type requestAccountDeletionResponseError = requestAccountDeletionResponse
252
229
  headers: Headers;
253
230
  };
254
231
  export type requestAccountDeletionResponse = requestAccountDeletionResponseSuccess | requestAccountDeletionResponseError;
255
- export declare const getRequestAccountDeletionUrl: () => string;
232
+ export declare const getRequestAccountDeletionUrl: (params: RequestAccountDeletionParams) => string;
256
233
  /**
257
234
  * 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
235
  *
259
236
  * - If any service refuses, the account returns to use, `state` becomes `none`, and `rejected_at` and `objections` say why.
260
237
  * - 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
238
  *
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.
239
+ * The deletion can be cancelled with `POST /account/v1/me:undelete` 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
240
  *
264
241
  * 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
242
  * @summary Request deletion of the current account
266
243
  */
267
- export declare const requestAccountDeletion: (requestAccountDeletionRequestBody: RequestAccountDeletionRequestBody, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<requestAccountDeletionResponse>;
244
+ export declare const requestAccountDeletion: (params: RequestAccountDeletionParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<requestAccountDeletionResponse>;
245
+ export type getAccountDeletionResponse200 = {
246
+ data: AccountDeletionResource;
247
+ status: 200;
248
+ };
249
+ export type getAccountDeletionResponseDefault = {
250
+ data: Error;
251
+ status: Exclude<HTTPStatusCodes, 200>;
252
+ };
253
+ export type getAccountDeletionResponseSuccess = getAccountDeletionResponse200 & {
254
+ headers: Headers;
255
+ };
256
+ export type getAccountDeletionResponseError = getAccountDeletionResponseDefault & {
257
+ headers: Headers;
258
+ };
259
+ export type getAccountDeletionResponse = getAccountDeletionResponseSuccess | getAccountDeletionResponseError;
260
+ export declare const getGetAccountDeletionUrl: () => string;
261
+ /**
262
+ * `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.
263
+ *
264
+ * 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`.
265
+ * @summary Get the deletion of the current account
266
+ */
267
+ export declare const getAccountDeletion: (options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getAccountDeletionResponse>;
268
268
  export type cancelAccountDeletionResponse200 = {
269
269
  data: AccountDeletionResource;
270
270
  status: 200;
@@ -4,7 +4,7 @@ export const getGetSettingsUrl = () => {
4
4
  /**
5
5
  * No token required.
6
6
  *
7
- * While `registration_mode` is not `OPEN`, `POST /account/v1/register` answers 403: `CLOSED` refuses everyone, and `INVITE_ONLY` accepts only an email address holding a project invitation. `project_creation_mode` behaves the same way, and `VERIFIED_ONLY` requires identity verification to have completed.
7
+ * While `registration_mode` is not `OPEN`, `POST /account/v1/me:register` answers 403: `CLOSED` refuses everyone, and `INVITE_ONLY` accepts only an email address holding a project invitation. `project_creation_mode` behaves the same way, and `VERIFIED_ONLY` requires identity verification to have completed.
8
8
  *
9
9
  * Both quotas are `0` when unlimited. The decision itself is made at the moment of writing.
10
10
  * @summary Get registration and project creation settings
@@ -42,7 +42,7 @@ export const getListAgreementsUrl = () => {
42
42
  return `https://account.leaflow.cloud/account/v1/agreements`;
43
43
  };
44
44
  /**
45
- * No token required. Send the `type` and `version` of each one back unchanged to `POST /account/v1/register`.
45
+ * No token required. Send the `type` and `version` of each one back unchanged to `POST /account/v1/me:register`.
46
46
  *
47
47
  * The array is empty while no agreement is in force, and registration then takes no `consents`.
48
48
  * @summary List the agreements registration requires
@@ -108,7 +108,7 @@ export const acceptAgreements = async (acceptConsentsRequestBody, options, fetch
108
108
  return { data, status: res.status, headers: res.headers };
109
109
  };
110
110
  export const getRegisterUrl = () => {
111
- return `https://account.leaflow.cloud/account/v1/register`;
111
+ return `https://account.leaflow.cloud/account/v1/me:register`;
112
112
  };
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.
@@ -193,66 +193,58 @@ export const updateAccount = async (updateAccountRequestBody, options, fetchFn)
193
193
  const data = body ? JSON.parse(body) : {};
194
194
  return { data, status: res.status, headers: res.headers };
195
195
  };
196
- export const getGetAccountDeletionUrl = () => {
197
- return `https://account.leaflow.cloud/account/v1/me/deletion`;
196
+ export const getRequestAccountDeletionUrl = (params) => {
197
+ const normalizedParams = new URLSearchParams();
198
+ Object.entries(params || {}).forEach(([key, value]) => {
199
+ if (value !== undefined) {
200
+ normalizedParams.append(key, value === null ? "null" : String(value));
201
+ }
202
+ });
203
+ const stringifiedParams = normalizedParams.toString();
204
+ return stringifiedParams.length > 0
205
+ ? `https://account.leaflow.cloud/account/v1/me?${stringifiedParams}`
206
+ : `https://account.leaflow.cloud/account/v1/me`;
198
207
  };
199
208
  /**
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.
209
+ * 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.
201
210
  *
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
211
+ * - If any service refuses, the account returns to use, `state` becomes `none`, and `rejected_at` and `objections` say why.
212
+ * - 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.
213
+ *
214
+ * The deletion can be cancelled with `POST /account/v1/me:undelete` 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.
215
+ *
216
+ * 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.
217
+ * @summary Request deletion of the current account
204
218
  */
205
- export const getAccountDeletion = async (options, fetchFn) => {
206
- const res = await (fetchFn ?? fetch)(getGetAccountDeletionUrl(), {
219
+ export const requestAccountDeletion = async (params, options, fetchFn) => {
220
+ const res = await (fetchFn ?? fetch)(getRequestAccountDeletionUrl(params), {
207
221
  ...options,
208
- method: "GET",
222
+ method: "DELETE",
209
223
  });
210
224
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
211
225
  const data = body ? JSON.parse(body) : {};
212
226
  return { data, status: res.status, headers: res.headers };
213
227
  };
214
- export const getRequestAccountDeletionUrl = () => {
228
+ export const getGetAccountDeletionUrl = () => {
215
229
  return `https://account.leaflow.cloud/account/v1/me/deletion`;
216
230
  };
217
231
  /**
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.
232
+ * `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.
224
233
  *
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
234
+ * 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`.
235
+ * @summary Get the deletion of the current account
227
236
  */
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(), {
237
+ export const getAccountDeletion = async (options, fetchFn) => {
238
+ const res = await (fetchFn ?? fetch)(getGetAccountDeletionUrl(), {
245
239
  ...options,
246
- method: "POST",
247
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
248
- body: JSON.stringify(requestAccountDeletionRequestBody),
240
+ method: "GET",
249
241
  });
250
242
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
251
243
  const data = body ? JSON.parse(body) : {};
252
244
  return { data, status: res.status, headers: res.headers };
253
245
  };
254
246
  export const getCancelAccountDeletionUrl = () => {
255
- return `https://account.leaflow.cloud/account/v1/me/deletion`;
247
+ return `https://account.leaflow.cloud/account/v1/me:undelete`;
256
248
  };
257
249
  /**
258
250
  * 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.
@@ -261,7 +253,7 @@ export const getCancelAccountDeletionUrl = () => {
261
253
  export const cancelAccountDeletion = async (options, fetchFn) => {
262
254
  const res = await (fetchFn ?? fetch)(getCancelAccountDeletionUrl(), {
263
255
  ...options,
264
- method: "DELETE",
256
+ method: "POST",
265
257
  });
266
258
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
267
259
  const data = body ? JSON.parse(body) : {};
@@ -371,7 +363,7 @@ export const previewInvitationByToken = async (params, options, fetchFn) => {
371
363
  return { data, status: res.status, headers: res.headers };
372
364
  };
373
365
  export const getAcceptInvitationByTokenUrl = () => {
374
- return `https://account.leaflow.cloud/account/v1/me/invitations/accept`;
366
+ return `https://account.leaflow.cloud/account/v1/me/invitations:accept`;
375
367
  };
376
368
  /**
377
369
  * A token that does not match, and an invitation that no longer stands, answer the same way.
@@ -404,7 +396,7 @@ export const acceptInvitationByToken = async (acceptInvitationByTokenRequestBody
404
396
  return { data, status: res.status, headers: res.headers };
405
397
  };
406
398
  export const getAcceptInvitationUrl = (invitationId) => {
407
- return `https://account.leaflow.cloud/account/v1/me/invitations/${encodeURIComponent(String(invitationId))}/accept`;
399
+ return `https://account.leaflow.cloud/account/v1/me/invitations/${encodeURIComponent(String(invitationId))}:accept`;
408
400
  };
409
401
  /**
410
402
  * No token is required; the invitation is addressed to the email address of the current account.
@@ -239,11 +239,6 @@ export interface AccountDeletionResource {
239
239
  /** Why the most recent request was turned down. Empty unless `rejected_at` is set */
240
240
  objections: AccountDeletionObjectionResource[];
241
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;
247
242
  /**
248
243
  * The language used for the interface and for email. It is independent of `country`, and neither can be inferred from the other
249
244
  */
@@ -531,6 +526,12 @@ export interface CursorPagination {
531
526
  /** @nullable */
532
527
  next_cursor?: string | null;
533
528
  }
529
+ export type RequestAccountDeletionParams = {
530
+ /**
531
+ * Must be true. Confirms that any remaining balance and prepaid benefits are forfeited when the deletion is carried out.
532
+ */
533
+ acknowledge_forfeiture: true;
534
+ };
534
535
  export type ListMyInvitationsParams = {
535
536
  /**
536
537
  * Items returned in this page. Defaults to 50; at most 200.
@@ -48,10 +48,6 @@ export const ProjectStatus = {
48
48
  deleting: "deleting",
49
49
  deleted: "deleted",
50
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
- };
55
51
  export const Locale = {
56
52
  "zh-Hans": "zh-Hans",
57
53
  "zh-Hant-HK": "zh-Hant-HK",
@@ -80,12 +80,12 @@ export declare const UpdateAccountBody: zod.ZodObject<{
80
80
  * - If any service refuses, the account returns to use, `state` becomes `none`, and `rejected_at` and `objections` say why.
81
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
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.
83
+ * The deletion can be cancelled with `POST /account/v1/me:undelete` 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
84
  *
85
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
86
  * @summary Request deletion of the current account
87
87
  */
88
- export declare const RequestAccountDeletionBody: zod.ZodObject<{
88
+ export declare const RequestAccountDeletionQueryParams: zod.ZodObject<{
89
89
  acknowledge_forfeiture: zod.ZodLiteral<true>;
90
90
  }, zod.z.core.$strict>;
91
91
  /**
@@ -28,7 +28,6 @@ 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";
32
31
  import { SubmitIdentityVerificationRequestBody } from "./validators/submitIdentityVerificationRequestBody.zod.js";
33
32
  import { UpdateAccountRequestBody } from "./validators/updateAccountRequestBody.zod.js";
34
33
  /**
@@ -56,12 +55,16 @@ export const UpdateAccountBody = UpdateAccountRequestBody;
56
55
  * - If any service refuses, the account returns to use, `state` becomes `none`, and `rejected_at` and `objections` say why.
57
56
  * - 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
57
  *
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.
58
+ * The deletion can be cancelled with `POST /account/v1/me:undelete` 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
59
  *
61
60
  * 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
61
  * @summary Request deletion of the current account
63
62
  */
64
- export const RequestAccountDeletionBody = RequestAccountDeletionRequestBody;
63
+ export const RequestAccountDeletionQueryParams = zod.strictObject({
64
+ acknowledge_forfeiture: zod
65
+ .literal(true)
66
+ .describe("Must be true. Confirms that any remaining balance and prepaid benefits are forfeited when the deletion is carried out."),
67
+ });
65
68
  /**
66
69
  * A submission awaiting review, and an account already verified, are both refused. A rejected submission may be corrected and sent again.
67
70
  * @summary Submit identity verification
@@ -24,8 +24,8 @@
24
24
  * OpenAPI spec version: 1.0.0
25
25
  */
26
26
  import * as zod from "zod";
27
- export declare const RequestAccountDeletionRequestBody: zod.ZodObject<{
27
+ export declare const RequestAccountDeletionParams: zod.ZodObject<{
28
28
  acknowledge_forfeiture: zod.ZodLiteral<true>;
29
29
  }, zod.z.core.$strict>;
30
- export type RequestAccountDeletionRequestBody = zod.input<typeof RequestAccountDeletionRequestBody>;
31
- export type RequestAccountDeletionRequestBodyOutput = zod.output<typeof RequestAccountDeletionRequestBody>;
30
+ export type RequestAccountDeletionParams = zod.input<typeof RequestAccountDeletionParams>;
31
+ export type RequestAccountDeletionParamsOutput = zod.output<typeof RequestAccountDeletionParams>;
@@ -24,8 +24,6 @@
24
24
  * OpenAPI spec version: 1.0.0
25
25
  */
26
26
  import * as zod from "zod";
27
- export const RequestAccountDeletionRequestBody = zod.strictObject({
28
- acknowledge_forfeiture: zod
29
- .literal(true)
30
- .describe("Must be true. Confirms that any remaining balance and prepaid benefits are forfeited when the deletion is carried out"),
27
+ export const RequestAccountDeletionParams = zod.strictObject({
28
+ acknowledge_forfeiture: zod.literal(true),
31
29
  });
@@ -160,7 +160,7 @@ export const deleteThread = async (thread, options, fetchFn) => {
160
160
  return { data, status: res.status, headers: res.headers };
161
161
  };
162
162
  export const getInterruptThreadUrl = (thread) => {
163
- return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}/interrupt`;
163
+ return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}:interrupt`;
164
164
  };
165
165
  /**
166
166
  * Stops this conversation's running turn and discards its queued messages. Subagents keep
@@ -180,7 +180,7 @@ export const interruptThread = async (thread, options, fetchFn) => {
180
180
  return { data, status: res.status, headers: res.headers };
181
181
  };
182
182
  export const getResumeThreadUrl = (thread) => {
183
- return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}/resume`;
183
+ return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}:resume`;
184
184
  };
185
185
  /**
186
186
  * Starts a new turn that continues from where the conversation stopped, for example after it
@@ -216,7 +216,7 @@ export const resumeThread = async (thread, resumeThreadRequestBody, options, fet
216
216
  return { data, status: res.status, headers: res.headers };
217
217
  };
218
218
  export const getCompactThreadUrl = (thread) => {
219
- return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}/compact`;
219
+ return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}:compact`;
220
220
  };
221
221
  /**
222
222
  * Starts a compaction turn that summarizes the history before the latest user message, the same
@@ -237,7 +237,7 @@ export const compactThread = async (thread, options, fetchFn) => {
237
237
  return { data, status: res.status, headers: res.headers };
238
238
  };
239
239
  export const getRevertThreadUrl = (thread) => {
240
- return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}/revert`;
240
+ return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}:revert`;
241
241
  };
242
242
  /**
243
243
  * Reverts the item at `ordinal` and everything after it. Reverted items stay in the transcript
@@ -272,7 +272,7 @@ export const revertThread = async (thread, revertRequestBody, options, fetchFn)
272
272
  return { data, status: res.status, headers: res.headers };
273
273
  };
274
274
  export const getMarkThreadReadUrl = (thread) => {
275
- return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}/read`;
275
+ return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}:markRead`;
276
276
  };
277
277
  /**
278
278
  * Clears `unread` until the assistant replies again.
@@ -450,7 +450,7 @@ export const decideToolCalls = async (thread, decideToolCallsRequestBody, option
450
450
  return { data, status: res.status, headers: res.headers };
451
451
  };
452
452
  export const getAnswerQuestionUrl = (thread, item) => {
453
- return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}/items/${encodeURIComponent(String(item))}/answer`;
453
+ return `https://assistant.leaflow.cloud/api/v1/threads/${encodeURIComponent(String(thread))}/items/${encodeURIComponent(String(item))}:answer`;
454
454
  };
455
455
  /**
456
456
  * Answers an `ask` tool call. Its questions are in the item's `questions`. An item that is already
@@ -675,7 +675,7 @@ export const deleteFolder = async (folder, options, fetchFn) => {
675
675
  return { data, status: res.status, headers: res.headers };
676
676
  };
677
677
  export const getMoveFolderUrl = (folder) => {
678
- return `https://assistant.leaflow.cloud/api/v1/folders/${encodeURIComponent(String(folder))}/move`;
678
+ return `https://assistant.leaflow.cloud/api/v1/folders/${encodeURIComponent(String(folder))}:move`;
679
679
  };
680
680
  /**
681
681
  * Places the folder before `beforeFolderId`, or last when it is null. The inbox stays first.
@@ -888,7 +888,7 @@ export const deleteTask = async (task, options, fetchFn) => {
888
888
  return { data, status: res.status, headers: res.headers };
889
889
  };
890
890
  export const getRunTaskUrl = (task) => {
891
- return `https://assistant.leaflow.cloud/api/v1/tasks/${encodeURIComponent(String(task))}/run`;
891
+ return `https://assistant.leaflow.cloud/api/v1/tasks/${encodeURIComponent(String(task))}:run`;
892
892
  };
893
893
  /**
894
894
  * Starts a run immediately, outside its trigger. Fails with 409 and code TASK_RUNNING when a run
@@ -905,7 +905,7 @@ export const runTask = async (task, options, fetchFn) => {
905
905
  return { data, status: res.status, headers: res.headers };
906
906
  };
907
907
  export const getPauseTaskUrl = (task) => {
908
- return `https://assistant.leaflow.cloud/api/v1/tasks/${encodeURIComponent(String(task))}/pause`;
908
+ return `https://assistant.leaflow.cloud/api/v1/tasks/${encodeURIComponent(String(task))}:pause`;
909
909
  };
910
910
  /**
911
911
  * Stops future runs from its trigger. A run in progress continues. Pausing a paused task succeeds.
@@ -921,7 +921,7 @@ export const pauseTask = async (task, options, fetchFn) => {
921
921
  return { data, status: res.status, headers: res.headers };
922
922
  };
923
923
  export const getResumeTaskUrl = (task) => {
924
- return `https://assistant.leaflow.cloud/api/v1/tasks/${encodeURIComponent(String(task))}/resume`;
924
+ return `https://assistant.leaflow.cloud/api/v1/tasks/${encodeURIComponent(String(task))}:resume`;
925
925
  };
926
926
  /**
927
927
  * Lets its trigger start runs again. Missed runs within `catchupSeconds` are started. Resuming an active task succeeds.
@@ -937,7 +937,7 @@ export const resumeTask = async (task, options, fetchFn) => {
937
937
  return { data, status: res.status, headers: res.headers };
938
938
  };
939
939
  export const getCancelTaskRunUrl = (task) => {
940
- return `https://assistant.leaflow.cloud/api/v1/tasks/${encodeURIComponent(String(task))}/cancel`;
940
+ return `https://assistant.leaflow.cloud/api/v1/tasks/${encodeURIComponent(String(task))}:cancel`;
941
941
  };
942
942
  /**
943
943
  * Stops the run in progress. The conversation is told the run was cancelled. Succeeds when nothing is running.
@@ -1291,7 +1291,7 @@ export const deleteUpload = async (upload, options, fetchFn) => {
1291
1291
  return { data, status: res.status, headers: res.headers };
1292
1292
  };
1293
1293
  export const getCancelUploadUrl = (upload) => {
1294
- return `https://assistant.leaflow.cloud/api/v1/uploads/${encodeURIComponent(String(upload))}/cancel`;
1294
+ return `https://assistant.leaflow.cloud/api/v1/uploads/${encodeURIComponent(String(upload))}:cancel`;
1295
1295
  };
1296
1296
  /**
1297
1297
  * @summary Cancel upload
@@ -1306,7 +1306,7 @@ export const cancelUpload = async (upload, options, fetchFn) => {
1306
1306
  return { data, status: res.status, headers: res.headers };
1307
1307
  };
1308
1308
  export const getCompleteUploadUrl = (upload) => {
1309
- return `https://assistant.leaflow.cloud/api/v1/uploads/${encodeURIComponent(String(upload))}/complete`;
1309
+ return `https://assistant.leaflow.cloud/api/v1/uploads/${encodeURIComponent(String(upload))}:complete`;
1310
1310
  };
1311
1311
  /**
1312
1312
  * @summary Complete upload
@@ -1759,7 +1759,7 @@ export const listChannelRejections = async (channel, params, options, fetchFn) =
1759
1759
  return { data, status: res.status, headers: res.headers };
1760
1760
  };
1761
1761
  export const getRotateChannelSecretUrl = (channel) => {
1762
- return `https://assistant.leaflow.cloud/api/v1/channels/${encodeURIComponent(String(channel))}/secret`;
1762
+ return `https://assistant.leaflow.cloud/api/v1/channels/${encodeURIComponent(String(channel))}:rotateSecret`;
1763
1763
  };
1764
1764
  /**
1765
1765
  * Replaces the webhook secret. The old one stops working immediately and the channel drops back to awaiting confirmation from the platform. Which side owns the secret is decided by the platform; see secretSource on list-platforms. For a `generated` platform, send no body — the new secret is returned in this response only and cannot be retrieved again. For a `supplied` platform you must pass the new secret from that platform's own console.
@@ -1800,8 +1800,8 @@ export const getCheckSenderUrl = (channel, params) => {
1800
1800
  });
1801
1801
  const stringifiedParams = normalizedParams.toString();
1802
1802
  return stringifiedParams.length > 0
1803
- ? `https://assistant.leaflow.cloud/api/v1/channels/${encodeURIComponent(String(channel))}/sender-check?${stringifiedParams}`
1804
- : `https://assistant.leaflow.cloud/api/v1/channels/${encodeURIComponent(String(channel))}/sender-check`;
1803
+ ? `https://assistant.leaflow.cloud/api/v1/channels/${encodeURIComponent(String(channel))}:checkSender?${stringifiedParams}`
1804
+ : `https://assistant.leaflow.cloud/api/v1/channels/${encodeURIComponent(String(channel))}:checkSender`;
1805
1805
  };
1806
1806
  /**
1807
1807
  * For checking a sender policy after changing it. Sends nothing and changes nothing: it runs exactly the same decision a real inbound message goes through, and says which rule produced the answer. The binding-code rule cannot be tested this way — whether something is a binding code depends on what the sender actually wrote.
@@ -1865,7 +1865,7 @@ export const getWeixinLogin = async (login, options, fetchFn) => {
1865
1865
  return { data, status: res.status, headers: res.headers };
1866
1866
  };
1867
1867
  export const getSubmitWeixinVerifyCodeUrl = (login) => {
1868
- return `https://assistant.leaflow.cloud/api/v1/weixin-logins/${encodeURIComponent(String(login))}/verify-code`;
1868
+ return `https://assistant.leaflow.cloud/api/v1/weixin-logins/${encodeURIComponent(String(login))}:verifyCode`;
1869
1869
  };
1870
1870
  /**
1871
1871
  * For when WeChat asks for an SMS or device code after the scan. The person who started the login gets that code on their own phone.