@leaflow/sdk 0.0.0-dev.355.g42152f5 → 0.0.0-dev.357.gf8331d0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/account/v1/generated/functions.d.ts +85 -1
  2. package/dist/account/v1/generated/functions.js +65 -0
  3. package/dist/account/v1/generated/models.d.ts +31 -1
  4. package/dist/account/v1/generated/models.js +5 -0
  5. package/dist/account/v1/generated/schemas.zod.d.ts +45 -0
  6. package/dist/account/v1/generated/schemas.zod.js +45 -1
  7. package/dist/account/v1/generated/validators/acceptConsentsRequestBody.zod.d.ts +4 -0
  8. package/dist/account/v1/generated/validators/acceptConsentsRequestBody.zod.js +4 -0
  9. package/dist/account/v1/generated/validators/acceptInvitationByTokenRequestBody.zod.d.ts +4 -0
  10. package/dist/account/v1/generated/validators/acceptInvitationByTokenRequestBody.zod.js +4 -0
  11. package/dist/account/v1/generated/validators/acceptedInvitationResponseBody.zod.d.ts +5 -0
  12. package/dist/account/v1/generated/validators/acceptedInvitationResponseBody.zod.js +4 -0
  13. package/dist/account/v1/generated/validators/accountResource.zod.d.ts +4 -0
  14. package/dist/account/v1/generated/validators/accountResource.zod.js +4 -0
  15. package/dist/account/v1/generated/validators/agreementListResponseBody.zod.d.ts +4 -0
  16. package/dist/account/v1/generated/validators/agreementListResponseBody.zod.js +4 -0
  17. package/dist/account/v1/generated/validators/agreementResource.zod.d.ts +4 -0
  18. package/dist/account/v1/generated/validators/agreementResource.zod.js +4 -0
  19. package/dist/account/v1/generated/validators/consentBody.zod.d.ts +4 -0
  20. package/dist/account/v1/generated/validators/consentBody.zod.js +4 -0
  21. package/dist/account/v1/generated/validators/consentListResponseBody.zod.d.ts +4 -0
  22. package/dist/account/v1/generated/validators/consentListResponseBody.zod.js +4 -0
  23. package/dist/account/v1/generated/validators/consentResource.zod.d.ts +4 -0
  24. package/dist/account/v1/generated/validators/consentResource.zod.js +4 -0
  25. package/dist/account/v1/generated/validators/countryOption.zod.d.ts +4 -0
  26. package/dist/account/v1/generated/validators/countryOption.zod.js +4 -0
  27. package/dist/account/v1/generated/validators/createProjectRequestBody.zod.d.ts +6 -0
  28. package/dist/account/v1/generated/validators/createProjectRequestBody.zod.js +10 -0
  29. package/dist/account/v1/generated/validators/cursorPagination.zod.d.ts +4 -0
  30. package/dist/account/v1/generated/validators/cursorPagination.zod.js +4 -0
  31. package/dist/account/v1/generated/validators/error.zod.d.ts +4 -0
  32. package/dist/account/v1/generated/validators/error.zod.js +4 -0
  33. package/dist/account/v1/generated/validators/grantResource.zod.d.ts +4 -0
  34. package/dist/account/v1/generated/validators/grantResource.zod.js +4 -0
  35. package/dist/account/v1/generated/validators/identityVerificationResource.zod.d.ts +4 -0
  36. package/dist/account/v1/generated/validators/identityVerificationResource.zod.js +4 -0
  37. package/dist/account/v1/generated/validators/invitationPreviewResource.zod.d.ts +4 -0
  38. package/dist/account/v1/generated/validators/invitationPreviewResource.zod.js +4 -0
  39. package/dist/account/v1/generated/validators/invitationResource.zod.d.ts +4 -0
  40. package/dist/account/v1/generated/validators/invitationResource.zod.js +4 -0
  41. package/dist/account/v1/generated/validators/languageOption.zod.d.ts +4 -0
  42. package/dist/account/v1/generated/validators/languageOption.zod.js +4 -0
  43. package/dist/account/v1/generated/validators/lengthAwarePageInvitationResource.zod.d.ts +4 -0
  44. package/dist/account/v1/generated/validators/lengthAwarePageInvitationResource.zod.js +4 -0
  45. package/dist/account/v1/generated/validators/lengthAwarePageProjectAccessResource.zod.d.ts +5 -0
  46. package/dist/account/v1/generated/validators/lengthAwarePageProjectAccessResource.zod.js +4 -0
  47. package/dist/account/v1/generated/validators/listMyInvitationsParams.zod.d.ts +4 -0
  48. package/dist/account/v1/generated/validators/listMyInvitationsParams.zod.js +4 -0
  49. package/dist/account/v1/generated/validators/listProjectsParams.zod.d.ts +4 -0
  50. package/dist/account/v1/generated/validators/listProjectsParams.zod.js +5 -1
  51. package/dist/account/v1/generated/validators/locale.zod.d.ts +4 -0
  52. package/dist/account/v1/generated/validators/locale.zod.js +4 -0
  53. package/dist/account/v1/generated/validators/localeOptionsResource.zod.d.ts +4 -0
  54. package/dist/account/v1/generated/validators/localeOptionsResource.zod.js +4 -0
  55. package/dist/account/v1/generated/validators/offsetPagination.zod.d.ts +4 -0
  56. package/dist/account/v1/generated/validators/offsetPagination.zod.js +4 -0
  57. package/dist/account/v1/generated/validators/previewInvitationByTokenParams.zod.d.ts +4 -0
  58. package/dist/account/v1/generated/validators/previewInvitationByTokenParams.zod.js +4 -0
  59. package/dist/account/v1/generated/validators/projectAccessResource.zod.d.ts +5 -0
  60. package/dist/account/v1/generated/validators/projectAccessResource.zod.js +4 -0
  61. package/dist/account/v1/generated/validators/projectResource.zod.d.ts +6 -0
  62. package/dist/account/v1/generated/validators/projectResource.zod.js +10 -0
  63. package/dist/account/v1/generated/validators/projectSlugAvailabilityResource.zod.d.ts +34 -0
  64. package/dist/account/v1/generated/validators/projectSlugAvailabilityResource.zod.js +30 -0
  65. package/dist/account/v1/generated/validators/projectTraitResource.zod.d.ts +4 -0
  66. package/dist/account/v1/generated/validators/projectTraitResource.zod.js +4 -0
  67. package/dist/account/v1/generated/validators/registerRequestBody.zod.d.ts +4 -0
  68. package/dist/account/v1/generated/validators/registerRequestBody.zod.js +4 -0
  69. package/dist/account/v1/generated/validators/resourceRefResource.zod.d.ts +4 -0
  70. package/dist/account/v1/generated/validators/resourceRefResource.zod.js +4 -0
  71. package/dist/account/v1/generated/validators/ruleResource.zod.d.ts +4 -0
  72. package/dist/account/v1/generated/validators/ruleResource.zod.js +4 -0
  73. package/dist/account/v1/generated/validators/scopedTokenResponseBody.zod.d.ts +5 -0
  74. package/dist/account/v1/generated/validators/scopedTokenResponseBody.zod.js +4 -0
  75. package/dist/account/v1/generated/validators/settingsResource.zod.d.ts +4 -0
  76. package/dist/account/v1/generated/validators/settingsResource.zod.js +4 -0
  77. package/dist/account/v1/generated/validators/submitIdentityVerificationRequestBody.zod.d.ts +4 -0
  78. package/dist/account/v1/generated/validators/submitIdentityVerificationRequestBody.zod.js +4 -0
  79. package/dist/account/v1/generated/validators/updateAccountRequestBody.zod.d.ts +4 -0
  80. package/dist/account/v1/generated/validators/updateAccountRequestBody.zod.js +4 -0
  81. package/dist/compute/v1/generated/validators/allocateFloatingIPResponseBody.zod.d.ts +1 -1
  82. package/dist/compute/v1/generated/validators/backupListResponseBody.zod.d.ts +1 -1
  83. package/dist/compute/v1/generated/validators/backupResource.zod.d.ts +1 -1
  84. package/dist/compute/v1/generated/validators/createDiskResponseBody.zod.d.ts +2 -2
  85. package/dist/compute/v1/generated/validators/createImageResponseBody.zod.d.ts +1 -1
  86. package/dist/compute/v1/generated/validators/diskAttachment.zod.d.ts +1 -1
  87. package/dist/compute/v1/generated/validators/diskAttachmentList.zod.d.ts +1 -1
  88. package/dist/compute/v1/generated/validators/diskListResponseBody.zod.d.ts +2 -2
  89. package/dist/compute/v1/generated/validators/diskResource.zod.d.ts +2 -2
  90. package/dist/compute/v1/generated/validators/floatingIPListResponseBody.zod.d.ts +1 -1
  91. package/dist/compute/v1/generated/validators/floatingIPResource.zod.d.ts +1 -1
  92. package/dist/compute/v1/generated/validators/imageListResponseBody.zod.d.ts +1 -1
  93. package/dist/compute/v1/generated/validators/imageResource.zod.d.ts +1 -1
  94. package/dist/compute/v1/generated/validators/portAddress.zod.d.ts +1 -1
  95. package/dist/compute/v1/generated/validators/portAttachment.zod.d.ts +1 -1
  96. package/dist/compute/v1/generated/validators/portAttachmentList.zod.d.ts +1 -1
  97. package/dist/compute/v1/generated/validators/portListResponseBody.zod.d.ts +3 -3
  98. package/dist/compute/v1/generated/validators/portResource.zod.d.ts +3 -3
  99. package/dist/compute/v1/generated/validators/resizeDiskResponseBody.zod.d.ts +2 -2
  100. package/dist/compute/v1/generated/validators/setFloatingIPBandwidthResponseBody.zod.d.ts +1 -1
  101. package/dist/compute/v1/generated/validators/snapshotListResponseBody.zod.d.ts +1 -1
  102. package/dist/compute/v1/generated/validators/snapshotResource.zod.d.ts +1 -1
  103. package/dist/iam/v1/generated/functions.d.ts +31 -1
  104. package/dist/iam/v1/generated/functions.js +42 -0
  105. package/dist/iam/v1/generated/models.d.ts +14 -0
  106. package/dist/iam/v1/generated/schemas.zod.d.ts +16 -0
  107. package/dist/iam/v1/generated/schemas.zod.js +15 -0
  108. package/dist/iam/v1/generated/validators/projectAccessResource.zod.d.ts +1 -0
  109. package/dist/iam/v1/generated/validators/projectResource.zod.d.ts +2 -0
  110. package/dist/iam/v1/generated/validators/projectResource.zod.js +6 -0
  111. package/dist/iam/v1/generated/validators/setProjectSlugRequestBody.zod.d.ts +22 -0
  112. package/dist/iam/v1/generated/validators/setProjectSlugRequestBody.zod.js +24 -0
  113. package/dist/routes.d.ts +32 -0
  114. package/dist/routes.js +36 -0
  115. package/dist/type/resource/v1/generated/validators/attachment.zod.d.ts +1 -1
  116. package/dist/type/resource/v1/generated/validators/attachmentList.zod.d.ts +1 -1
  117. package/dist/type/resource/v1/generated/validators/resourceUsage.zod.d.ts +1 -1
  118. package/dist/type/resource/v1/generated/validators/resourceUsageList.zod.d.ts +1 -1
  119. package/package.json +1 -1
