@supernova-studio/client 0.55.8 → 0.55.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.55.8",
3
+ "version": "0.55.10",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -1,10 +1,10 @@
1
+ import { ObjectMeta, VersionCreationJob } from "@supernova-studio/model";
1
2
  import { z } from "zod";
2
- import { ObjectMeta, VersionCreationJob, OmitStrict } from "@supernova-studio/model";
3
3
  import { DTOCreateVersionInput } from "../../payloads";
4
4
 
5
5
  export const DTODesignSystemVersion = z.object({
6
6
  id: z.string(),
7
- createdAt: z.date(),
7
+ createdAt: z.coerce.date(),
8
8
  meta: ObjectMeta,
9
9
  version: z.string(),
10
10
  isReadonly: z.boolean(),
@@ -27,7 +27,7 @@ export const DTODesignSystemVersionCreationResponse = z.object({
27
27
  isReadOnly: z.boolean(),
28
28
  designSystemId: z.string(),
29
29
  jobId: z.string(),
30
- })
30
+ });
31
31
 
32
32
  export const VersionSQSPayload = z.object({
33
33
  jobId: z.string(),
@@ -42,16 +42,15 @@ export type DTODesignSystemVersion = z.infer<typeof DTODesignSystemVersion>;
42
42
  export type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystemVersionsListResponse>;
43
43
  export type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;
44
44
 
45
-
46
45
  export const DTODesignSystemVersionJobsResponse = z.object({
47
- jobs: z.array(VersionCreationJob)
48
- })
46
+ jobs: z.array(VersionCreationJob),
47
+ });
49
48
 
50
49
  export type DTODesignSystemVersionJobsResponse = z.infer<typeof DTODesignSystemVersionJobsResponse>;
51
50
 
52
51
  // Creation job status response
53
52
  export const DTODesignSystemVersionJobStatusResponse = z.object({
54
- job: VersionCreationJob
53
+ job: VersionCreationJob,
55
54
  });
56
55
 
57
56
  export type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;
@@ -0,0 +1,10 @@
1
+ import { DTODesignSystemVersionsListResponse } from "../dto";
2
+ import { RequestExecutor } from "../transport/request-executor";
3
+
4
+ export class DesignSystemVersionsEndpoint {
5
+ constructor(private readonly requestExecutor: RequestExecutor) {}
6
+
7
+ list(dsId: string) {
8
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions`, DTODesignSystemVersionsListResponse);
9
+ }
10
+ }
@@ -3,11 +3,15 @@ import { DTODesignSystemCreateInput, DTODesignSystemResponse, DTODesignSystemsLi
3
3
  import { DTODesignSystemUpdateAccessModeInput, DTODesignSystemUpdateInput } from "../payloads";
4
4
  import { RequestExecutor } from "../transport/request-executor";
5
5
  import { DesignSystemMembersEndpoint } from "./design-system-members";
6
+ import { DesignSystemVersionsEndpoint } from "./design-system-versions";
6
7
 
7
8
  export class DesignSystemsEndpoint {
8
- members: DesignSystemMembersEndpoint;
9
+ readonly members: DesignSystemMembersEndpoint;
10
+ readonly versions: DesignSystemVersionsEndpoint;
11
+
9
12
  constructor(private readonly requestExecutor: RequestExecutor) {
10
13
  this.members = new DesignSystemMembersEndpoint(requestExecutor);
14
+ this.versions = new DesignSystemVersionsEndpoint(requestExecutor);
11
15
  }
12
16
 
13
17
  create(body: DTODesignSystemCreateInput) {
@@ -1,4 +1,5 @@
1
1
  export * from "./design-system-members";
2
+ export * from "./design-system-versions";
2
3
  export * from "./design-systems";
3
4
  export * from "./users";
4
5
  export * from "./workspace-invites";