@supernova-studio/client 0.59.11 → 1.0.0-alpha.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.
Files changed (203) hide show
  1. package/dist/index.d.mts +1590 -1909
  2. package/dist/index.d.ts +1590 -1909
  3. package/dist/index.js +866 -349
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +2570 -2053
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +4 -3
  8. package/src/api/client.ts +0 -31
  9. package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
  10. package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
  11. package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
  12. package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
  13. package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -131
  14. package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
  15. package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -78
  16. package/src/api/conversion/documentation/index.ts +0 -7
  17. package/src/api/conversion/export/index.ts +0 -1
  18. package/src/api/conversion/export/pipeline.ts +0 -26
  19. package/src/api/conversion/index.ts +0 -3
  20. package/src/api/conversion/integrations/git.ts +0 -37
  21. package/src/api/conversion/integrations/index.ts +0 -2
  22. package/src/api/conversion/integrations/integration.ts +0 -37
  23. package/src/api/dto/aux/color.ts +0 -7
  24. package/src/api/dto/aux/index.ts +0 -3
  25. package/src/api/dto/aux/meta.ts +0 -8
  26. package/src/api/dto/aux/pagination.ts +0 -8
  27. package/src/api/dto/bff/app-bootstrap-data.ts +0 -20
  28. package/src/api/dto/bff/index.ts +0 -1
  29. package/src/api/dto/collections/index.ts +0 -1
  30. package/src/api/dto/collections/token-collection.ts +0 -24
  31. package/src/api/dto/design-systems/brand.ts +0 -44
  32. package/src/api/dto/design-systems/component.ts +0 -40
  33. package/src/api/dto/design-systems/contact.ts +0 -11
  34. package/src/api/dto/design-systems/data-source.ts +0 -141
  35. package/src/api/dto/design-systems/design-system.ts +0 -68
  36. package/src/api/dto/design-systems/elements-diff.ts +0 -14
  37. package/src/api/dto/design-systems/figma-variables.ts +0 -108
  38. package/src/api/dto/design-systems/import-job.ts +0 -61
  39. package/src/api/dto/design-systems/index.ts +0 -14
  40. package/src/api/dto/design-systems/members.ts +0 -50
  41. package/src/api/dto/design-systems/redirects.ts +0 -33
  42. package/src/api/dto/design-systems/role.ts +0 -11
  43. package/src/api/dto/design-systems/stats.ts +0 -19
  44. package/src/api/dto/design-systems/version.ts +0 -56
  45. package/src/api/dto/design-systems/view.ts +0 -45
  46. package/src/api/dto/design-tokens/design-token.ts +0 -78
  47. package/src/api/dto/design-tokens/index.ts +0 -1
  48. package/src/api/dto/documentation/anchor.ts +0 -15
  49. package/src/api/dto/documentation/approvals.ts +0 -15
  50. package/src/api/dto/documentation/block-definition.ts +0 -28
  51. package/src/api/dto/documentation/block.ts +0 -6
  52. package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
  53. package/src/api/dto/documentation/index.ts +0 -8
  54. package/src/api/dto/documentation/link-preview.ts +0 -23
  55. package/src/api/dto/documentation/publish.ts +0 -23
  56. package/src/api/dto/documentation/room.ts +0 -12
  57. package/src/api/dto/elements/components/figma-component-group.ts +0 -19
  58. package/src/api/dto/elements/components/figma-component.ts +0 -56
  59. package/src/api/dto/elements/components/index.ts +0 -2
  60. package/src/api/dto/elements/documentation/draft-state.ts +0 -37
  61. package/src/api/dto/elements/documentation/group-action.ts +0 -108
  62. package/src/api/dto/elements/documentation/group-v1.ts +0 -35
  63. package/src/api/dto/elements/documentation/group-v2.ts +0 -117
  64. package/src/api/dto/elements/documentation/hierarchy.ts +0 -22
  65. package/src/api/dto/elements/documentation/index.ts +0 -13
  66. package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
  67. package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
  68. package/src/api/dto/elements/documentation/metadata.ts +0 -8
  69. package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -121
  70. package/src/api/dto/elements/documentation/page-content.ts +0 -15
  71. package/src/api/dto/elements/documentation/page-v1.ts +0 -21
  72. package/src/api/dto/elements/documentation/page-v2.ts +0 -123
  73. package/src/api/dto/elements/documentation/structure.ts +0 -37
  74. package/src/api/dto/elements/elements-action-v2.ts +0 -111
  75. package/src/api/dto/elements/figma-nodes/figma-node-v1.ts +0 -32
  76. package/src/api/dto/elements/figma-nodes/figma-node-v2.ts +0 -32
  77. package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -103
  78. package/src/api/dto/elements/figma-nodes/index.ts +0 -4
  79. package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -44
  80. package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +0 -17
  81. package/src/api/dto/elements/frame-node-structures/index.ts +0 -1
  82. package/src/api/dto/elements/get-elements-v2.ts +0 -27
  83. package/src/api/dto/elements/index.ts +0 -7
  84. package/src/api/dto/elements/properties/index.ts +0 -2
  85. package/src/api/dto/elements/properties/property-definitions.ts +0 -75
  86. package/src/api/dto/elements/properties/property-values.ts +0 -38
  87. package/src/api/dto/export/exporter-property.ts +0 -105
  88. package/src/api/dto/export/exporter.ts +0 -87
  89. package/src/api/dto/export/filter.ts +0 -6
  90. package/src/api/dto/export/index.ts +0 -5
  91. package/src/api/dto/export/job.ts +0 -96
  92. package/src/api/dto/export/pipeline.ts +0 -43
  93. package/src/api/dto/figma-components/assets/download.ts +0 -30
  94. package/src/api/dto/figma-components/assets/index.ts +0 -1
  95. package/src/api/dto/figma-components/index.ts +0 -1
  96. package/src/api/dto/index.ts +0 -13
  97. package/src/api/dto/liveblocks/auth-response.ts +0 -7
  98. package/src/api/dto/liveblocks/index.ts +0 -1
  99. package/src/api/dto/themes/index.ts +0 -2
  100. package/src/api/dto/themes/override.ts +0 -27
  101. package/src/api/dto/themes/theme.ts +0 -45
  102. package/src/api/dto/users/authenticated-user.ts +0 -46
  103. package/src/api/dto/users/index.ts +0 -3
  104. package/src/api/dto/users/update.ts +0 -8
  105. package/src/api/dto/users/user.ts +0 -31
  106. package/src/api/dto/workspaces/git.ts +0 -32
  107. package/src/api/dto/workspaces/index.ts +0 -6
  108. package/src/api/dto/workspaces/integrations.ts +0 -34
  109. package/src/api/dto/workspaces/invitations.ts +0 -30
  110. package/src/api/dto/workspaces/membership.ts +0 -41
  111. package/src/api/dto/workspaces/npm-registry.ts +0 -35
  112. package/src/api/dto/workspaces/workspace.ts +0 -34
  113. package/src/api/endpoints/codegen/codegen.ts +0 -16
  114. package/src/api/endpoints/codegen/exporters.ts +0 -25
  115. package/src/api/endpoints/codegen/index.ts +0 -4
  116. package/src/api/endpoints/codegen/jobs.ts +0 -15
  117. package/src/api/endpoints/codegen/pipelines.ts +0 -44
  118. package/src/api/endpoints/design-system/bff.ts +0 -13
  119. package/src/api/endpoints/design-system/contact.ts +0 -12
  120. package/src/api/endpoints/design-system/design-systems.ts +0 -55
  121. package/src/api/endpoints/design-system/index.ts +0 -6
  122. package/src/api/endpoints/design-system/members.ts +0 -24
  123. package/src/api/endpoints/design-system/sources.ts +0 -35
  124. package/src/api/endpoints/design-system/versions/brands.ts +0 -45
  125. package/src/api/endpoints/design-system/versions/documentation.ts +0 -27
  126. package/src/api/endpoints/design-system/versions/ds-components.ts +0 -28
  127. package/src/api/endpoints/design-system/versions/elements-action.ts +0 -60
  128. package/src/api/endpoints/design-system/versions/elements.ts +0 -27
  129. package/src/api/endpoints/design-system/versions/figma-component-groups.ts +0 -13
  130. package/src/api/endpoints/design-system/versions/figma-components.ts +0 -13
  131. package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +0 -13
  132. package/src/api/endpoints/design-system/versions/import-jobs.ts +0 -13
  133. package/src/api/endpoints/design-system/versions/index.ts +0 -18
  134. package/src/api/endpoints/design-system/versions/overrides.ts +0 -17
  135. package/src/api/endpoints/design-system/versions/property-definitions.ts +0 -43
  136. package/src/api/endpoints/design-system/versions/property-values.ts +0 -25
  137. package/src/api/endpoints/design-system/versions/stats.ts +0 -12
  138. package/src/api/endpoints/design-system/versions/themes.ts +0 -35
  139. package/src/api/endpoints/design-system/versions/token-collections.ts +0 -13
  140. package/src/api/endpoints/design-system/versions/token-groups.ts +0 -28
  141. package/src/api/endpoints/design-system/versions/tokens.ts +0 -27
  142. package/src/api/endpoints/design-system/versions/versions.ts +0 -79
  143. package/src/api/endpoints/index.ts +0 -5
  144. package/src/api/endpoints/liveblocks.ts +0 -14
  145. package/src/api/endpoints/users.ts +0 -26
  146. package/src/api/endpoints/workspaces/index.ts +0 -3
  147. package/src/api/endpoints/workspaces/workspace-invites.ts +0 -34
  148. package/src/api/endpoints/workspaces/workspace-members.ts +0 -31
  149. package/src/api/endpoints/workspaces/workspaces.ts +0 -47
  150. package/src/api/index.ts +0 -6
  151. package/src/api/payloads/design-systems/index.ts +0 -2
  152. package/src/api/payloads/design-systems/update-design-system.ts +0 -29
  153. package/src/api/payloads/design-systems/version.ts +0 -29
  154. package/src/api/payloads/documentation/block-definitions.ts +0 -12
  155. package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
  156. package/src/api/payloads/documentation/index.ts +0 -2
  157. package/src/api/payloads/export/index.ts +0 -1
  158. package/src/api/payloads/export/pipeline.ts +0 -74
  159. package/src/api/payloads/index.ts +0 -6
  160. package/src/api/payloads/liveblocks/auth.ts +0 -7
  161. package/src/api/payloads/liveblocks/index.ts +0 -1
  162. package/src/api/payloads/users/index.ts +0 -2
  163. package/src/api/payloads/users/notifications/index.ts +0 -1
  164. package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
  165. package/src/api/payloads/users/profile/index.ts +0 -1
  166. package/src/api/payloads/users/profile/update.ts +0 -4
  167. package/src/api/payloads/workspaces/index.ts +0 -3
  168. package/src/api/payloads/workspaces/transfer-ownership.ts +0 -7
  169. package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
  170. package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
  171. package/src/api/transport/index.ts +0 -2
  172. package/src/api/transport/request-executor-error.ts +0 -66
  173. package/src/api/transport/request-executor.ts +0 -87
  174. package/src/events/design-system.ts +0 -21
  175. package/src/events/event.ts +0 -6
  176. package/src/events/index.ts +0 -2
  177. package/src/index.ts +0 -4
  178. package/src/utils/figma.ts +0 -72
  179. package/src/utils/hash.ts +0 -62
  180. package/src/utils/index.ts +0 -3
  181. package/src/utils/query.ts +0 -18
  182. package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -35
  183. package/src/yjs/design-system-content/index.ts +0 -2
  184. package/src/yjs/design-system-content/item-configuration.ts +0 -93
  185. package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -764
  186. package/src/yjs/docs-editor/index.ts +0 -7
  187. package/src/yjs/docs-editor/list-tree-builder.ts +0 -127
  188. package/src/yjs/docs-editor/mock.ts +0 -2142
  189. package/src/yjs/docs-editor/model/block.ts +0 -8
  190. package/src/yjs/docs-editor/model/index.ts +0 -2
  191. package/src/yjs/docs-editor/model/page.ts +0 -8
  192. package/src/yjs/docs-editor/prosemirror/index.ts +0 -3
  193. package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +0 -145
  194. package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +0 -577
  195. package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
  196. package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -975
  197. package/src/yjs/docs-editor/utils.ts +0 -115
  198. package/src/yjs/index.ts +0 -3
  199. package/src/yjs/version-room/backend.ts +0 -78
  200. package/src/yjs/version-room/base.ts +0 -226
  201. package/src/yjs/version-room/frontend.ts +0 -463
  202. package/src/yjs/version-room/index.ts +0 -4
  203. package/src/yjs/version-room/utils.ts +0 -109