@@ -15,9 +15,13 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
- import type { AcceptConsentsRequestBody, AcceptInvitationByTokenRequestBody, AcceptedInvitationResponseBody, AccountResource, AgreementListResponseBody, ConsentListResponseBody, CreateProjectRequestBody, Error, IdentityVerificationResource, InvitationPreviewResource, LengthAwarePageInvitationResource, LengthAwarePageProjectAccessResource, ListMyInvitationsParams, ListProjectsParams, LocaleOptionsResource, PreviewInvitationByTokenParams, ProjectAccessResource, RegisterRequestBody, ScopedTokenResponseBody, SettingsResource, SubmitIdentityVerificationRequestBody, UpdateAccountRequestBody } from "./models.js";
24
+ import type { AcceptConsentsRequestBody, AcceptInvitationByTokenRequestBody, AcceptedInvitationResponseBody, AccountResource, AgreementListResponseBody, ConsentListResponseBody, CreateProjectRequestBody, Error, IdentityVerificationResource, InvitationPreviewResource, LengthAwarePageInvitationResource, LengthAwarePageProjectAccessResource, ListMyInvitationsParams, ListProjectsParams, LocaleOptionsResource, PreviewInvitationByTokenParams, ProjectAccessResource, ProjectSlugAvailabilityResource, RegisterRequestBody, ScopedTokenResponseBody, SettingsResource, SubmitIdentityVerificationRequestBody, UpdateAccountRequestBody } from "./models.js";
21
25
  export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
