@levr-one/sdk 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,8 +42,9 @@ Each function has matching request and response types. `client` and
42
42
  ## Authenticate
43
43
 
44
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`.
45
+ in `LEVR_TOKEN`. A personal access token is bound to the workspace it was
46
+ created in, so `LEVR_WORKSPACE_ID` is optional: leave it unset, or set it to
47
+ that same workspace. Naming a different workspace is refused.
47
48
 
48
49
  ```ts
49
50
  import { client } from '@levr-one/sdk';
@@ -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
+ GateBindingTransferExportConfigV1Data,
6
+ GateBindingTransferExportConfigV1Responses,
7
+ GateBindingTransferExportConfigV1Errors,
8
+ GateBindingTransferImportConfigV1Data,
9
+ GateBindingTransferImportConfigV1Responses,
10
+ GateBindingTransferImportConfigV1Errors,
11
+ } from './types.js';
12
+
13
+ /** GET /v1/gate/bindings/export */
14
+ export declare const gateBindingTransferExportConfigV1: <ThrowOnError extends boolean = false>(
15
+ options?: Options<GateBindingTransferExportConfigV1Data, ThrowOnError>,
16
+ ) => import('../../runtime/types.js').RequestResult<GateBindingTransferExportConfigV1Responses, GateBindingTransferExportConfigV1Errors, ThrowOnError>;
17
+
18
+ /** POST /v1/gate/bindings/import */
19
+ export declare const gateBindingTransferImportConfigV1: <ThrowOnError extends boolean = false>(
20
+ options: Options<GateBindingTransferImportConfigV1Data, ThrowOnError>,
21
+ ) => import('../../runtime/types.js').RequestResult<GateBindingTransferImportConfigV1Responses, GateBindingTransferImportConfigV1Errors, 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/gate/bindings/export */
6
+ export const gateBindingTransferExportConfigV1 = (options) => {
7
+ return (options?.client ?? _client).get({
8
+ security: [
9
+ {
10
+ scheme: 'bearer',
11
+ type: 'http',
12
+ },
13
+ ],
14
+ url: '/v1/gate/bindings/export',
15
+ ...options,
16
+ });
17
+ };
18
+
19
+ /** POST /v1/gate/bindings/import */
20
+ export const gateBindingTransferImportConfigV1 = (options) => {
21
+ return (options?.client ?? _client).post({
22
+ security: [
23
+ {
24
+ scheme: 'bearer',
25
+ type: 'http',
26
+ },
27
+ ],
28
+ url: '/v1/gate/bindings/import',
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,73 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+ export type ExportedGateConfigDto = {
3
+ description?: string;
4
+ definitions: Array<{
5
+ key: string;
6
+ name: string;
7
+ description: string | null | null;
8
+ technique: string;
9
+ category: string | null | null;
10
+ resolver_template: Record<string, unknown> | null;
11
+ }>;
12
+ bindings: Array<{
13
+ gate_key: string;
14
+ repo_key?: string;
15
+ path_prefix?: string;
16
+ enabled: boolean;
17
+ config: Record<string, unknown>;
18
+ }>;
19
+ };
20
+
21
+ export type GateConfigFileDto = {
22
+ description?: string;
23
+ definitions?: Array<Record<string, unknown>>;
24
+ bindings: Array<Record<string, unknown>>;
25
+ };
26
+
27
+ export type GateConfigImportResultDto = {
28
+ dry_run: boolean;
29
+ definitions: Array<{
30
+ key: string;
31
+ action: "create" | "exists" | "differs";
32
+ stored_id?: string;
33
+ applied: boolean;
34
+ }>;
35
+ bindings: Array<{
36
+ gate_key: string;
37
+ repo_key: string | null | null;
38
+ path_prefix: string | null | null;
39
+ action: "create" | "exists" | "differs" | "update" | "delete" | "absent";
40
+ stored_id?: string;
41
+ note?: string;
42
+ applied: boolean;
43
+ }>;
44
+ };
45
+
46
+ export type GateBindingTransferExportConfigV1Data = {
47
+ body?: never;
48
+ path?: never;
49
+ query?: never;
50
+ url: '/v1/gate/bindings/export';
51
+ };
52
+
53
+ export type GateBindingTransferExportConfigV1Responses = {
54
+ 200: ExportedGateConfigDto;
55
+ };
56
+
57
+ export type GateBindingTransferExportConfigV1Errors = unknown;
58
+
59
+ export type GateBindingTransferImportConfigV1Data = {
60
+ body: GateConfigFileDto;
61
+ path?: never;
62
+ query?: {
63
+ dry_run?: "true" | "false";
64
+ };
65
+ url: '/v1/gate/bindings/import';
66
+ };
67
+
68
+ export type GateBindingTransferImportConfigV1Responses = {
69
+ 200: GateConfigImportResultDto;
70
+ };
71
+
72
+ export type GateBindingTransferImportConfigV1Errors = unknown;
73
+
@@ -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,20 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { z } from 'zod/v3';
4
+
5
+ export declare const zExportedGateConfigDto: z.ZodType<import('./types.js').ExportedGateConfigDto>;
6
+
7
+ export type ExportedGateConfigDtoZodType = z.infer<typeof zExportedGateConfigDto>;
8
+
9
+ export declare const zGateConfigFileDto: z.ZodType<import('./types.js').GateConfigFileDto>;
10
+
11
+ export type GateConfigFileDtoZodType = z.infer<typeof zGateConfigFileDto>;
12
+
13
+ export declare const zGateConfigImportResultDto: z.ZodType<import('./types.js').GateConfigImportResultDto>;
14
+
15
+ export type GateConfigImportResultDtoZodType = z.infer<typeof zGateConfigImportResultDto>;
16
+
17
+ export declare const zGateBindingTransferExportConfigV1Data: z.ZodType<import('./types.js').GateBindingTransferExportConfigV1Data>;
18
+
19
+ export declare const zGateBindingTransferImportConfigV1Data: z.ZodType<import('./types.js').GateBindingTransferImportConfigV1Data>;
20
+
@@ -0,0 +1,60 @@
1
+ // Generated from the Levr OpenAPI specification. Do not edit.
2
+
3
+ import { z } from 'zod/v3';
4
+
5
+ export const zExportedGateConfigDto = /* @__PURE__ */ z.object({
6
+ description: z.string().optional(),
7
+ definitions: z.array(z.object({
8
+ key: z.string(),
9
+ name: z.string(),
10
+ description: z.string().nullable(),
11
+ technique: z.string(),
12
+ category: z.string().nullable(),
13
+ resolver_template: z.record(z.string(), z.unknown()).nullable(),
14
+ })),
15
+ bindings: z.array(z.object({
16
+ gate_key: z.string(),
17
+ repo_key: z.string().optional(),
18
+ path_prefix: z.string().optional(),
19
+ enabled: z.boolean(),
20
+ config: z.record(z.string(), z.unknown()),
21
+ })),
22
+ });
23
+
24
+ export const zGateConfigFileDto = /* @__PURE__ */ z.object({
25
+ description: z.string().optional(),
26
+ definitions: z.array(z.record(z.string(), z.unknown())).optional(),
27
+ bindings: z.array(z.record(z.string(), z.unknown())),
28
+ });
29
+
30
+ export const zGateConfigImportResultDto = /* @__PURE__ */ z.object({
31
+ dry_run: z.boolean(),
32
+ definitions: z.array(z.object({
33
+ key: z.string(),
34
+ action: z.enum(["create", "exists", "differs"]),
35
+ stored_id: z.string().optional(),
36
+ applied: z.boolean(),
37
+ })),
38
+ bindings: z.array(z.object({
39
+ gate_key: z.string(),
40
+ repo_key: z.string().nullable(),
41
+ path_prefix: z.string().nullable(),
42
+ action: z.enum(["create", "exists", "differs", "update", "delete", "absent"]),
43
+ stored_id: z.string().optional(),
44
+ note: z.string().optional(),
45
+ applied: z.boolean(),
46
+ })),
47
+ });
48
+
49
+ export const zGateBindingTransferExportConfigV1Data = /* @__PURE__ */ z.object({
50
+ url: z.literal('/v1/gate/bindings/export'),
51
+ });
52
+
53
+ export const zGateBindingTransferImportConfigV1Data = /* @__PURE__ */ z.object({
54
+ body: zGateConfigFileDto,
55
+ query: z.object({
56
+ 'dry_run': z.enum(["true", "false"]).optional(),
57
+ }).optional(),
58
+ url: z.literal('/v1/gate/bindings/import'),
59
+ });
60
+
@@ -7,6 +7,7 @@ export * from './auth/index.js';
7
7
  export * from './comment-issue/index.js';
8
8
  export * from './comment-run/index.js';
9
9
  export * from './comment-test/index.js';
10
+ export * from './gate-binding-transfer/index.js';
10
11
  export * from './import/index.js';
11
12
  export * from './issue/index.js';
12
13
  export * from './issue-gate-verification/index.js';
package/dist/gen/index.js CHANGED
@@ -7,6 +7,7 @@ export * from './auth/index.js';
7
7
  export * from './comment-issue/index.js';
8
8
  export * from './comment-run/index.js';
9
9
  export * from './comment-test/index.js';
10
+ export * from './gate-binding-transfer/index.js';
10
11
  export * from './import/index.js';
11
12
  export * from './issue/index.js';
12
13
  export * from './issue-gate-verification/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levr-one/sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "TypeScript SDK for the Levr API",
5
5
  "type": "module",
6
6
  "sideEffects": false,