@levr-one/sdk 0.0.0-stage → 1.0.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.
Files changed (108) hide show
  1. package/README.md +132 -2
  2. package/dist/client.config.d.ts +3 -0
  3. package/dist/client.config.js +5 -0
  4. package/dist/gen/_common/index.d.ts +3 -0
  5. package/dist/gen/_common/index.js +3 -0
  6. package/dist/gen/_common/types.d.ts +29 -0
  7. package/dist/gen/_common/types.js +2 -0
  8. package/dist/gen/_common/zod.d.ts +10 -0
  9. package/dist/gen/_common/zod.js +31 -0
  10. package/dist/gen/attachment-upload/functions.d.ts +14 -0
  11. package/dist/gen/attachment-upload/functions.js +28 -0
  12. package/dist/gen/attachment-upload/index.d.ts +4 -0
  13. package/dist/gen/attachment-upload/index.js +4 -0
  14. package/dist/gen/attachment-upload/types.d.ts +40 -0
  15. package/dist/gen/attachment-upload/types.js +2 -0
  16. package/dist/gen/attachment-upload/zod.d.ts +14 -0
  17. package/dist/gen/attachment-upload/zod.js +34 -0
  18. package/dist/gen/auth/functions.d.ts +22 -0
  19. package/dist/gen/auth/functions.js +32 -0
  20. package/dist/gen/auth/index.d.ts +4 -0
  21. package/dist/gen/auth/index.js +4 -0
  22. package/dist/gen/auth/types.d.ts +52 -0
  23. package/dist/gen/auth/types.js +2 -0
  24. package/dist/gen/auth/zod.d.ts +16 -0
  25. package/dist/gen/auth/zod.js +37 -0
  26. package/dist/gen/comment-issue/functions.d.ts +14 -0
  27. package/dist/gen/comment-issue/functions.js +18 -0
  28. package/dist/gen/comment-issue/index.d.ts +4 -0
  29. package/dist/gen/comment-issue/index.js +4 -0
  30. package/dist/gen/comment-issue/types.d.ts +40 -0
  31. package/dist/gen/comment-issue/types.js +2 -0
  32. package/dist/gen/comment-issue/zod.d.ts +14 -0
  33. package/dist/gen/comment-issue/zod.js +35 -0
  34. package/dist/gen/comment-run/functions.d.ts +14 -0
  35. package/dist/gen/comment-run/functions.js +18 -0
  36. package/dist/gen/comment-run/index.d.ts +4 -0
  37. package/dist/gen/comment-run/index.js +4 -0
  38. package/dist/gen/comment-run/types.d.ts +40 -0
  39. package/dist/gen/comment-run/types.js +2 -0
  40. package/dist/gen/comment-run/zod.d.ts +14 -0
  41. package/dist/gen/comment-run/zod.js +35 -0
  42. package/dist/gen/comment-test/functions.d.ts +14 -0
  43. package/dist/gen/comment-test/functions.js +18 -0
  44. package/dist/gen/comment-test/index.d.ts +4 -0
  45. package/dist/gen/comment-test/index.js +4 -0
  46. package/dist/gen/comment-test/types.d.ts +40 -0
  47. package/dist/gen/comment-test/types.js +2 -0
  48. package/dist/gen/comment-test/zod.d.ts +14 -0
  49. package/dist/gen/comment-test/zod.js +35 -0
  50. package/dist/gen/import/functions.d.ts +14 -0
  51. package/dist/gen/import/functions.js +28 -0
  52. package/dist/gen/import/index.d.ts +4 -0
  53. package/dist/gen/import/index.js +4 -0
  54. package/dist/gen/import/types.d.ts +90 -0
  55. package/dist/gen/import/types.js +2 -0
  56. package/dist/gen/import/zod.d.ts +14 -0
  57. package/dist/gen/import/zod.js +85 -0
  58. package/dist/gen/index.d.ts +15 -0
  59. package/dist/gen/index.js +15 -0
  60. package/dist/gen/issue/functions.d.ts +14 -0
  61. package/dist/gen/issue/functions.js +18 -0
  62. package/dist/gen/issue/index.d.ts +4 -0
  63. package/dist/gen/issue/index.js +4 -0
  64. package/dist/gen/issue/types.d.ts +125 -0
  65. package/dist/gen/issue/types.js +2 -0
  66. package/dist/gen/issue/zod.d.ts +10 -0
  67. package/dist/gen/issue/zod.js +114 -0
  68. package/dist/gen/issue-gate-verification/functions.d.ts +22 -0
  69. package/dist/gen/issue-gate-verification/functions.js +32 -0
  70. package/dist/gen/issue-gate-verification/index.d.ts +4 -0
  71. package/dist/gen/issue-gate-verification/index.js +4 -0
  72. package/dist/gen/issue-gate-verification/types.d.ts +46 -0
  73. package/dist/gen/issue-gate-verification/types.js +2 -0
  74. package/dist/gen/issue-gate-verification/zod.d.ts +12 -0
  75. package/dist/gen/issue-gate-verification/zod.js +38 -0
  76. package/dist/gen/run-api/functions.d.ts +14 -0
  77. package/dist/gen/run-api/functions.js +18 -0
  78. package/dist/gen/run-api/index.d.ts +4 -0
  79. package/dist/gen/run-api/index.js +4 -0
  80. package/dist/gen/run-api/types.d.ts +93 -0
  81. package/dist/gen/run-api/types.js +2 -0
  82. package/dist/gen/run-api/zod.d.ts +14 -0
  83. package/dist/gen/run-api/zod.js +57 -0
  84. package/dist/gen/team/functions.d.ts +14 -0
  85. package/dist/gen/team/functions.js +18 -0
  86. package/dist/gen/team/index.d.ts +4 -0
  87. package/dist/gen/team/index.js +4 -0
  88. package/dist/gen/team/types.d.ts +69 -0
  89. package/dist/gen/team/types.js +2 -0
  90. package/dist/gen/team/zod.d.ts +10 -0
  91. package/dist/gen/team/zod.js +58 -0
  92. package/dist/gen/test-case-import/functions.d.ts +22 -0
  93. package/dist/gen/test-case-import/functions.js +42 -0
  94. package/dist/gen/test-case-import/index.d.ts +4 -0
  95. package/dist/gen/test-case-import/index.js +4 -0
  96. package/dist/gen/test-case-import/types.d.ts +142 -0
  97. package/dist/gen/test-case-import/types.js +2 -0
  98. package/dist/gen/test-case-import/zod.d.ts +24 -0
  99. package/dist/gen/test-case-import/zod.js +129 -0
  100. package/dist/index.d.ts +4 -0
  101. package/dist/index.js +5 -0
  102. package/dist/runtime/client.d.ts +2 -0
  103. package/dist/runtime/client.js +229 -0
  104. package/dist/runtime/index.d.ts +3 -0
  105. package/dist/runtime/index.js +8 -0
  106. package/dist/runtime/types.d.ts +83 -0
  107. package/dist/runtime/types.js +1 -0
  108. package/package.json +41 -4