22
26
  export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
23
27
  export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
@@ -375,9 +379,89 @@ export type createProjectResponse = createProjectResponseSuccess | createProject
375
379
  export declare const getCreateProjectUrl: () => string;
376
380
  /**
377
381
  * The caller becomes its owner. The project is created with the built-in `OWNER` and `ADMIN` roles and a `member` role carrying no permissions.
382
+ *
383
+ * A custom `slug` may be chosen here; without one the slug is the new project's `id`. A custom slug is refused with:
384
+ *
385
+ * - 400 `PROJECT_SLUG_INVALID` when it does not follow the format described on `slug`;
386
+ * - 422 `PROJECT_SLUG_RESERVED` when the name is reserved;
387
+ * - 409 `PROJECT_SLUG_TAKEN` when another project, including a deleted one, holds it.
378
388
  * @summary Create a project
379
389
  */
380
390
  export declare const createProject: (createProjectRequestBody: CreateProjectRequestBody, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<createProjectResponse>;
391
+ export type getProjectBySlugResponse200 = {
392
+ data: ProjectAccessResource;
393
+ status: 200;
394
+ };
395
+ export type getProjectBySlugResponseDefault = {
396
+ data: Error;
397
+ status: Exclude<HTTPStatusCodes, 200>;
398
+ };
399
+ export type getProjectBySlugResponseSuccess = getProjectBySlugResponse200 & {
400
+ headers: Headers;
401
+ };
402
+ export type getProjectBySlugResponseError = getProjectBySlugResponseDefault & {
403
+ headers: Headers;
404
+ };
405
+ export type getProjectBySlugResponse = getProjectBySlugResponseSuccess | getProjectBySlugResponseError;
406
+ export declare const getGetProjectBySlugUrl: (slug: string) => string;
407
+ /**
408
+ * Returns a project the caller belongs to, found by an address label: a custom slug is compared exactly, and a label in the form of a project id finds the project with that id, whether or not it has since chosen a custom slug.
409
+ *
410
+ * A deleted project is returned, answering that it is gone. Fails with:
411
+ *
412
+ * - 400 `PROJECT_SLUG_INVALID` when the value cannot be a slug;
413
+ * - 404 `PROJECT_NOT_FOUND` when no project holds the slug;
414
+ * - 403 `PROJECT_MEMBERSHIP_REQUIRED` when the caller is not a member of the project.
415
+ * @summary Get a project by its slug
416
+ */
417
+ export declare const getProjectBySlug: (slug: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getProjectBySlugResponse>;
418
+ export type getProjectResponse200 = {
419
+ data: ProjectAccessResource;
420
+ status: 200;
421
+ };
422
+ export type getProjectResponseDefault = {
423
+ data: Error;
424
+ status: Exclude<HTTPStatusCodes, 200>;
425
+ };
426
+ export type getProjectResponseSuccess = getProjectResponse200 & {
427
+ headers: Headers;
428
+ };
429
+ export type getProjectResponseError = getProjectResponseDefault & {
430
+ headers: Headers;
431
+ };
432
+ export type getProjectResponse = getProjectResponseSuccess | getProjectResponseError;
433
+ export declare const getGetProjectUrl: (projectId: string) => string;
434
+ /**
435
+ * Returns a project the caller belongs to. A deleted project is returned, answering that it is gone. Fails with:
436
+ *
437
+ * - 404 `PROJECT_NOT_FOUND` when no project has the id;
438
+ * - 403 `PROJECT_MEMBERSHIP_REQUIRED` when the caller is not a member of the project.
439
+ * @summary Get a project
440
+ */
441
+ export declare const getProject: (projectId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getProjectResponse>;
442
+ export type getProjectSlugAvailabilityResponse200 = {
443
+ data: ProjectSlugAvailabilityResource;
444
+ status: 200;
445
+ };
446
+ export type getProjectSlugAvailabilityResponseDefault = {
447
+ data: Error;
448
+ status: Exclude<HTTPStatusCodes, 200>;
449
+ };
450
+ export type getProjectSlugAvailabilityResponseSuccess = getProjectSlugAvailabilityResponse200 & {
451
+ headers: Headers;
452
+ };
453
+ export type getProjectSlugAvailabilityResponseError = getProjectSlugAvailabilityResponseDefault & {
454
+ headers: Headers;
455
+ };
456
+ export type getProjectSlugAvailabilityResponse = getProjectSlugAvailabilityResponseSuccess | getProjectSlugAvailabilityResponseError;
457
+ export declare const getGetProjectSlugAvailabilityUrl: (slug: string) => string;
458
+ /**
459
+ * Reports whether a custom slug can be chosen now. Nothing is reserved by asking: the slug is claimed only by creating a project with it or by setting it, either of which may still fail with 409 `PROJECT_SLUG_TAKEN`.
460
+ *
461
+ * Fails with 400 `PROJECT_SLUG_INVALID` when the value does not follow the format of a custom slug.
462
+ * @summary Check whether a custom slug can be chosen
463
+ */
464
+ export declare const getProjectSlugAvailability: (slug: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getProjectSlugAvailabilityResponse>;
381
465
  export type createScopedTokenResponse201 = {
382
466
  data: ScopedTokenResponseBody;
383
467
  status: 201;
@@ -373,6 +373,12 @@ export const getCreateProjectUrl = () => {
373
373
  };
374
374
  /**
375
375
  * The caller becomes its owner. The project is created with the built-in `OWNER` and `ADMIN` roles and a `member` role carrying no permissions.
376
+ *
377
+ * A custom `slug` may be chosen here; without one the slug is the new project's `id`. A custom slug is refused with:
378
+ *
379
+ * - 400 `PROJECT_SLUG_INVALID` when it does not follow the format described on `slug`;
380
+ * - 422 `PROJECT_SLUG_RESERVED` when the name is reserved;
381
+ * - 409 `PROJECT_SLUG_TAKEN` when another project, including a deleted one, holds it.
376
382
  * @summary Create a project
377
383
  */
378
384
  export const createProject = async (createProjectRequestBody, options, fetchFn) => {
@@ -401,6 +407,65 @@ export const createProject = async (createProjectRequestBody, options, fetchFn)
401
407
  const data = body ? JSON.parse(body) : {};
402
408
  return { data, status: res.status, headers: res.headers };
403
409
  };
410
+ export const getGetProjectBySlugUrl = (slug) => {
411
+ return `https://account.leaflow.cloud/account/v1/projects/by-slug/${encodeURIComponent(String(slug))}`;
412
+ };
413
+ /**
414
+ * Returns a project the caller belongs to, found by an address label: a custom slug is compared exactly, and a label in the form of a project id finds the project with that id, whether or not it has since chosen a custom slug.
415
+ *
416
+ * A deleted project is returned, answering that it is gone. Fails with:
417
+ *
418
+ * - 400 `PROJECT_SLUG_INVALID` when the value cannot be a slug;
419
+ * - 404 `PROJECT_NOT_FOUND` when no project holds the slug;
420
+ * - 403 `PROJECT_MEMBERSHIP_REQUIRED` when the caller is not a member of the project.
421
+ * @summary Get a project by its slug
422
+ */
423
+ export const getProjectBySlug = async (slug, options, fetchFn) => {
424
+ const res = await (fetchFn ?? fetch)(getGetProjectBySlugUrl(slug), {
425
+ ...options,
426
+ method: "GET",
427
+ });
428
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
429
+ const data = body ? JSON.parse(body) : {};
430
+ return { data, status: res.status, headers: res.headers };
431
+ };
432
+ export const getGetProjectUrl = (projectId) => {
433
+ return `https://account.leaflow.cloud/account/v1/projects/${encodeURIComponent(String(projectId))}`;
434
+ };
435
+ /**
436
+ * Returns a project the caller belongs to. A deleted project is returned, answering that it is gone. Fails with:
437
+ *
438
+ * - 404 `PROJECT_NOT_FOUND` when no project has the id;
439
+ * - 403 `PROJECT_MEMBERSHIP_REQUIRED` when the caller is not a member of the project.
440
+ * @summary Get a project
441
+ */
442
+ export const getProject = async (projectId, options, fetchFn) => {
443
+ const res = await (fetchFn ?? fetch)(getGetProjectUrl(projectId), {
444
+ ...options,
445
+ method: "GET",
446
+ });
447
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
448
+ const data = body ? JSON.parse(body) : {};
449
+ return { data, status: res.status, headers: res.headers };
450
+ };
451
+ export const getGetProjectSlugAvailabilityUrl = (slug) => {
452
+ return `https://account.leaflow.cloud/account/v1/project-slugs/${encodeURIComponent(String(slug))}/availability`;
453
+ };
454
+ /**
455
+ * Reports whether a custom slug can be chosen now. Nothing is reserved by asking: the slug is claimed only by creating a project with it or by setting it, either of which may still fail with 409 `PROJECT_SLUG_TAKEN`.
456
+ *
457
+ * Fails with 400 `PROJECT_SLUG_INVALID` when the value does not follow the format of a custom slug.
458
+ * @summary Check whether a custom slug can be chosen
459
+ */
460
+ export const getProjectSlugAvailability = async (slug, options, fetchFn) => {
461
+ const res = await (fetchFn ?? fetch)(getGetProjectSlugAvailabilityUrl(slug), {
462
+ ...options,
463
+ method: "GET",
464
+ });
465
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
466
+ const data = body ? JSON.parse(body) : {};
467
+ return { data, status: res.status, headers: res.headers };
468
+ };
404
469
  export const getCreateScopedTokenUrl = (projectId) => {
405
470
  return `https://account.leaflow.cloud/account/v1/projects/${encodeURIComponent(String(projectId))}/scoped-tokens`;
406
471
  };
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  /**
@@ -315,6 +319,12 @@ export interface ProjectResource {
315
319
  deleted_at: string | null;
316
320
  description: string;
317
321
  id: string;
322
+ /**
323
+ * 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
324
+ * @minLength 1
325
+ * @maxLength 36
326
+ */
327
+ slug: string;
318
328
  name: string;
319
329
  updated_at: string;
320
330
  }
@@ -381,6 +391,26 @@ export interface CreateProjectRequestBody {
381
391
  * @maxLength 128
382
392
  */
383
393
  name: string;
394
+ /**
395
+ * A custom slug of 6 to 32 characters made of lower-case letters, digits and single hyphens, beginning with a letter and ending with a letter or digit. Omitted or empty, the slug is the new project's `id`, and a custom slug can be set once later
396
+ * @maxLength 32
397
+ */
398
+ slug?: string;
399
+ }
400
+ /**
401
+ * `available` when the slug can be chosen now, `reserved` when the name is reserved, and `taken` when a project, including a deleted one, holds it
402
+ */
403
+ export type ProjectSlugAvailabilityResourceStatus = (typeof ProjectSlugAvailabilityResourceStatus)[keyof typeof ProjectSlugAvailabilityResourceStatus];
404
+ export declare const ProjectSlugAvailabilityResourceStatus: {
405
+ readonly available: "available";
406
+ readonly reserved: "reserved";
407
+ readonly taken: "taken";
408
+ };
409
+ export interface ProjectSlugAvailabilityResource {
410
+ /** The slug asked about */
411
+ slug: string;
412
+ /** `available` when the slug can be chosen now, `reserved` when the name is reserved, and `taken` when a project, including a deleted one, holds it */
413
+ status: ProjectSlugAvailabilityResourceStatus;
384
414
  }
385
415
  export interface ScopedTokenResponseBody {
386
416
  /** When the token expires. Exchange for a new one before then rather than waiting for the first 401 */
@@ -452,7 +482,7 @@ export type ListProjectsParams = {
452
482
  */
453
483
  offset?: number;
454
484
  /**
455
- * Matches against name or description
485
+ * Matches against name, slug or description, and against the id when it is a complete project id
456
486
  * @maxLength 128
457
487
  */
458
488
  keyword?: string;
@@ -53,3 +53,8 @@ export const RuleResourceEffect = {
53
53
  allow: "allow",
54
54
  deny: "deny",
55
55
  };
56
+ export const ProjectSlugAvailabilityResourceStatus = {
57
+ available: "available",
58
+ reserved: "reserved",
59
+ taken: "taken",
60
+ };
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -134,11 +138,52 @@ export declare const ListProjectsQueryParams: zod.ZodObject<{
134
138
  }, zod.z.core.$strict>;
135
139
  /**
136
140
  * The caller becomes its owner. The project is created with the built-in `OWNER` and `ADMIN` roles and a `member` role carrying no permissions.
141
+ *
142
+ * A custom `slug` may be chosen here; without one the slug is the new project's `id`. A custom slug is refused with:
143
+ *
144
+ * - 400 `PROJECT_SLUG_INVALID` when it does not follow the format described on `slug`;
145
+ * - 422 `PROJECT_SLUG_RESERVED` when the name is reserved;
146
+ * - 409 `PROJECT_SLUG_TAKEN` when another project, including a deleted one, holds it.
137
147
  * @summary Create a project
138
148
  */
139
149
  export declare const CreateProjectBody: zod.ZodObject<{
140
150
  description: zod.ZodOptional<zod.ZodString>;
141
151
  name: zod.ZodString;
152
+ slug: zod.ZodOptional<zod.ZodString>;
153
+ }, zod.z.core.$strict>;
154
+ /**
155
+ * Returns a project the caller belongs to, found by an address label: a custom slug is compared exactly, and a label in the form of a project id finds the project with that id, whether or not it has since chosen a custom slug.
156
+ *
157
+ * A deleted project is returned, answering that it is gone. Fails with:
158
+ *
159
+ * - 400 `PROJECT_SLUG_INVALID` when the value cannot be a slug;
160
+ * - 404 `PROJECT_NOT_FOUND` when no project holds the slug;
161
+ * - 403 `PROJECT_MEMBERSHIP_REQUIRED` when the caller is not a member of the project.
162
+ * @summary Get a project by its slug
163
+ */
164
+ export declare const getProjectBySlugPathSlugMax = 63;
165
+ export declare const GetProjectBySlugParams: zod.ZodObject<{
166
+ slug: zod.ZodString;
167
+ }, zod.z.core.$strict>;
168
+ /**
169
+ * Returns a project the caller belongs to. A deleted project is returned, answering that it is gone. Fails with:
170
+ *
171
+ * - 404 `PROJECT_NOT_FOUND` when no project has the id;
172
+ * - 403 `PROJECT_MEMBERSHIP_REQUIRED` when the caller is not a member of the project.
173
+ * @summary Get a project
174
+ */
175
+ export declare const GetProjectParams: zod.ZodObject<{
176
+ projectId: zod.ZodUUID;
177
+ }, zod.z.core.$strict>;
178
+ /**
179
+ * Reports whether a custom slug can be chosen now. Nothing is reserved by asking: the slug is claimed only by creating a project with it or by setting it, either of which may still fail with 409 `PROJECT_SLUG_TAKEN`.
180
+ *
181
+ * Fails with 400 `PROJECT_SLUG_INVALID` when the value does not follow the format of a custom slug.
182
+ * @summary Check whether a custom slug can be chosen
183
+ */
184
+ export declare const getProjectSlugAvailabilityPathSlugMax = 63;
185
+ export declare const GetProjectSlugAvailabilityParams: zod.ZodObject<{
186
+ slug: zod.ZodString;
142
187
  }, zod.z.core.$strict>;
143
188
  /**
144
189
  * Once a project has been chosen, exchange the access token for a scoped token for that project.
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -127,14 +131,54 @@ export const ListProjectsQueryParams = zod.strictObject({
127
131
  .string()
128
132
  .max(listProjectsQueryKeywordMax)
129
133
  .optional()
130
- .describe("Matches against name or description"),
134
+ .describe("Matches against name, slug or description, and against the id when it is a complete project id"),
131
135
  include_deleted: zod.boolean().default(listProjectsQueryIncludeDeletedDefault),
132
136
  });
133
137
  /**
134
138
  * The caller becomes its owner. The project is created with the built-in `OWNER` and `ADMIN` roles and a `member` role carrying no permissions.
139
+ *
140
+ * A custom `slug` may be chosen here; without one the slug is the new project's `id`. A custom slug is refused with:
141
+ *
142
+ * - 400 `PROJECT_SLUG_INVALID` when it does not follow the format described on `slug`;
143
+ * - 422 `PROJECT_SLUG_RESERVED` when the name is reserved;
144
+ * - 409 `PROJECT_SLUG_TAKEN` when another project, including a deleted one, holds it.
135
145
  * @summary Create a project
136
146
  */
137
147
  export const CreateProjectBody = CreateProjectRequestBody;
148
+ /**
149
+ * Returns a project the caller belongs to, found by an address label: a custom slug is compared exactly, and a label in the form of a project id finds the project with that id, whether or not it has since chosen a custom slug.
150
+ *
151
+ * A deleted project is returned, answering that it is gone. Fails with:
152
+ *
153
+ * - 400 `PROJECT_SLUG_INVALID` when the value cannot be a slug;
154
+ * - 404 `PROJECT_NOT_FOUND` when no project holds the slug;
155
+ * - 403 `PROJECT_MEMBERSHIP_REQUIRED` when the caller is not a member of the project.
156
+ * @summary Get a project by its slug
157
+ */
158
+ export const getProjectBySlugPathSlugMax = 63;
159
+ export const GetProjectBySlugParams = zod.strictObject({
160
+ slug: zod.string().min(1).max(getProjectBySlugPathSlugMax),
161
+ });
162
+ /**
163
+ * Returns a project the caller belongs to. A deleted project is returned, answering that it is gone. Fails with:
164
+ *
165
+ * - 404 `PROJECT_NOT_FOUND` when no project has the id;
166
+ * - 403 `PROJECT_MEMBERSHIP_REQUIRED` when the caller is not a member of the project.
167
+ * @summary Get a project
168
+ */
169
+ export const GetProjectParams = zod.strictObject({
170
+ projectId: zod.uuid(),
171
+ });
172
+ /**
173
+ * Reports whether a custom slug can be chosen now. Nothing is reserved by asking: the slug is claimed only by creating a project with it or by setting it, either of which may still fail with 409 `PROJECT_SLUG_TAKEN`.
174
+ *
175
+ * Fails with 400 `PROJECT_SLUG_INVALID` when the value does not follow the format of a custom slug.
176
+ * @summary Check whether a custom slug can be chosen
177
+ */
178
+ export const getProjectSlugAvailabilityPathSlugMax = 63;
179
+ export const GetProjectSlugAvailabilityParams = zod.strictObject({
180
+ slug: zod.string().min(1).max(getProjectSlugAvailabilityPathSlugMax),
181
+ });
138
182
  /**
139
183
  * Once a project has been chosen, exchange the access token for a scoped token for that project.
140
184
  *
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -35,6 +39,7 @@ export declare const AcceptedInvitationResponseBody: zod.ZodObject<{
35
39
  deleted_at: zod.ZodNullable<zod.z.ZodISODateTime>;
36
40
  description: zod.ZodString;
37
41
  id: zod.ZodUUID;
42
+ slug: zod.ZodString;
38
43
  name: zod.ZodString;
39
44
  updated_at: zod.z.ZodISODateTime;
40
45
  }, zod.z.core.$strict>;
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";
@@ -15,6 +15,10 @@
15
15
  * 3. Every other service is called with that scoped token.
16
16
  *
17
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.
18
22
  * OpenAPI spec version: 1.0.0
19
23
  */
20
24
  import * as zod from "zod";