@supernova-studio/client 0.58.19 → 0.58.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +325 -3
- package/dist/index.d.ts +325 -3
- package/dist/index.js +58 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +111 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/export/exporter.ts +2 -2
- package/src/api/dto/export/job.ts +9 -0
- package/src/api/endpoints/codegen/codegen.ts +3 -0
- package/src/api/endpoints/codegen/exporters.ts +13 -1
- package/src/api/endpoints/codegen/index.ts +1 -0
- package/src/api/endpoints/codegen/jobs.ts +15 -0
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ export const DTOExporterMembership = z.object({
|
|
|
48
48
|
role: DTOExporterMembershipRole,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
export const
|
|
51
|
+
export const DTOExporterResponse = z.object({
|
|
52
52
|
exporter: DTOExporter,
|
|
53
53
|
membership: DTOExporterMembership,
|
|
54
54
|
});
|
|
@@ -64,7 +64,7 @@ export type DTOExporterSource = z.infer<typeof DTOExporterSource>;
|
|
|
64
64
|
export type DTOExporterMembershipRole = z.infer<typeof DTOExporterMembershipRole>;
|
|
65
65
|
export type DTOExporter = z.infer<typeof DTOExporter>;
|
|
66
66
|
export type DTOExporterMembership = z.infer<typeof DTOExporterMembership>;
|
|
67
|
-
export type
|
|
67
|
+
export type DTOExporterResponse = z.infer<typeof DTOExporterResponse>;
|
|
68
68
|
export type DTOExporterListResponse = z.infer<typeof DTOExporterListResponse>;
|
|
69
69
|
|
|
70
70
|
//
|
|
@@ -78,6 +78,15 @@ export const DTOExportJobResponse = z.object({
|
|
|
78
78
|
job: DTOExportJob,
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
+
// Deprecated: Use only for test purposes and extend if only necessary. This defines the BE response for an export job.
|
|
82
|
+
export const DTOExportJobResponseLegacy = z.object({
|
|
83
|
+
job: z.object({
|
|
84
|
+
id: z.string(),
|
|
85
|
+
status: ExportJobStatus,
|
|
86
|
+
}),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export type DTOExportJobResponseLegacy = z.infer<typeof DTOExportJobResponseLegacy>;
|
|
81
90
|
export type DTOExportJobCreatedBy = z.infer<typeof DTOExportJobCreatedBy>;
|
|
82
91
|
export type DTOExportJobDesignSystemPreview = z.infer<typeof DTOExportJobDesignSystemPreview>;
|
|
83
92
|
export type DTOExportJobDesignSystemVersionPreview = z.infer<typeof DTOExportJobDesignSystemVersionPreview>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { RequestExecutor } from "../../transport";
|
|
2
2
|
import { ExportersEndpoint } from "./exporters";
|
|
3
|
+
import { ExporterJobsEndpoint } from "./jobs";
|
|
3
4
|
import { PipelinesEndpoint } from "./pipelines";
|
|
4
5
|
|
|
5
6
|
export class CodegenEndpoint {
|
|
6
7
|
readonly exporters: ExportersEndpoint;
|
|
7
8
|
readonly pipelines: PipelinesEndpoint;
|
|
9
|
+
readonly jobs: ExporterJobsEndpoint;
|
|
8
10
|
|
|
9
11
|
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
10
12
|
this.pipelines = new PipelinesEndpoint(requestExecutor);
|
|
11
13
|
this.exporters = new ExportersEndpoint(requestExecutor);
|
|
14
|
+
this.jobs = new ExporterJobsEndpoint(requestExecutor);
|
|
12
15
|
}
|
|
13
16
|
}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { serializeQuery } from "../../../utils";
|
|
2
|
-
import {
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTOExporterCreateInput, DTOExporterResponse, DTOExporterListQuery, DTOExporterListResponse } from "../../dto";
|
|
3
4
|
import { RequestExecutor } from "../../transport";
|
|
4
5
|
|
|
5
6
|
export class ExportersEndpoint {
|
|
6
7
|
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
8
|
|
|
9
|
+
add(workspaceId: string, body: DTOExporterCreateInput) {
|
|
10
|
+
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterResponse, {
|
|
11
|
+
body,
|
|
12
|
+
method: "POST",
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
list(workspaceId: string, query: DTOExporterListQuery) {
|
|
9
17
|
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterListResponse, {
|
|
10
18
|
query: serializeQuery(query),
|
|
11
19
|
});
|
|
12
20
|
}
|
|
21
|
+
|
|
22
|
+
get(workspaceId: string, exporterId: string) {
|
|
23
|
+
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters/${exporterId}`, DTOExporterResponse);
|
|
24
|
+
}
|
|
13
25
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOExportJobResponseLegacy } from "../../dto";
|
|
3
|
+
import { RequestExecutor } from "../../transport";
|
|
4
|
+
|
|
5
|
+
export class ExporterJobsEndpoint {
|
|
6
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
|
+
|
|
8
|
+
list(workspaceId: string) {
|
|
9
|
+
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs`, z.any());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get(workspaceId: string, jobId: string) {
|
|
13
|
+
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs/${jobId}`, DTOExportJobResponseLegacy);
|
|
14
|
+
}
|
|
15
|
+
}
|