package/README.md CHANGED
@@ -1,3 +1,133 @@
1
- # Temporary Holding Version
1
+ # @levr-one/sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The TypeScript SDK for the Levr API: typed functions, with request and
4
+ response types and zod validators, generated from the published OpenAPI spec.
5
+ It covers the part of the API listed below, not every endpoint, and grows as
6
+ operations are added.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install @levr-one/sdk
12
+ ```
13
+
14
+ The package is **ESM only** and needs Node.js 18 or later. There is no
15
+ CommonJS build: from CommonJS code, load it with a dynamic import inside an
16
+ async function, `const sdk = await import('@levr-one/sdk')`. The upload
17
+ examples below use the global `File`, which Node.js has from version 20; on
18
+ Node.js 18, take it from `node:buffer` (`import { File } from 'node:buffer'`).
19
+
20
+ ## What it covers
21
+
22
+ | Function | Request |
23
+ | --- | --- |
24
+ | `importCreateV1` | `POST /v1/imports` — import a test report |
25
+ | `authGetProfileV1` | `GET /v1/auth/profile` — the signed-in user |
26
+ | `authGetSitesV1` | `GET /v1/auth/sites` — the workspaces you belong to |
27
+ | `teamFindAllV1` | `GET /v1/team` — list teams |
28
+ | `issueFindAllV1` | `GET /v1/issue` — list issues |
29
+ | `issueGateVerificationVerifyGatesV1` | `POST /v1/issue/{id}/verify-gates` — run an issue's gates |
30
+ | `issueGateVerificationReportGateResultsV1` | `POST /v1/issue/{id}/gate-results` — report gate results |
31
+ | `testCaseImportPreviewV1` | `POST /v1/test-case-import/preview` — preview a test case import |
32
+ | `testCaseImportCommitV1` | `POST /v1/test-case-import/commit` — commit a test case import |
33
+ | `attachmentUploadUploadV1` | `POST /v1/attachment/upload` — attach a file |
34
+ | `commentIssueCreateV1` | `POST /v1/comment-issue` — comment on an issue |
35
+ | `commentTestCreateV1` | `POST /v1/comment-test` — comment on a test |
36
+ | `commentRunCreateV1` | `POST /v1/comment-run` — comment on a run |
37
+ | `runApiUpdateRunResultVariantByIdV1` | `PATCH /v1/run/run-result-variant/{runResultVariantId}` — update a run result |
38
+
39
+ Each function has matching request and response types. `client` and
40
+ `createClient` configure where and how requests are sent.
41
+
42
+ ## Authenticate
43
+
44
+ Create a personal access token in Levr (Settings → Access tokens) and keep it
45
+ in `LEVR_TOKEN`. If your account belongs to more than one workspace, also set
46
+ `LEVR_WORKSPACE_ID`.
47
+
48
+ ```ts
49
+ import { client } from '@levr-one/sdk';
50
+
51
+ client.setConfig({
52
+ baseUrl: 'https://api.levr.one',
53
+ auth: () => process.env.LEVR_TOKEN ?? '',
54
+ workspaceId: process.env.LEVR_WORKSPACE_ID,
55
+ });
56
+ ```
57
+
58
+ ## Errors
59
+
60
+ A call resolves with `{ data, error }` and never throws for an HTTP error
61
+ status: check `error` (or `response.ok`). `error` is the parsed response body:
62
+ the JSON object when the body is JSON, otherwise its text, and `{}` when the
63
+ body is empty.
64
+
65
+ To throw instead, pass `throwOnError: true` on the call. It is a per-call
66
+ option; `client.setConfig` does not accept it. What is thrown is that same
67
+ parsed body, not an `Error` instance.
68
+
69
+ ```ts
70
+ import { teamFindAllV1 } from '@levr-one/sdk';
71
+
72
+ try {
73
+ const { data } = await teamFindAllV1({ throwOnError: true });
74
+ console.log(data);
75
+ } catch (body) {
76
+ console.error('request failed:', body);
77
+ }
78
+ ```
79
+
80
+ ## Attach a file
81
+
82
+ Attach a screenshot to an issue by its identifier. Send the text fields
83
+ before the file.
84
+
85
+ ```ts
86
+ import { readFile } from 'node:fs/promises';
87
+ import { attachmentUploadUploadV1 } from '@levr-one/sdk';
88
+
89
+ const bytes = await readFile('screenshot.png');
90
+ const { data, error } = await attachmentUploadUploadV1({
91
+ body: {
92
+ related_type: 'issue',
93
+ related_id: 'QA-42', // an issue identifier, or its UUID
94
+ file: new File([bytes], 'screenshot.png', { type: 'image/png' }),
95
+ },
96
+ });
97
+ if (error) throw new Error(JSON.stringify(error));
98
+ console.log(data?.id, data?.target_id);
99
+ ```
100
+
101
+ For a CI artifact on an automation result, use
102
+ `related_type: 'automation_run_result'` with the result id, plus `kind`
103
+ (`screenshot`, `trace`, `video`, …) and, for an earlier attempt,
104
+ `attempt_index`. An identical re-upload returns the existing attachment.
105
+
106
+ ## Import a test report
107
+
108
+ ```ts
109
+ import { readFile } from 'node:fs/promises';
110
+ import { importCreateV1 } from '@levr-one/sdk';
111
+
112
+ const xml = await readFile('junit.xml');
113
+ const { data, error } = await importCreateV1({
114
+ body: {
115
+ file: new File([xml], 'junit.xml', { type: 'application/xml' }),
116
+ automation_source: 'e2e',
117
+ include_results: true,
118
+ },
119
+ });
120
+ if (error) throw new Error(JSON.stringify(error));
121
+ console.log(data?.result?.run_id, data?.result?.results?.length);
122
+ ```
123
+
124
+ ## Versioning
125
+
126
+ Each release increments the patch version automatically; minor and major
127
+ versions are set by hand. Adding a function is a patch or minor release;
128
+ removing or renaming one is a major release. The SDK tracks the Levr API, so
129
+ update it alongside the `levr` CLI.
130
+
131
+ ## License
132
+
133
+ MIT
@@ -0,0 +1,3 @@
1
+ import type { CreateClientConfig } from './runtime/types.js';
2
+ export declare const createClientConfig: CreateClientConfig;
3
+ export { createClientConfig as default };
@@ -0,0 +1,5 @@
1
+ export const createClientConfig = (config) => ({
2
+ baseUrl: 'https://api.levr.one',
3
+ ...config,
4
+ });
5
+ export { createClientConfig as default };
@@ -0,0 +1,3 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export * from './types.js';
3
+ export * from './zod.js';
@@ -0,0 +1,3 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export * from './types.js';
3
+ export * from './zod.js';
@@ -0,0 +1,29 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ // Shared schemas referenced by multiple controllers
3
+
4
+ export type PaginatedMetaDocumented = {
5
+ itemsPerPage: number;
6
+ totalItems: number;
7
+ currentPage: number;
8
+ totalPages: number;
9
+ sortBy?: Array<Array<string | "ASC" | "DESC">>;
10
+ searchBy?: Array<string>;
11
+ search?: string;
12
+ select?: Array<string>;
13
+ filter?: Record<string, unknown>;
14
+ };
15
+
16
+ export type PaginatedLinksDocumented = {
17
+ first?: string;
18
+ previous?: string;
19
+ current?: string;
20
+ next?: string;
21
+ last?: string;
22
+ };
23
+
24
+ export type PaginatedDocumented = {
25
+ data: Array<Record<string, unknown>>;
26
+ meta: PaginatedMetaDocumented;
27
+ links: PaginatedLinksDocumented;
28
+ };
29
+
@@ -0,0 +1,2 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ // Types-only — no JS runtime
@@ -0,0 +1,10 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ export declare const zPaginatedMetaDocumented: import('zod/v3').ZodType<import('./types.js').PaginatedMetaDocumented>;
4
+ export type PaginatedMetaDocumentedZodType = import('zod/v3').z.infer<typeof zPaginatedMetaDocumented>;
5
+
6
+ export declare const zPaginatedLinksDocumented: import('zod/v3').ZodType<import('./types.js').PaginatedLinksDocumented>;
7
+ export type PaginatedLinksDocumentedZodType = import('zod/v3').z.infer<typeof zPaginatedLinksDocumented>;
8
+
9
+ export declare const zPaginatedDocumented: import('zod/v3').ZodType<import('./types.js').PaginatedDocumented>;
10
+ export type PaginatedDocumentedZodType = import('zod/v3').z.infer<typeof zPaginatedDocumented>;
@@ -0,0 +1,31 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ // Shared Zod schemas referenced by multiple controllers
3
+
4
+ import { z } from 'zod/v3';
5
+
6
+ export const zPaginatedMetaDocumented = /* @__PURE__ */ z.object({
7
+ itemsPerPage: z.number(),
8
+ totalItems: z.number(),
9
+ currentPage: z.number(),
10
+ totalPages: z.number(),
11
+ sortBy: z.array(z.array(z.union([z.string(), z.enum(["ASC", "DESC"])]))).optional(),
12
+ searchBy: z.array(z.string()).optional(),
13
+ search: z.string().optional(),
14
+ select: z.array(z.string()).optional(),
15
+ filter: z.record(z.string(), z.unknown()).optional(),
16
+ });
17
+
18
+ export const zPaginatedLinksDocumented = /* @__PURE__ */ z.object({
19
+ first: z.string().optional(),
20
+ previous: z.string().optional(),
21
+ current: z.string().optional(),
22
+ next: z.string().optional(),
23
+ last: z.string().optional(),
24
+ });
25
+
26
+ export const zPaginatedDocumented = /* @__PURE__ */ z.object({
27
+ data: z.array(z.record(z.string(), z.unknown())),
28
+ meta: zPaginatedMetaDocumented,
29
+ links: zPaginatedLinksDocumented,
30
+ });
31
+
@@ -0,0 +1,14 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import type { Options } from '../../runtime/types.js';
4
+ import type {
5
+ AttachmentUploadUploadV1Data,
6
+ AttachmentUploadUploadV1Responses,
7
+ AttachmentUploadUploadV1Errors,
8
+ } from './types.js';
9
+
10
+ /** POST /v1/attachment/upload */
11
+ export declare const attachmentUploadUploadV1: <ThrowOnError extends boolean = false>(
12
+ options: Options<AttachmentUploadUploadV1Data, ThrowOnError>,
13
+ ) => import('../../runtime/types.js').RequestResult<AttachmentUploadUploadV1Responses, AttachmentUploadUploadV1Errors, ThrowOnError>;
14
+
@@ -0,0 +1,28 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { client as _client } from '../../runtime/index.js';
4
+
5
+ /** POST /v1/attachment/upload */
6
+ export const attachmentUploadUploadV1 = (options) => {
7
+ return (options?.client ?? _client).post({
8
+ security: [
9
+ {
10
+ scheme: 'bearer',
11
+ type: 'http',
12
+ },
13
+ ],
14
+ url: '/v1/attachment/upload',
15
+ bodySerializer: (body) => {
16
+ const fd = new FormData();
17
+ if (body && typeof body === 'object') {
18
+ for (const [k, v] of Object.entries(body)) {
19
+ if (v == null) continue;
20
+ fd.append(k, v instanceof Blob ? v : String(v));
21
+ }
22
+ }
23
+ return fd;
24
+ },
25
+ ...options,
26
+ });
27
+ };
28
+
@@ -0,0 +1,4 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export * from './types.js';
3
+ export * from './functions.js';
4
+ export * from './zod.js';
@@ -0,0 +1,4 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export * from './types.js';
3
+ export * from './functions.js';
4
+ export * from './zod.js';
@@ -0,0 +1,40 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export type AttachmentUploadUploadV1Body = {
3
+ related_type: "test" | "step" | "folder" | "plan" | "defect" | "requirement" | "run_result" | "run_result_step" | "import_job" | "run" | "issue" | "project" | "initiative" | "cycle" | "staged" | "data_set" | "run_result_variant" | "research_step" | "project_update" | "automation_run_result" | "unlinked";
4
+ related_id?: string;
5
+ kind?: "screenshot" | "video" | "trace" | "stdout_log" | "stderr_log" | "har" | "report" | "attachment" | "other";
6
+ attempt_index?: number;
7
+ is_public?: boolean;
8
+ file: Blob;
9
+ };
10
+
11
+ export type UploadAttachmentResponseDto = {
12
+ id: string;
13
+ url: string | null | null;
14
+ private_url: string | null | null;
15
+ original_file_name: string;
16
+ mime_type: string | null | null;
17
+ size: number | null | null;
18
+ is_public: boolean;
19
+ created_at: string;
20
+ related_type: "test" | "step" | "folder" | "plan" | "defect" | "requirement" | "run_result" | "run_result_step" | "import_job" | "run" | "issue" | "project" | "initiative" | "cycle" | "staged" | "data_set" | "run_result_variant" | "research_step" | "project_update" | "automation_run_result" | "unlinked";
21
+ target_id: string | null | null;
22
+ kind: "screenshot" | "video" | "trace" | "stdout_log" | "stderr_log" | "har" | "report" | "attachment" | "other" | null;
23
+ attempt_index: number | null | null;
24
+ deduplicated: boolean;
25
+ };
26
+
27
+ export type AttachmentUploadUploadV1Data = {
28
+ body: AttachmentUploadUploadV1Body;
29
+ path?: never;
30
+ query?: never;
31
+ url: '/v1/attachment/upload';
32
+ };
33
+
34
+ export type AttachmentUploadUploadV1Responses = {
35
+ 200: UploadAttachmentResponseDto;
36
+ 201: UploadAttachmentResponseDto;
37
+ };
38
+
39
+ export type AttachmentUploadUploadV1Errors = unknown;
40
+
@@ -0,0 +1,2 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ // Types-only file — JS runtime is empty unless enums exist
@@ -0,0 +1,14 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { z } from 'zod/v3';
4
+
5
+ export declare const zAttachmentUploadUploadV1Body: z.ZodType<import('./types.js').AttachmentUploadUploadV1Body>;
6
+
7
+ export type AttachmentUploadUploadV1BodyZodType = z.infer<typeof zAttachmentUploadUploadV1Body>;
8
+
9
+ export declare const zUploadAttachmentResponseDto: z.ZodType<import('./types.js').UploadAttachmentResponseDto>;
10
+
11
+ export type UploadAttachmentResponseDtoZodType = z.infer<typeof zUploadAttachmentResponseDto>;
12
+
13
+ export declare const zAttachmentUploadUploadV1Data: z.ZodType<import('./types.js').AttachmentUploadUploadV1Data>;
14
+
@@ -0,0 +1,34 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { z } from 'zod/v3';
4
+
5
+ export const zAttachmentUploadUploadV1Body = /* @__PURE__ */ z.object({
6
+ related_type: z.enum(["test", "step", "folder", "plan", "defect", "requirement", "run_result", "run_result_step", "import_job", "run", "issue", "project", "initiative", "cycle", "staged", "data_set", "run_result_variant", "research_step", "project_update", "automation_run_result", "unlinked"]),
7
+ related_id: z.string().optional(),
8
+ kind: z.enum(["screenshot", "video", "trace", "stdout_log", "stderr_log", "har", "report", "attachment", "other"]).optional(),
9
+ attempt_index: z.number().optional(),
10
+ is_public: z.boolean().optional(),
11
+ file: z.instanceof(Blob),
12
+ });
13
+
14
+ export const zUploadAttachmentResponseDto = /* @__PURE__ */ z.object({
15
+ id: z.string(),
16
+ url: z.string().nullable(),
17
+ private_url: z.string().nullable(),
18
+ original_file_name: z.string(),
19
+ mime_type: z.string().nullable(),
20
+ size: z.number().nullable(),
21
+ is_public: z.boolean(),
22
+ created_at: z.string(),
23
+ related_type: z.enum(["test", "step", "folder", "plan", "defect", "requirement", "run_result", "run_result_step", "import_job", "run", "issue", "project", "initiative", "cycle", "staged", "data_set", "run_result_variant", "research_step", "project_update", "automation_run_result", "unlinked"]),
24
+ target_id: z.string().nullable(),
25
+ kind: z.enum(["screenshot", "video", "trace", "stdout_log", "stderr_log", "har", "report", "attachment", "other"]).nullable(),
26
+ attempt_index: z.number().nullable(),
27
+ deduplicated: z.boolean(),
28
+ });
29
+
30
+ export const zAttachmentUploadUploadV1Data = /* @__PURE__ */ z.object({
31
+ body: zAttachmentUploadUploadV1Body,
32
+ url: z.literal('/v1/attachment/upload'),
33
+ });
34
+
@@ -0,0 +1,22 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import type { Options } from '../../runtime/types.js';
4
+ import type {
5
+ AuthGetProfileV1Data,
6
+ AuthGetProfileV1Responses,
7
+ AuthGetProfileV1Errors,
8
+ AuthGetSitesV1Data,
9
+ AuthGetSitesV1Responses,
10
+ AuthGetSitesV1Errors,
11
+ } from './types.js';
12
+
13
+ /** GET /v1/auth/profile */
14
+ export declare const authGetProfileV1: <ThrowOnError extends boolean = false>(
15
+ options?: Options<AuthGetProfileV1Data, ThrowOnError>,
16
+ ) => import('../../runtime/types.js').RequestResult<AuthGetProfileV1Responses, AuthGetProfileV1Errors, ThrowOnError>;
17
+
18
+ /** GET /v1/auth/sites */
19
+ export declare const authGetSitesV1: <ThrowOnError extends boolean = false>(
20
+ options?: Options<AuthGetSitesV1Data, ThrowOnError>,
21
+ ) => import('../../runtime/types.js').RequestResult<AuthGetSitesV1Responses, AuthGetSitesV1Errors, ThrowOnError>;
22
+
@@ -0,0 +1,32 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { client as _client } from '../../runtime/index.js';
4
+
5
+ /** GET /v1/auth/profile */
6
+ export const authGetProfileV1 = (options) => {
7
+ return (options?.client ?? _client).get({
8
+ security: [
9
+ {
10
+ scheme: 'bearer',
11
+ type: 'http',
12
+ },
13
+ ],
14
+ url: '/v1/auth/profile',
15
+ ...options,
16
+ });
17
+ };
18
+
19
+ /** GET /v1/auth/sites */
20
+ export const authGetSitesV1 = (options) => {
21
+ return (options?.client ?? _client).get({
22
+ security: [
23
+ {
24
+ scheme: 'bearer',
25
+ type: 'http',
26
+ },
27
+ ],
28
+ url: '/v1/auth/sites',
29
+ ...options,
30
+ });
31
+ };
32
+
@@ -0,0 +1,4 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export * from './types.js';
3
+ export * from './functions.js';
4
+ export * from './zod.js';
@@ -0,0 +1,4 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export * from './types.js';
3
+ export * from './functions.js';
4
+ export * from './zod.js';
@@ -0,0 +1,52 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export type UserProfileResponseDto = {
3
+ id: string;
4
+ user_account_id?: string;
5
+ email?: string;
6
+ name?: string;
7
+ avatar_url?: string;
8
+ color?: string;
9
+ verified?: boolean;
10
+ workspace_id?: string;
11
+ active_team_id?: string | null | null;
12
+ };
13
+
14
+ export type SitesResponseDto = {
15
+ sites: Array<{
16
+ workspace_id: string;
17
+ workspace_name: string;
18
+ workspace_url_key: string;
19
+ user_id: string;
20
+ role: "owner" | "admin" | "member" | "guest";
21
+ is_primary: boolean;
22
+ last_accessed_at: string | null | null;
23
+ }>;
24
+ current_workspace_id: string;
25
+ };
26
+
27
+ export type AuthGetProfileV1Data = {
28
+ body?: never;
29
+ path?: never;
30
+ query?: never;
31
+ url: '/v1/auth/profile';
32
+ };
33
+
34
+ export type AuthGetProfileV1Responses = {
35
+ 200: UserProfileResponseDto;
36
+ };
37
+
38
+ export type AuthGetProfileV1Errors = unknown;
39
+
40
+ export type AuthGetSitesV1Data = {
41
+ body?: never;
42
+ path?: never;
43
+ query?: never;
44
+ url: '/v1/auth/sites';
45
+ };
46
+
47
+ export type AuthGetSitesV1Responses = {
48
+ 200: SitesResponseDto;
49
+ };
50
+
51
+ export type AuthGetSitesV1Errors = unknown;
52
+
@@ -0,0 +1,2 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ // Types-only file — JS runtime is empty unless enums exist
@@ -0,0 +1,16 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { z } from 'zod/v3';
4
+
5
+ export declare const zUserProfileResponseDto: z.ZodType<import('./types.js').UserProfileResponseDto>;
6
+
7
+ export type UserProfileResponseDtoZodType = z.infer<typeof zUserProfileResponseDto>;
8
+
9
+ export declare const zSitesResponseDto: z.ZodType<import('./types.js').SitesResponseDto>;
10
+
11
+ export type SitesResponseDtoZodType = z.infer<typeof zSitesResponseDto>;
12
+
13
+ export declare const zAuthGetProfileV1Data: z.ZodType<import('./types.js').AuthGetProfileV1Data>;
14
+
15
+ export declare const zAuthGetSitesV1Data: z.ZodType<import('./types.js').AuthGetSitesV1Data>;
16
+
@@ -0,0 +1,37 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { z } from 'zod/v3';
4
+
5
+ export const zUserProfileResponseDto = /* @__PURE__ */ z.object({
6
+ id: z.string(),
7
+ user_account_id: z.string().optional(),
8
+ email: z.string().optional(),
9
+ name: z.string().optional(),
10
+ avatar_url: z.string().optional(),
11
+ color: z.string().optional(),
12
+ verified: z.boolean().optional(),
13
+ workspace_id: z.string().optional(),
14
+ active_team_id: z.string().nullable().optional(),
15
+ });
16
+
17
+ export const zSitesResponseDto = /* @__PURE__ */ z.object({
18
+ sites: z.array(z.object({
19
+ workspace_id: z.string(),
20
+ workspace_name: z.string(),
21
+ workspace_url_key: z.string(),
22
+ user_id: z.string(),
23
+ role: z.enum(["owner", "admin", "member", "guest"]),
24
+ is_primary: z.boolean(),
25
+ last_accessed_at: z.string().nullable(),
26
+ })),
27
+ current_workspace_id: z.string(),
28
+ });
29
+
30
+ export const zAuthGetProfileV1Data = /* @__PURE__ */ z.object({
31
+ url: z.literal('/v1/auth/profile'),
32
+ });
33
+
34
+ export const zAuthGetSitesV1Data = /* @__PURE__ */ z.object({
35
+ url: z.literal('/v1/auth/sites'),
36
+ });
37
+
@@ -0,0 +1,14 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import type { Options } from '../../runtime/types.js';
4
+ import type {
5
+ CommentIssueCreateV1Data,
6
+ CommentIssueCreateV1Responses,
7
+ CommentIssueCreateV1Errors,
8
+ } from './types.js';
9
+
10
+ /** POST /v1/comment-issue */
11
+ export declare const commentIssueCreateV1: <ThrowOnError extends boolean = false>(
12
+ options: Options<CommentIssueCreateV1Data, ThrowOnError>,
13
+ ) => import('../../runtime/types.js').RequestResult<CommentIssueCreateV1Responses, CommentIssueCreateV1Errors, ThrowOnError>;
14
+
@@ -0,0 +1,18 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { client as _client } from '../../runtime/index.js';
4
+
5
+ /** POST /v1/comment-issue */
6
+ export const commentIssueCreateV1 = (options) => {
7
+ return (options?.client ?? _client).post({
8
+ security: [
9
+ {
10
+ scheme: 'bearer',
11
+ type: 'http',
12
+ },
13
+ ],
14
+ url: '/v1/comment-issue',
15
+ ...options,
16
+ });
17
+ };
18
+
@@ -0,0 +1,4 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export * from './types.js';
3
+ export * from './functions.js';
4
+ export * from './zod.js';
@@ -0,0 +1,4 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export * from './types.js';
3
+ export * from './functions.js';
4
+ export * from './zod.js';
@@ -0,0 +1,40 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export type CreateCommentIssueDto = {
3
+ id?: string;
4
+ body?: string | null | null;
5
+ key?: number;
6
+ source?: unknown | null;
7
+ spoke_key?: string | null | null;
8
+ issue_id: string;
9
+ };
10
+
11
+ export type ResponseCommentIssueDto = {
12
+ id: string;
13
+ body?: string | null | null;
14
+ key?: number;
15
+ source?: unknown | null;
16
+ spoke_key?: string | null | null;
17
+ issue_id: string;
18
+ created_at: unknown;
19
+ updated_at: unknown;
20
+ epoch: number;
21
+ created_by: string;
22
+ updated_by: string;
23
+ workspace_id: string;
24
+ deleted_at: unknown | null;
25
+ deleted_by: string | null | null;
26
+ };
27
+
28
+ export type CommentIssueCreateV1Data = {
29
+ body: CreateCommentIssueDto;
30
+ path?: never;
31
+ query?: never;
32
+ url: '/v1/comment-issue';
33
+ };
34
+
35
+ export type CommentIssueCreateV1Responses = {
36
+ 201: ResponseCommentIssueDto;
37
+ };
38
+
39
+ export type CommentIssueCreateV1Errors = unknown;
40
+
@@ -0,0 +1,2 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ // Types-only file — JS runtime is empty unless enums exist