@supernova-studio/client 0.52.4 → 0.52.6

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.52.4",
3
+ "version": "0.52.6",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,13 @@
1
- import { FigmaFileStructure } from "@supernova-studio/model";
1
+ import { FigmaNodeReference, FigmaNodeRenderFormat } from "@supernova-studio/model";
2
2
  import { z } from "zod";
3
3
 
4
+ //
5
+ // Enums
6
+ //
7
+
8
+ export const DTOFigmaNodeRenderFormat = FigmaNodeRenderFormat;
9
+ export type DTOFigmaNodeRenderFormat = z.infer<typeof DTOFigmaNodeRenderFormat>;
10
+
4
11
  //
5
12
  // Read
6
13
  //
@@ -21,6 +28,7 @@ export const DTOFigmaNodeData = z.object({
21
28
  // Asset data
22
29
  assetId: z.string(),
23
30
  assetUrl: z.string(),
31
+ assetFormat: DTOFigmaNodeRenderFormat,
24
32
 
25
33
  // Asset metadata
26
34
  assetScale: z.number(),
@@ -28,12 +36,12 @@ export const DTOFigmaNodeData = z.object({
28
36
  assetHeight: z.number().optional(),
29
37
  });
30
38
 
31
- export const DTOFigmaNode = FigmaFileStructure.omit({
39
+ export const DTOFigmaNode = FigmaNodeReference.omit({
32
40
  data: true,
33
- origin: true
41
+ origin: true,
34
42
  }).extend({
35
43
  data: DTOFigmaNodeData,
36
- origin: DTOFigmaNodeOrigin
44
+ origin: DTOFigmaNodeOrigin,
37
45
  });
38
46
 
39
47
  export type DTOFigmaNodeOrigin = z.infer<typeof DTOFigmaNodeOrigin>;
@@ -45,11 +53,20 @@ export type DTOFigmaNode = z.infer<typeof DTOFigmaNode>;
45
53
  //
46
54
 
47
55
  export const DTOFigmaNodeRenderInput = z.object({
48
- // Id of a design system's data source representing a linked Figma file
56
+ /**
57
+ * Id of a design system's data source representing a linked Figma file
58
+ */
49
59
  sourceId: z.string(),
50
60
 
51
- // Id of a node within the Figma file
61
+ /**
62
+ * Id of a node within the Figma file
63
+ */
52
64
  figmaFileNodeId: z.string(),
65
+
66
+ /**
67
+ * Format in which the node must be rendered, png by default.
68
+ */
69
+ format: FigmaNodeRenderFormat.default("Png"),
53
70
  });
54
71
 
55
72
  export type DTOFigmaNodeRenderInput = z.infer<typeof DTOFigmaNodeRenderInput>;