@@ -1,111 +0,0 @@
1
- import { z } from "zod";
2
- import {
3
- DTODocumentationGroupCreateActionInputV2,
4
- DTODocumentationGroupCreateActionOutputV2,
5
- DTODocumentationGroupDeleteActionInputV2,
6
- DTODocumentationGroupDeleteActionOutputV2,
7
- DTODocumentationGroupDuplicateActionInputV2,
8
- DTODocumentationGroupDuplicateActionOutputV2,
9
- DTODocumentationGroupMoveActionInputV2,
10
- DTODocumentationGroupMoveActionOutputV2,
11
- DTODocumentationGroupUpdateActionInputV2,
12
- DTODocumentationGroupUpdateActionOutputV2,
13
- DTODocumentationTabCreateActionInputV2,
14
- DTODocumentationTabCreateActionOutputV2,
15
- DTODocumentationTabGroupDeleteActionInputV2,
16
- DTODocumentationTabGroupDeleteActionOutputV2,
17
- } from "./documentation/group-action";
18
- import {
19
- DTODocumentationGroupRestoreActionInput,
20
- DTODocumentationGroupRestoreActionOutput,
21
- DTODocumentationPageApprovalStateChangeActionInput,
22
- DTODocumentationPageApprovalStateChangeActionOutput,
23
- DTODocumentationPageCreateActionInputV2,
24
- DTODocumentationPageCreateActionOutputV2,
25
- DTODocumentationPageDeleteActionInputV2,
26
- DTODocumentationPageDeleteActionOutputV2,
27
- DTODocumentationPageDuplicateActionInputV2,
28
- DTODocumentationPageDuplicateActionOutputV2,
29
- DTODocumentationPageMoveActionInputV2,
30
- DTODocumentationPageMoveActionOutputV2,
31
- DTODocumentationPageRestoreActionInput,
32
- DTODocumentationPageRestoreActionOutput,
33
- DTODocumentationPageUpdateActionInputV2,
34
- DTODocumentationPageUpdateActionOutputV2,
35
- } from "./documentation/page-actions-v2";
36
- import {
37
- DTOFigmaNodeRenderActionInput,
38
- DTOFigmaNodeRenderActionOutput,
39
- DTOFigmaNodeRenderAsyncActionInput,
40
- DTOFigmaNodeRenderAsyncActionOutput,
41
- } from "./figma-nodes/node-actions-v2";
42
-
43
- //
44
- // Read
45
- //
46
-
47
- export const DTOElementActionOutput = z.discriminatedUnion("type", [
48
- // Documentation pages
49
- DTODocumentationPageCreateActionOutputV2,
50
- DTODocumentationPageUpdateActionOutputV2,
51
- DTODocumentationPageMoveActionOutputV2,
52
- DTODocumentationPageDuplicateActionOutputV2,
53
- DTODocumentationPageDeleteActionOutputV2,
54
-
55
- // Documentation groups
56
- DTODocumentationGroupCreateActionOutputV2,
57
- DTODocumentationTabCreateActionOutputV2,
58
- DTODocumentationGroupUpdateActionOutputV2,
59
- DTODocumentationGroupMoveActionOutputV2,
60
- DTODocumentationGroupDuplicateActionOutputV2,
61
- DTODocumentationGroupDeleteActionOutputV2,
62
- DTODocumentationTabGroupDeleteActionOutputV2,
63
-
64
- // Figma frames
65
- DTOFigmaNodeRenderActionOutput,
66
- DTOFigmaNodeRenderAsyncActionOutput,
67
-
68
- // Restore
69
- DTODocumentationPageRestoreActionOutput,
70
- DTODocumentationGroupRestoreActionOutput,
71
-
72
- // Approvals
73
- DTODocumentationPageApprovalStateChangeActionOutput,
74
- ]);
75
-
76
- export type DTOElementActionOutput = z.infer<typeof DTOElementActionOutput>;
77
-
78
- //
79
- // Write
80
- //
81
-
82
- export const DTOElementActionInput = z.discriminatedUnion("type", [
83
- // Documentation pages
84
- DTODocumentationPageCreateActionInputV2,
85
- DTODocumentationPageUpdateActionInputV2,
86
- DTODocumentationPageMoveActionInputV2,
87
- DTODocumentationPageDuplicateActionInputV2,
88
- DTODocumentationPageDeleteActionInputV2,
89
-
90
- // Documentation groups
91
- DTODocumentationGroupCreateActionInputV2,
92
- DTODocumentationTabCreateActionInputV2,
93
- DTODocumentationGroupUpdateActionInputV2,
94
- DTODocumentationGroupMoveActionInputV2,
95
- DTODocumentationGroupDuplicateActionInputV2,
96
- DTODocumentationGroupDeleteActionInputV2,
97
- DTODocumentationTabGroupDeleteActionInputV2,
98
-
99
- // Figma frames
100
- DTOFigmaNodeRenderActionInput,
101
- DTOFigmaNodeRenderAsyncActionInput,
102
-
103
- // Restore
104
- DTODocumentationPageRestoreActionInput,
105
- DTODocumentationGroupRestoreActionInput,
106
-
107
- // Approval
108
- DTODocumentationPageApprovalStateChangeActionInput,
109
- ]);
110
-
111
- export type DTOElementActionInput = z.infer<typeof DTOElementActionInput>;
@@ -1,32 +0,0 @@
1
- import { FigmaNodeReference } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOFigmaNodeOrigin, DTOFigmaNodeRenderFormat } from "./figma-node";
4
-
5
- export const DTOFigmaNodeData = z.object({
6
- // Id of the node in the Figma file
7
- figmaNodeId: z.string(),
8
-
9
- // Validity
10
- isValid: z.boolean(),
11
-
12
- // Asset data
13
- assetId: z.string(),
14
- assetUrl: z.string(),
15
- assetFormat: DTOFigmaNodeRenderFormat,
16
-
17
- // Asset metadata
18
- assetScale: z.number(),
19
- assetWidth: z.number().optional(),
20
- assetHeight: z.number().optional(),
21
- });
22
-
23
- export const DTOFigmaNode = FigmaNodeReference.omit({
24
- data: true,
25
- origin: true,
26
- }).extend({
27
- data: DTOFigmaNodeData,
28
- origin: DTOFigmaNodeOrigin,
29
- });
30
-
31
- export type DTOFigmaNodeData = z.infer<typeof DTOFigmaNodeData>;
32
- export type DTOFigmaNode = z.infer<typeof DTOFigmaNode>;
@@ -1,32 +0,0 @@
1
- import {
2
- FigmaNodeReference,
3
- FigmaNodeRenderedImage,
4
- FigmaNodeRenderError,
5
- FigmaNodeRenderFormat,
6
- FigmaNodeRenderState,
7
- } from "@supernova-studio/model";
8
- import { z } from "zod";
9
- import { DTOFigmaNodeOrigin } from "./figma-node";
10
-
11
- export const DTOFigmaNodeDataV2 = z.object({
12
- sceneNodeId: z.string(),
13
- format: FigmaNodeRenderFormat,
14
- scale: z.number().optional(),
15
-
16
- renderState: FigmaNodeRenderState,
17
- renderedImage: FigmaNodeRenderedImage.optional(),
18
- renderError: FigmaNodeRenderError.optional(),
19
-
20
- hasSource: z.boolean(),
21
- });
22
-
23
- export const DTOFigmaNodeV2 = FigmaNodeReference.omit({
24
- data: true,
25
- origin: true,
26
- }).extend({
27
- data: DTOFigmaNodeDataV2,
28
- origin: DTOFigmaNodeOrigin,
29
- });
30
-
31
- export type DTOFigmaNodeDataV2 = z.infer<typeof DTOFigmaNodeDataV2>;
32
- export type DTOFigmaNodeV2 = z.infer<typeof DTOFigmaNodeV2>;
@@ -1,103 +0,0 @@
1
- import { FigmaNodeRenderFormat } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Enums
6
- //
7
-
8
- export const DTOFigmaNodeRenderFormat = FigmaNodeRenderFormat;
9
- export type DTOFigmaNodeRenderFormat = z.infer<typeof DTOFigmaNodeRenderFormat>;
10
-
11
- //
12
- // Read
13
- //
14
-
15
- export const DTOFigmaNodeOrigin = z.object({
16
- sourceId: z.string(),
17
- fileId: z.string().optional(),
18
- parentName: z.string().optional(),
19
- });
20
-
21
- export type DTOFigmaNodeOrigin = z.infer<typeof DTOFigmaNodeOrigin>;
22
-
23
- //
24
- // Write
25
- //
26
-
27
- /**
28
- * Properties that are available on all types of Figma node render requests
29
- */
30
- const DTOFigmaNodeRenderInputBase = z.object({
31
- /**
32
- * Format in which the node must be rendered, png by default.
33
- */
34
- format: FigmaNodeRenderFormat.default("Png"),
35
-
36
- /**
37
- * Scale to apply to PNG images, can be between 1 and 4. Scale is ignored for other image formats.
38
- */
39
- scale: z.number().optional(),
40
- });
41
-
42
- /**
43
- * Figma node render request that uses source ID + node ID to identify the requested
44
- * node to render. The node ID can be obtained from the source's Figma node structure.
45
- */
46
- export const DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({
47
- inputType: z
48
- .literal("NodeId")
49
- .optional()
50
- .transform(v => v ?? "NodeId"),
51
-
52
- /**
53
- * Id of a design system's data source representing a linked Figma file
54
- */
55
- sourceId: z.string(),
56
-
57
- /**
58
- * Id of a node within the Figma file
59
- */
60
- figmaFileNodeId: z.string(),
61
- });
62
-
63
- /**
64
- * Figma node render request that uses Figma URL to identify the requested
65
- * node to render. The URL can be obtained by the user directly from the Figma app.
66
- */
67
- export const DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({
68
- inputType: z.literal("URL"),
69
-
70
- /**
71
- * Id of a design system's data source representing a linked Figma file
72
- */
73
- figmaNodeUrl: z.string(),
74
-
75
- /**
76
- * Brand persistent id to use in case a source has to be created for this render
77
- */
78
- brandPersistentId: z.string(),
79
- });
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
-
94
- export const DTOFigmaNodeRenderInput = z.discriminatedUnion("inputType", [
95
- DTOFigmaNodeRenderIdInput,
96
- DTOFigmaNodeRenderUrlInput,
97
- DTOFigmaNodeRerenderInput,
98
- ]);
99
-
100
- export type DTOFigmaNodeRenderIdInput = z.infer<typeof DTOFigmaNodeRenderIdInput>;
101
- export type DTOFigmaNodeRenderUrlInput = z.infer<typeof DTOFigmaNodeRenderUrlInput>;
102
- export type DTOFigmaNodeRerenderInput = z.infer<typeof DTOFigmaNodeRerenderInput>;
103
- export type DTOFigmaNodeRenderInput = z.infer<typeof DTOFigmaNodeRenderInput>;
@@ -1,4 +0,0 @@
1
- export * from "./figma-node-v1";
2
- export * from "./figma-node-v2";
3
- export * from "./figma-node";
4
- export * from "./node-actions-v2";
@@ -1,44 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOFigmaNodeRenderIdInput, DTOFigmaNodeRenderInput } from "./figma-node";
3
- import { DTOFigmaNode } from "./figma-node-v1";
4
- import { DTOFigmaNodeV2 } from "./figma-node-v2";
5
-
6
- //
7
- // Read
8
- //
9
-
10
- /**
11
- * @deprecated Please use FigmaNodeRenderAsync (DTOFigmaNodeRenderAsyncActionOutput)
12
- */
13
- export const DTOFigmaNodeRenderActionOutput = z.object({
14
- type: z.literal("FigmaNodeRender"),
15
- figmaNodes: z.array(DTOFigmaNode),
16
- });
17
-
18
- export const DTOFigmaNodeRenderAsyncActionOutput = z.object({
19
- type: z.literal("FigmaNodeRenderAsync"),
20
- figmaNodes: z.array(DTOFigmaNodeV2),
21
- });
22
-
23
- export type DTOFigmaNodeRenderActionOutput = z.infer<typeof DTOFigmaNodeRenderActionOutput>;
24
- export type DTOFigmaNodeRenderAsyncActionOutput = z.infer<typeof DTOFigmaNodeRenderAsyncActionOutput>;
25
-
26
- //
27
- // Read
28
- //
29
-
30
- /**
31
- * @deprecated Please use FigmaNodeRenderAsync (DTOFigmaNodeRenderAsyncActionInput)
32
- */
33
- export const DTOFigmaNodeRenderActionInput = z.object({
34
- type: z.literal("FigmaNodeRender"),
35
- input: DTOFigmaNodeRenderIdInput.array(),
36
- });
37
-
38
- export const DTOFigmaNodeRenderAsyncActionInput = z.object({
39
- type: z.literal("FigmaNodeRenderAsync"),
40
- nodes: DTOFigmaNodeRenderInput.array(),
41
- });
42
-
43
- export type DTOFigmaNodeRenderActionInput = z.infer<typeof DTOFigmaNodeRenderActionInput>;
44
- export type DTOFigmaNodeRenderAsyncActionInput = z.infer<typeof DTOFigmaNodeRenderAsyncActionInput>;
@@ -1,17 +0,0 @@
1
- import { FigmaFileStructureOrigin, FigmaFileStructureStatistics } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTOFrameNodeStructure = z.object({
5
- id: z.string(),
6
- persistentId: z.string(),
7
- designSystemVersionId: z.string(),
8
- origin: FigmaFileStructureOrigin,
9
- assetsInFile: FigmaFileStructureStatistics,
10
- });
11
-
12
- export const DTOFrameNodeStructureListResponse = z.object({
13
- structures: DTOFrameNodeStructure.array(),
14
- });
15
-
16
- export type DTOFrameNodeStructure = z.infer<typeof DTOFrameNodeStructure>;
17
- export type DTOFrameNodeStructureListResponse = z.infer<typeof DTOFrameNodeStructureListResponse>;
@@ -1 +0,0 @@
1
- export * from "./frame-node-structure";
@@ -1,27 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOFigmaNode, DTOFigmaNodeV2 } from "./figma-nodes";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTOElementsGetTypeFilter = z.enum(["FigmaNode"]);
9
-
10
- export const DTOElementsGetQuerySchema = z.object({
11
- types: z.string().transform(val => val.split(",").map(v => DTOElementsGetTypeFilter.parse(v))),
12
- responseVersion: z.coerce.number().default(1),
13
- });
14
-
15
- export const DTOElementsGetOutput = z.object({
16
- figmaNodes: z.array(DTOFigmaNode).optional(),
17
- });
18
-
19
- export const DTOElementsGetOutputV2 = z.object({
20
- figmaNodes: z.array(DTOFigmaNodeV2).optional(),
21
- });
22
-
23
- export type DTOElementsGetOutput = z.infer<typeof DTOElementsGetOutput>;
24
- export type DTOElementsGetOutputV2 = z.infer<typeof DTOElementsGetOutputV2>;
25
- export type DTOElementsGetQueryRaw = z.input<typeof DTOElementsGetQuerySchema>;
26
- export type DTOElementsGetQueryParsed = z.output<typeof DTOElementsGetQuerySchema>;
27
- export type DTOElementsGetTypeFilter = z.infer<typeof DTOElementsGetTypeFilter>;
@@ -1,7 +0,0 @@
1
- export * from "./components";
2
- export * from "./documentation";
3
- export * from "./figma-nodes";
4
- export * from "./frame-node-structures";
5
- export * from "./properties";
6
- export * from "./elements-action-v2";
7
- export * from "./get-elements-v2";
@@ -1,2 +0,0 @@
1
- export * from "./property-definitions";
2
- export * from "./property-values";
@@ -1,75 +0,0 @@
1
- import {
2
- ElementPropertyImmutableType,
3
- ElementPropertyLinkType,
4
- ElementPropertyTargetType,
5
- ElementPropertyTypeSchema,
6
- nullishToOptional,
7
- } from "@supernova-studio/model";
8
- import { z } from "zod";
9
- import { DTOColorTokenInlineData } from "../../aux";
10
- import { DTOObjectMeta } from "../../aux/meta";
11
-
12
- const CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
13
-
14
- export const DTOElementPropertyDefinitionOption = z.object({
15
- id: z.string(),
16
- name: z.string(),
17
- backgroundColor: DTOColorTokenInlineData.optional(),
18
- });
19
-
20
- // DTO Object
21
- export const DTOElementPropertyDefinition = z.object({
22
- id: z.string(),
23
- designSystemVersionId: z.string(),
24
- meta: DTOObjectMeta,
25
- persistentId: z.string(),
26
- type: ElementPropertyTypeSchema,
27
- targetElementType: ElementPropertyTargetType,
28
- codeName: z.string().regex(CODE_NAME_REGEX),
29
- options: nullishToOptional(z.array(DTOElementPropertyDefinitionOption)),
30
- linkElementType: nullishToOptional(ElementPropertyLinkType),
31
- isImmutable: z.boolean(),
32
- immutablePropertyType: ElementPropertyImmutableType.optional(),
33
- });
34
-
35
- export type DTOElementPropertyDefinitionOption = z.infer<typeof DTOElementPropertyDefinitionOption>;
36
- export type DTOElementPropertyDefinition = z.infer<typeof DTOElementPropertyDefinition>;
37
-
38
- //
39
- // Read
40
- //
41
-
42
- export const DTOElementPropertyDefinitionListResponse = z.object({
43
- definitions: z.array(DTOElementPropertyDefinition),
44
- });
45
-
46
- export const DTOElementPropertyDefinitionResponse = z.object({
47
- definition: DTOElementPropertyDefinition,
48
- });
49
-
50
- export type DTOElementPropertyDefinitionListResponse = z.infer<typeof DTOElementPropertyDefinitionListResponse>;
51
- export type DTOElementPropertyDefinitionResponse = z.infer<typeof DTOElementPropertyDefinitionResponse>;
52
-
53
- //
54
- // Write
55
- //
56
-
57
- export const DTOElementPropertyDefinitionCreatePayload = z.object({
58
- meta: DTOObjectMeta,
59
- persistentId: z.string(),
60
- type: ElementPropertyTypeSchema,
61
- targetElementType: ElementPropertyTargetType,
62
- codeName: z.string().regex(CODE_NAME_REGEX),
63
- options: nullishToOptional(z.array(DTOElementPropertyDefinitionOption)),
64
- linkElementType: nullishToOptional(ElementPropertyLinkType),
65
- columnWidth: z.number().max(1024).optional(),
66
- });
67
-
68
- export const DTOElementPropertyDefinitionUpdatePayload = z.object({
69
- meta: DTOObjectMeta.optional(),
70
- codeName: z.string().regex(CODE_NAME_REGEX).optional(),
71
- options: z.array(DTOElementPropertyDefinitionOption).optional(),
72
- });
73
-
74
- export type DTOElementPropertyDefinitionCreatePayload = z.infer<typeof DTOElementPropertyDefinitionCreatePayload>;
75
- export type DTOElementPropertyDefinitionUpdatePayload = z.infer<typeof DTOElementPropertyDefinitionUpdatePayload>;
@@ -1,38 +0,0 @@
1
- import { z } from "zod";
2
-
3
- //
4
- // Read
5
- //
6
-
7
- export const DTOElementPropertyValue = z.object({
8
- id: z.string(),
9
- designSystemVersionId: z.string(),
10
- definitionId: z.string(),
11
- targetElementId: z.string(),
12
- value: z.union([z.string(), z.number(), z.boolean()]).optional(),
13
- valuePreview: z.string().optional(),
14
- });
15
-
16
- export const DTOElementPropertyValueListResponse = z.object({
17
- values: z.array(DTOElementPropertyValue),
18
- });
19
-
20
- export const DTOElementPropertyValueResponse = z.object({
21
- value: DTOElementPropertyValue,
22
- });
23
-
24
- export type DTOElementPropertyValue = z.infer<typeof DTOElementPropertyValue>;
25
- export type DTOElementPropertyValueListResponse = z.infer<typeof DTOElementPropertyValueListResponse>;
26
- export type DTOElementPropertyValueResponse = z.infer<typeof DTOElementPropertyValueResponse>;
27
-
28
- //
29
- // Create
30
- //
31
-
32
- export const DTOElementPropertyValueUpsertPaylod = z.object({
33
- definitionId: z.string(),
34
- targetElementId: z.string(),
35
- value: z.string().or(z.number()).or(z.boolean()),
36
- });
37
-
38
- export type DTOElementPropertyValueUpsertPaylod = z.infer<typeof DTOElementPropertyValueUpsertPaylod>;
@@ -1,105 +0,0 @@
1
- import { z } from "zod";
2
-
3
- //
4
- // Primitives
5
- //
6
-
7
- const PrimitiveValue = z.number().or(z.boolean()).or(z.string());
8
- const ArrayValue = z.array(z.string());
9
- const ObjectValue = z.record(z.string());
10
-
11
- export const DTOExporterPropertyDefinitionValue = PrimitiveValue.or(ArrayValue).or(ObjectValue);
12
- export const DTOExporterPropertyType = z.enum(["Enum", "Boolean", "String", "Number", "Array", "Object"]);
13
-
14
- export type DTOExporterPropertyDefinitionValue = z.infer<typeof DTOExporterPropertyDefinitionValue>;
15
- export type DTOExporterPropertyType = z.infer<typeof DTOExporterPropertyType>;
16
-
17
- //
18
- // Property
19
- //
20
-
21
- const PropertyDefinitionBase = z.object({
22
- key: z.string(),
23
- title: z.string(),
24
- description: z.string(),
25
- category: z.string().optional(),
26
- dependsOn: z.record(z.boolean()).optional(),
27
- });
28
-
29
- export type DTOPropertyDefinitionBase = z.infer<typeof PropertyDefinitionBase>;
30
- export const DTOExporterPropertyDefinitionEnumOption = z.object({
31
- label: z.string(),
32
- description: z.string(),
33
- });
34
-
35
- export const DTOExporterPropertyDefinitionEnum = PropertyDefinitionBase.extend({
36
- type: z.literal(DTOExporterPropertyType.Enum.Enum),
37
- options: z.record(DTOExporterPropertyDefinitionEnumOption),
38
- default: z.string(),
39
- });
40
-
41
- export const DTOExporterPropertyDefinitionBoolean = PropertyDefinitionBase.extend({
42
- type: z.literal(DTOExporterPropertyType.Enum.Boolean),
43
- default: z.boolean(),
44
- });
45
-
46
- export const DTOExporterPropertyDefinitionString = PropertyDefinitionBase.extend({
47
- type: z.literal(DTOExporterPropertyType.Enum.String),
48
- default: z.string(),
49
- });
50
-
51
- export const DTOExporterPropertyDefinitionNumber = PropertyDefinitionBase.extend({
52
- type: z.literal(DTOExporterPropertyType.Enum.Number),
53
- default: z.number(),
54
- });
55
-
56
- export const DTOExporterPropertyDefinitionArray = PropertyDefinitionBase.extend({
57
- type: z.literal(DTOExporterPropertyType.Enum.Array),
58
- default: ArrayValue,
59
- });
60
-
61
- export const DTOExporterPropertyDefinitionObject = PropertyDefinitionBase.extend({
62
- type: z.literal(DTOExporterPropertyType.Enum.Object),
63
- default: ObjectValue,
64
- allowedKeys: z
65
- .object({
66
- options: z.string().array(),
67
- type: z.string(),
68
- })
69
- .optional(),
70
- allowedValues: z
71
- .object({
72
- type: z.string(),
73
- })
74
- .optional(),
75
- });
76
-
77
- export const DTOExporterPropertyDefinition = z.discriminatedUnion("type", [
78
- DTOExporterPropertyDefinitionEnum,
79
- DTOExporterPropertyDefinitionBoolean,
80
- DTOExporterPropertyDefinitionString,
81
- DTOExporterPropertyDefinitionNumber,
82
- DTOExporterPropertyDefinitionArray,
83
- DTOExporterPropertyDefinitionObject,
84
- ]);
85
-
86
- export const DTOExporterPropertyDefinitionsResponse = z.object({
87
- properties: DTOExporterPropertyDefinition.array(),
88
- });
89
-
90
- export type DTOExporterPropertyDefinitionEnum = z.infer<typeof DTOExporterPropertyDefinitionEnum>;
91
- export type DTOExporterPropertyDefinitionBoolean = z.infer<typeof DTOExporterPropertyDefinitionBoolean>;
92
- export type DTOExporterPropertyDefinitionString = z.infer<typeof DTOExporterPropertyDefinitionString>;
93
- export type DTOExporterPropertyDefinitionNumber = z.infer<typeof DTOExporterPropertyDefinitionNumber>;
94
- export type DTOExporterPropertyDefinitionArray = z.infer<typeof DTOExporterPropertyDefinitionArray>;
95
- export type DTOExporterPropertyDefinitionObject = z.infer<typeof DTOExporterPropertyDefinitionObject>;
96
- export type DTOExporterPropertyDefinition = z.infer<typeof DTOExporterPropertyDefinition>;
97
- export type DTOExporterPropertyDefinitionEnumOption = z.infer<typeof DTOExporterPropertyDefinitionEnumOption>;
98
- export type DTOExporterPropertyDefinitionsResponse = z.infer<typeof DTOExporterPropertyDefinitionsResponse>;
99
-
100
- //
101
- // Value
102
- //
103
-
104
- export const DTOExporterPropertyDefinitionValueMap = z.record(DTOExporterPropertyDefinitionValue);
105
- export type DTOExporterPropertyDefinitionValueMap = z.infer<typeof DTOExporterPropertyDefinitionValueMap>;