@supernova-studio/client 0.46.0 → 0.46.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.46.0",
3
+ "version": "0.46.4",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -25,7 +25,6 @@
25
25
  "scripts": {
26
26
  "build": "tsup",
27
27
  "typecheck": "tsc --noEmit",
28
- "publish": "npm run build && npm publish",
29
28
  "test:unit": "vitest run",
30
29
  "index": "node ./create-indexes.js"
31
30
  },
@@ -1,12 +1,13 @@
1
- import { Integration } from "@supernova-studio/model";
1
+ import { ExtendedIntegration } from "@supernova-studio/model";
2
2
  import { DTOIntegration } from "../../dto";
3
3
 
4
- export function integrationToDto(integration: Integration): DTOIntegration {
4
+ export function integrationToDto(integration: ExtendedIntegration): DTOIntegration {
5
5
  return {
6
6
  id: integration.id,
7
7
  workspaceId: integration.workspaceId,
8
8
  type: integration.type,
9
9
  createdAt: integration.createdAt,
10
10
  integrationCredentials: integration.integrationCredentials ?? undefined,
11
+ integrationDesignSystems: integration.integrationDesignSystems ?? undefined,
11
12
  };
12
13
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { ObjectMeta } from "@supernova-studio/model";
2
+ import { ObjectMeta, VersionCreationJob, OmitStrict } from "@supernova-studio/model";
3
3
  import { DTOCreateVersionInput } from "../../payloads";
4
4
 
5
5
  export const DTODesignSystemVersion = z.object({
@@ -26,9 +26,11 @@ export const DTODesignSystemVersionCreationResponse = z.object({
26
26
  changeLog: z.string(),
27
27
  isReadOnly: z.boolean(),
28
28
  designSystemId: z.string(),
29
+ jobId: z.string(),
29
30
  })
30
31
 
31
32
  export const VersionSQSPayload = z.object({
33
+ jobId: z.string(),
32
34
  designSystemId: z.string(),
33
35
  input: DTOCreateVersionInput,
34
36
  });
@@ -39,3 +41,17 @@ export type DTODesignSystemVersionCreationResponse = z.infer<typeof DTODesignSys
39
41
  export type DTODesignSystemVersion = z.infer<typeof DTODesignSystemVersion>;
40
42
  export type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystemVersionsListResponse>;
41
43
  export type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;
44
+
45
+
46
+ export const DTODesignSystemVersionJobsResponse = z.object({
47
+ jobs: z.array(VersionCreationJob)
48
+ })
49
+
50
+ export type DTODesignSystemVersionJobsResponse = z.infer<typeof DTODesignSystemVersionJobsResponse>;
51
+
52
+ // Creation job status response
53
+ export const DTODesignSystemVersionJobStatusResponse = z.object({
54
+ job: VersionCreationJob
55
+ });
56
+
57
+ export type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;
@@ -5,6 +5,12 @@ import { z } from "zod";
5
5
  // Read
6
6
  //
7
7
 
8
+ export const DTOFigmaNodeOrigin = z.object({
9
+ sourceId: z.string(),
10
+ fileId: z.string().optional(),
11
+ parentName: z.string().optional(),
12
+ });
13
+
8
14
  export const DTOFigmaNodeData = z.object({
9
15
  // Id of the node in the Figma file
10
16
  figmaNodeId: z.string(),
@@ -24,10 +30,13 @@ export const DTOFigmaNodeData = z.object({
24
30
 
25
31
  export const DTOFigmaNode = FigmaFileStructure.omit({
26
32
  data: true,
33
+ origin: true
27
34
  }).extend({
28
35
  data: DTOFigmaNodeData,
36
+ origin: DTOFigmaNodeOrigin
29
37
  });
30
38
 
39
+ export type DTOFigmaNodeOrigin = z.infer<typeof DTOFigmaNodeOrigin>;
31
40
  export type DTOFigmaNodeData = z.infer<typeof DTOFigmaNodeData>;
32
41
  export type DTOFigmaNode = z.infer<typeof DTOFigmaNode>;
33
42
 
@@ -1,12 +1,13 @@
1
- import { IntegrationCredentials, IntegrationType } from "@supernova-studio/model";
1
+ import { IntegrationCredentials, IntegrationDesignSystem, ExtendedIntegrationType } from "@supernova-studio/model";
2
2
  import { z } from "zod";
3
3
 
4
4
  export const DTOIntegration = z.object({
5
5
  id: z.string(),
6
6
  workspaceId: z.string(),
7
- type: IntegrationType,
7
+ type: ExtendedIntegrationType,
8
8
  createdAt: z.coerce.date(),
9
9
  integrationCredentials: z.array(IntegrationCredentials).optional(),
10
+ integrationDesignSystems: z.array(IntegrationDesignSystem).optional(),
10
11
  });
11
12
 
12
13
  export const DTOIntegrationOAuthGetResponse = z.object({
@@ -5,14 +5,14 @@ export const ObjectMeta = z.object({
5
5
  description: z.string().max(2000).optional(),
6
6
  });
7
7
 
8
- export function validateSemver(version: string) {
9
- const semverRegex = /^(\d+)(\.\d+)?(\.\d+)?$/;
10
- return semverRegex.test(version);
8
+ export function validateDesignSystemVersion(version: string) {
9
+ const urlCompliantRegex = /^[a-zA-Z0-9+.-]+$/;
10
+ return urlCompliantRegex.test(version);
11
11
  }
12
12
 
13
13
  export const DTOCreateVersionInput = z.object({
14
14
  meta: ObjectMeta,
15
- version: z.string().refine(validateSemver, {
15
+ version: z.string().refine(validateDesignSystemVersion, {
16
16
  message: "Invalid semantic versioning format",
17
17
  }),
18
18
  changeLog: z.string().max(2000).optional()
File without changes