@supernova-studio/client 0.59.4 → 0.59.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.59.4",
3
+ "version": "0.59.6",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -43,7 +43,7 @@ const DTOFigmaNodeRenderInputBase = z.object({
43
43
  * Figma node render request that uses source ID + node ID to identify the requested
44
44
  * node to render. The node ID can be obtained from the source's Figma node structure.
45
45
  */
46
- const DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({
46
+ export const DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({
47
47
  inputType: z
48
48
  .literal("NodeId")
49
49
  .optional()
@@ -64,7 +64,7 @@ const DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({
64
64
  * Figma node render request that uses Figma URL to identify the requested
65
65
  * node to render. The URL can be obtained by the user directly from the Figma app.
66
66
  */
67
- const DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({
67
+ export const DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({
68
68
  inputType: z.literal("URL"),
69
69
 
70
70
  /**
@@ -78,11 +78,26 @@ const DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({
78
78
  brandPersistentId: z.string(),
79
79
  });
80
80
 
81
+ /**
82
+ * Figma node render request that uses Figma URL to identify the requested
83
+ * node to render. The URL can be obtained by the user directly from the Figma app.
84
+ */
85
+ export const DTOFigmaNodeRerenderInput = z.object({
86
+ inputType: z.literal("Rerender"),
87
+
88
+ /**
89
+ * Persistent ID of an existing Figma node
90
+ */
91
+ figmaNodePersistentId: z.string(),
92
+ });
93
+
81
94
  export const DTOFigmaNodeRenderInput = z.discriminatedUnion("inputType", [
82
95
  DTOFigmaNodeRenderIdInput,
83
96
  DTOFigmaNodeRenderUrlInput,
97
+ DTOFigmaNodeRerenderInput,
84
98
  ]);
85
99
 
86
100
  export type DTOFigmaNodeRenderIdInput = z.infer<typeof DTOFigmaNodeRenderIdInput>;
87
101
  export type DTOFigmaNodeRenderUrlInput = z.infer<typeof DTOFigmaNodeRenderUrlInput>;
102
+ export type DTOFigmaNodeRerenderInput = z.infer<typeof DTOFigmaNodeRerenderInput>;
88
103
  export type DTOFigmaNodeRenderInput = z.infer<typeof DTOFigmaNodeRenderInput>;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { DTOFigmaNodeRenderInput } from "./figma-node";
2
+ import { DTOFigmaNodeRenderIdInput, DTOFigmaNodeRenderInput } from "./figma-node";
3
3
  import { DTOFigmaNode } from "./figma-node-v1";
4
4
  import { DTOFigmaNodeV2 } from "./figma-node-v2";
5
5
 
@@ -32,7 +32,7 @@ export type DTOFigmaNodeRenderAsyncActionOutput = z.infer<typeof DTOFigmaNodeRen
32
32
  */
33
33
  export const DTOFigmaNodeRenderActionInput = z.object({
34
34
  type: z.literal("FigmaNodeRender"),
35
- input: DTOFigmaNodeRenderInput.array(),
35
+ input: DTOFigmaNodeRenderIdInput.array(),
36
36
  });
37
37
 
38
38
  export const DTOFigmaNodeRenderAsyncActionInput = z.object({
@@ -22,13 +22,19 @@ const PropertyDefinitionBase = z.object({
22
22
  key: z.string(),
23
23
  title: z.string(),
24
24
  description: z.string(),
25
+ category: z.string().optional(),
26
+ dependsOn: z.record(z.boolean()).optional(),
25
27
  });
26
28
 
27
29
  export type DTOPropertyDefinitionBase = z.infer<typeof PropertyDefinitionBase>;
30
+ export const DTOExporterPropertyDefinitionEnumOption = z.object({
31
+ label: z.string(),
32
+ description: z.string(),
33
+ });
28
34
 
29
35
  export const DTOExporterPropertyDefinitionEnum = PropertyDefinitionBase.extend({
30
36
  type: z.literal(DTOExporterPropertyType.Enum.Enum),
31
- options: z.string().array(),
37
+ options: z.record(DTOExporterPropertyDefinitionEnumOption),
32
38
  default: z.string(),
33
39
  });
34
40
 
@@ -88,6 +94,7 @@ export type DTOExporterPropertyDefinitionNumber = z.infer<typeof DTOExporterProp
88
94
  export type DTOExporterPropertyDefinitionArray = z.infer<typeof DTOExporterPropertyDefinitionArray>;
89
95
  export type DTOExporterPropertyDefinitionObject = z.infer<typeof DTOExporterPropertyDefinitionObject>;
90
96
  export type DTOExporterPropertyDefinition = z.infer<typeof DTOExporterPropertyDefinition>;
97
+ export type DTOExporterPropertyDefinitionEnumOption = z.infer<typeof DTOExporterPropertyDefinitionEnumOption>;
91
98
  export type DTOExporterPropertyDefinitionsResponse = z.infer<typeof DTOExporterPropertyDefinitionsResponse>;
92
99
 
93
100
  //
@@ -4,6 +4,7 @@ import {
4
4
  DTOCreateDocumentationTabInput,
5
5
  DTOElementActionInput,
6
6
  DTOElementActionOutput,
7
+ DTOFigmaNodeRenderIdInput,
7
8
  DTOFigmaNodeRenderInput,
8
9
  DTOMoveDocumentationGroupInput,
9
10
  DTOUpdateDocumentationGroupInput,
@@ -38,7 +39,7 @@ export class ElementsActionEndpoint {
38
39
  return this.action(dsId, vId, { type: "DocumentationTabCreate", input });
39
40
  }
40
41
 
41
- async renderNodes(dsId: string, vId: string, input: DTOFigmaNodeRenderInput[]) {
42
+ async renderNodes(dsId: string, vId: string, input: DTOFigmaNodeRenderIdInput[]) {
42
43
  return this.action(dsId, vId, { type: "FigmaNodeRender", input });
43
44
  }
44
45