@supernova-studio/client 0.48.7 → 1.0.1

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 (121) hide show
  1. package/dist/index.d.mts +1166 -44514
  2. package/dist/index.mjs +4583 -9906
  3. package/dist/index.mjs.map +1 -1
  4. package/package.json +11 -30
  5. package/dist/index.d.ts +0 -44757
  6. package/dist/index.js +0 -11011
  7. package/dist/index.js.map +0 -1
  8. package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
  9. package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
  10. package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
  11. package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
  12. package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -132
  13. package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
  14. package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -72
  15. package/src/api/conversion/documentation/index.ts +0 -7
  16. package/src/api/conversion/export/index.ts +0 -1
  17. package/src/api/conversion/export/pipeline.ts +0 -24
  18. package/src/api/conversion/index.ts +0 -3
  19. package/src/api/conversion/integrations/git.ts +0 -37
  20. package/src/api/conversion/integrations/index.ts +0 -2
  21. package/src/api/conversion/integrations/integration.ts +0 -37
  22. package/src/api/dto/design-systems/brand.ts +0 -22
  23. package/src/api/dto/design-systems/data-source.ts +0 -122
  24. package/src/api/dto/design-systems/design-system.ts +0 -18
  25. package/src/api/dto/design-systems/elements-diff.ts +0 -14
  26. package/src/api/dto/design-systems/exporter-property.ts +0 -8
  27. package/src/api/dto/design-systems/index.ts +0 -7
  28. package/src/api/dto/design-systems/version.ts +0 -57
  29. package/src/api/dto/design-systems/view.ts +0 -45
  30. package/src/api/dto/documentation/anchor.ts +0 -15
  31. package/src/api/dto/documentation/block-definition.ts +0 -28
  32. package/src/api/dto/documentation/block.ts +0 -6
  33. package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
  34. package/src/api/dto/documentation/index.ts +0 -6
  35. package/src/api/dto/documentation/link-preview.ts +0 -23
  36. package/src/api/dto/documentation/publish.ts +0 -23
  37. package/src/api/dto/elements/documentation/draft-state.ts +0 -35
  38. package/src/api/dto/elements/documentation/group-action.ts +0 -108
  39. package/src/api/dto/elements/documentation/group-v1.ts +0 -35
  40. package/src/api/dto/elements/documentation/group-v2.ts +0 -109
  41. package/src/api/dto/elements/documentation/hierarchy.ts +0 -36
  42. package/src/api/dto/elements/documentation/index.ts +0 -11
  43. package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
  44. package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
  45. package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -108
  46. package/src/api/dto/elements/documentation/page-content.ts +0 -15
  47. package/src/api/dto/elements/documentation/page-v1.ts +0 -21
  48. package/src/api/dto/elements/documentation/page-v2.ts +0 -105
  49. package/src/api/dto/elements/elements-action-v2.ts +0 -114
  50. package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -55
  51. package/src/api/dto/elements/figma-nodes/index.ts +0 -2
  52. package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -24
  53. package/src/api/dto/elements/get-elements-v2.ts +0 -21
  54. package/src/api/dto/elements/index.ts +0 -5
  55. package/src/api/dto/elements/properties/index.ts +0 -3
  56. package/src/api/dto/elements/properties/property-definitions-actions-v2.ts +0 -53
  57. package/src/api/dto/elements/properties/property-definitions.ts +0 -62
  58. package/src/api/dto/elements/properties/property-values.ts +0 -17
  59. package/src/api/dto/export/exporter.ts +0 -73
  60. package/src/api/dto/export/index.ts +0 -3
  61. package/src/api/dto/export/job.ts +0 -75
  62. package/src/api/dto/export/pipeline.ts +0 -20
  63. package/src/api/dto/figma-components/assets/download.ts +0 -30
  64. package/src/api/dto/figma-components/assets/index.ts +0 -1
  65. package/src/api/dto/figma-components/index.ts +0 -1
  66. package/src/api/dto/index.ts +0 -8
  67. package/src/api/dto/liveblocks/auth-response.ts +0 -7
  68. package/src/api/dto/liveblocks/index.ts +0 -1
  69. package/src/api/dto/users/index.ts +0 -1
  70. package/src/api/dto/users/profile/index.ts +0 -1
  71. package/src/api/dto/users/profile/update.ts +0 -7
  72. package/src/api/dto/workspaces/git.ts +0 -32
  73. package/src/api/dto/workspaces/index.ts +0 -5
  74. package/src/api/dto/workspaces/integrations.ts +0 -34
  75. package/src/api/dto/workspaces/membership.ts +0 -29
  76. package/src/api/dto/workspaces/npm-registry.ts +0 -35
  77. package/src/api/dto/workspaces/workspace.ts +0 -16
  78. package/src/api/index.ts +0 -3
  79. package/src/api/payloads/design-systems/brand.ts +0 -11
  80. package/src/api/payloads/design-systems/index.ts +0 -2
  81. package/src/api/payloads/design-systems/version.ts +0 -29
  82. package/src/api/payloads/documentation/block-definitions.ts +0 -12
  83. package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
  84. package/src/api/payloads/documentation/index.ts +0 -2
  85. package/src/api/payloads/export/index.ts +0 -1
  86. package/src/api/payloads/export/pipeline.ts +0 -46
  87. package/src/api/payloads/index.ts +0 -6
  88. package/src/api/payloads/liveblocks/auth.ts +0 -7
  89. package/src/api/payloads/liveblocks/index.ts +0 -1
  90. package/src/api/payloads/users/index.ts +0 -2
  91. package/src/api/payloads/users/notifications/index.ts +0 -1
  92. package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
  93. package/src/api/payloads/users/profile/index.ts +0 -1
  94. package/src/api/payloads/users/profile/update.ts +0 -4
  95. package/src/api/payloads/workspaces/index.ts +0 -2
  96. package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
  97. package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
  98. package/src/index.ts +0 -3
  99. package/src/utils/hash.ts +0 -62
  100. package/src/utils/index.ts +0 -1
  101. package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -33
  102. package/src/yjs/design-system-content/index.ts +0 -2
  103. package/src/yjs/design-system-content/item-configuration.ts +0 -93
  104. package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -697
  105. package/src/yjs/docs-editor/index.ts +0 -7
  106. package/src/yjs/docs-editor/list-tree-builder.ts +0 -135
  107. package/src/yjs/docs-editor/mock.ts +0 -2447
  108. package/src/yjs/docs-editor/model/block.ts +0 -8
  109. package/src/yjs/docs-editor/model/index.ts +0 -2
  110. package/src/yjs/docs-editor/model/page.ts +0 -8
  111. package/src/yjs/docs-editor/prosemirror/index.ts +0 -2
  112. package/src/yjs/docs-editor/prosemirror/schema.ts +0 -657
  113. package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
  114. package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -900
  115. package/src/yjs/docs-editor/utils.ts +0 -115
  116. package/src/yjs/index.ts +0 -3
  117. package/src/yjs/version-room/backend.ts +0 -60
  118. package/src/yjs/version-room/base.ts +0 -185
  119. package/src/yjs/version-room/frontend.ts +0 -298
  120. package/src/yjs/version-room/index.ts +0 -4
  121. package/src/yjs/version-room/utils.ts +0 -6
@@ -1,109 +0,0 @@
1
- import { DocumentationGroupBehavior, ElementGroup } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTODocumentationDraftState } from "./draft-state";
4
- import { DTODocumentationItemConfigurationV2 } from "./item-configuration-v2";
5
-
6
- //
7
- // Read
8
- //
9
-
10
- export const DTODocumentationGroupV2 = ElementGroup.omit({
11
- sortOrder: true,
12
- parentPersistentId: true,
13
- brandPersistentId: true,
14
- meta: true,
15
- childType: true,
16
- data: true,
17
- shortPersistentId: true,
18
- }).extend({
19
- title: z.string(),
20
- isRoot: z.boolean(),
21
- childrenIds: z.array(z.string()),
22
- groupBehavior: DocumentationGroupBehavior,
23
- shortPersistentId: z.string(),
24
- configuration: DTODocumentationItemConfigurationV2,
25
- type: z.literal("Group"),
26
-
27
- /** Defined when a group has changed since last publish and can be included into a partial publish */
28
- draftState: DTODocumentationDraftState.optional(),
29
- });
30
-
31
- export type DTODocumentationGroupV2 = z.infer<typeof DTODocumentationGroupV2>;
32
-
33
- //
34
- // Write
35
- //
36
-
37
- export const DTOCreateDocumentationGroupInput = z.object({
38
- // Identifier
39
- persistentId: z.string().uuid(),
40
-
41
- // Group properties
42
- title: z.string(),
43
- configuration: DTODocumentationItemConfigurationV2.partial().optional(),
44
-
45
- // Group placement properties
46
- afterPersistentId: z.string().uuid().nullish(),
47
- parentPersistentId: z.string().uuid(),
48
- });
49
-
50
- export const DTOUpdateDocumentationGroupInput = z.object({
51
- // Identifier of the group to update
52
- id: z.string(),
53
-
54
- // Group properties
55
- title: z.string().optional(),
56
- configuration: DTODocumentationItemConfigurationV2.partial().optional(),
57
- });
58
-
59
- export const DTOMoveDocumentationGroupInput = z.object({
60
- // Identifier of the group to update
61
- id: z.string(),
62
-
63
- // Group placement properties
64
- parentPersistentId: z.string().uuid(),
65
- afterPersistentId: z.string().uuid().nullish(),
66
- });
67
-
68
- export const DTODuplicateDocumentationGroupInput = z.object({
69
- // Identifier of the group to duplicate from
70
- id: z.string(),
71
-
72
- // New group persistent id
73
- persistentId: z.string().uuid(),
74
-
75
- // Group placement properties
76
- afterPersistentId: z.string().uuid().nullish(),
77
- parentPersistentId: z.string().uuid(),
78
- });
79
-
80
- export const DTOCreateDocumentationTabInput = z.object({
81
- // New group persistent id
82
- persistentId: z.string().uuid(),
83
-
84
- // If this is page, we will attempt to convert it to tab
85
- // If this is tab group, we will add a new tab to it
86
- fromItemPersistentId: z.string(),
87
- tabName: z.string(),
88
- });
89
-
90
- export const DTODeleteDocumentationTabGroupInput = z.object({
91
- // Deleted group id
92
- id: z.string(),
93
- });
94
-
95
- export const DTODeleteDocumentationGroupInput = z.object({
96
- // Identifier
97
- id: z.string(),
98
-
99
- // Deletion options
100
- deleteSubtree: z.boolean().default(false),
101
- });
102
-
103
- export type DTOCreateDocumentationGroupInput = z.infer<typeof DTOCreateDocumentationGroupInput>;
104
- export type DTOUpdateDocumentationGroupInput = z.infer<typeof DTOUpdateDocumentationGroupInput>;
105
- export type DTOMoveDocumentationGroupInput = z.infer<typeof DTOMoveDocumentationGroupInput>;
106
- export type DTODuplicateDocumentationGroupInput = z.infer<typeof DTODuplicateDocumentationGroupInput>;
107
- export type DTOCreateDocumentationTabInput = z.infer<typeof DTOCreateDocumentationTabInput>;
108
- export type DTODeleteDocumentationTabGroupInput = z.infer<typeof DTODeleteDocumentationTabGroupInput>;
109
- export type DTODeleteDocumentationGroupInput = z.infer<typeof DTODeleteDocumentationGroupInput>;
@@ -1,36 +0,0 @@
1
- import { z } from "zod";
2
- import { DTODocumentationDraftState } from "./draft-state";
3
- import { DTODocumentationGroupV2 } from "./group-v2";
4
- import { DTODocumentationPageV2 } from "./page-v2";
5
-
6
- export const DTODocumentationHierarchyV2 = z.object({
7
- pages: z.array(
8
- DTODocumentationPageV2.extend({
9
- /** Defined when a page has changed since last publish and can be included into a partial publish */
10
- draftState: DTODocumentationDraftState.optional(),
11
- })
12
- ),
13
-
14
- groups: z.array(
15
- DTODocumentationGroupV2.extend({
16
- /** Defined when a page has changed since last publish and can be included into a partial publish */
17
- draftState: DTODocumentationDraftState.optional(),
18
- })
19
- ),
20
-
21
- deletedPages: z.array(
22
- DTODocumentationPageV2.extend({
23
- /** Deleted page is always a draft change */
24
- draftState: DTODocumentationDraftState,
25
- })
26
- ),
27
-
28
- deletedGroups: z.array(
29
- DTODocumentationGroupV2.extend({
30
- /** Deleted page is always a draft change */
31
- draftState: DTODocumentationDraftState,
32
- })
33
- ),
34
- });
35
-
36
- export type DTODocumentationHierarchyV2 = z.infer<typeof DTODocumentationHierarchyV2>;
@@ -1,11 +0,0 @@
1
- export * from "./draft-state";
2
- export * from "./group-action";
3
- export * from "./group-v1";
4
- export * from "./group-v2";
5
- export * from "./hierarchy";
6
- export * from "./item-configuration-v1";
7
- export * from "./item-configuration-v2";
8
- export * from "./page-actions-v2";
9
- export * from "./page-content";
10
- export * from "./page-v1";
11
- export * from "./page-v2";
@@ -1,24 +0,0 @@
1
- import { DocumentationItemHeaderV1 } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- const DocumentationColorV1 = z.object({
5
- aliasTo: z.string().optional(),
6
- value: z.string().optional(),
7
- });
8
-
9
- const DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({
10
- foregroundColor: true,
11
- backgroundColor: true,
12
- }).extend({
13
- foregroundColor: DocumentationColorV1.optional(),
14
- backgroundColor: DocumentationColorV1.optional(),
15
- });
16
-
17
- export const DTODocumentationItemConfigurationV1 = z.object({
18
- showSidebar: z.boolean(),
19
- isPrivate: z.boolean(),
20
- isHidden: z.boolean(),
21
- header: DTODocumentationItemHeaderV1,
22
- });
23
-
24
- export type DTODocumentationItemConfigurationV1 = z.infer<typeof DTODocumentationItemConfigurationV1>;
@@ -1,14 +0,0 @@
1
- import { DocumentationItemHeaderV2 } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTODocumentationItemHeaderV2 = DocumentationItemHeaderV2;
5
-
6
- export const DTODocumentationItemConfigurationV2 = z.object({
7
- showSidebar: z.boolean(),
8
- isPrivate: z.boolean(),
9
- isHidden: z.boolean(),
10
- header: DTODocumentationItemHeaderV2,
11
- });
12
-
13
- export type DTODocumentationItemHeaderV2 = z.infer<typeof DTODocumentationItemHeaderV2>;
14
- export type DTODocumentationItemConfigurationV2 = z.infer<typeof DTODocumentationItemConfigurationV2>;
@@ -1,108 +0,0 @@
1
- import { z } from "zod";
2
- import {
3
- DTOCreateDocumentationPageInputV2,
4
- DTODeleteDocumentationPageInputV2,
5
- DTODocumentationPageV2,
6
- DTODuplicateDocumentationPageInputV2,
7
- DTOMoveDocumentationPageInputV2,
8
- DTORestoreDocumentationGroupInput,
9
- DTORestoreDocumentationPageInput,
10
- DTOUpdateDocumentationPageInputV2,
11
- } from "./page-v2";
12
-
13
- //
14
- // Read
15
- //
16
-
17
- const SuccessPayload = z.object({
18
- success: z.literal(true),
19
- });
20
-
21
- export const DTODocumentationPageCreateActionOutputV2 = z.object({
22
- type: z.literal("DocumentationPageCreate"),
23
- output: SuccessPayload,
24
- });
25
-
26
- export const DTODocumentationPageUpdateActionOutputV2 = z.object({
27
- type: z.literal("DocumentationPageUpdate"),
28
- output: SuccessPayload,
29
- });
30
-
31
- export const DTODocumentationPageMoveActionOutputV2 = z.object({
32
- type: z.literal("DocumentationPageMove"),
33
- output: SuccessPayload,
34
- });
35
-
36
- export const DTODocumentationPageDuplicateActionOutputV2 = z.object({
37
- type: z.literal("DocumentationPageDuplicate"),
38
- output: SuccessPayload,
39
- });
40
-
41
- export const DTODocumentationPageDeleteActionOutputV2 = z.object({
42
- type: z.literal("DocumentationPageDelete"),
43
- output: SuccessPayload,
44
- });
45
-
46
- export const DTODocumentationPageRestoreActionOutput = z.object({
47
- type: z.literal("DocumentationPageRestore"),
48
- output: SuccessPayload,
49
- });
50
-
51
- export const DTODocumentationGroupRestoreActionOutput = z.object({
52
- type: z.literal("DocumentationGroupRestore"),
53
- output: SuccessPayload,
54
- });
55
-
56
- export type DTODocumentationPageCreateActionOutputV2 = z.infer<typeof DTODocumentationPageCreateActionOutputV2>;
57
- export type DTODocumentationPageUpdateActionOutputV2 = z.infer<typeof DTODocumentationPageUpdateActionOutputV2>;
58
- export type DTODocumentationPageMoveActionOutputV2 = z.infer<typeof DTODocumentationPageMoveActionOutputV2>;
59
- export type DTODocumentationPageDuplicateActionOutputV2 = z.infer<typeof DTODocumentationPageDuplicateActionOutputV2>;
60
- export type DTODocumentationPageDeleteActionOutputV2 = z.infer<typeof DTODocumentationPageDeleteActionOutputV2>;
61
- export type DTODocumentationPageRestoreActionOutput = z.infer<typeof DTODocumentationPageRestoreActionOutput>;
62
- export type DTODocumentationGroupRestoreActionOutput = z.infer<typeof DTODocumentationGroupRestoreActionOutput>;
63
-
64
- // Write
65
- //
66
-
67
- export const DTODocumentationPageCreateActionInputV2 = z.object({
68
- type: z.literal("DocumentationPageCreate"),
69
- input: DTOCreateDocumentationPageInputV2,
70
- });
71
-
72
- export const DTODocumentationPageUpdateActionInputV2 = z.object({
73
- type: z.literal("DocumentationPageUpdate"),
74
- input: DTOUpdateDocumentationPageInputV2,
75
- });
76
-
77
- export const DTODocumentationPageMoveActionInputV2 = z.object({
78
- type: z.literal("DocumentationPageMove"),
79
- input: DTOMoveDocumentationPageInputV2,
80
- });
81
-
82
- export const DTODocumentationPageDuplicateActionInputV2 = z.object({
83
- type: z.literal("DocumentationPageDuplicate"),
84
- input: DTODuplicateDocumentationPageInputV2,
85
- });
86
-
87
- export const DTODocumentationPageDeleteActionInputV2 = z.object({
88
- type: z.literal("DocumentationPageDelete"),
89
- input: DTODeleteDocumentationPageInputV2,
90
- });
91
-
92
- export const DTODocumentationPageRestoreActionInput = z.object({
93
- type: z.literal("DocumentationPageRestore"),
94
- input: DTORestoreDocumentationPageInput,
95
- });
96
-
97
- export const DTODocumentationGroupRestoreActionInput = z.object({
98
- type: z.literal("DocumentationGroupRestore"),
99
- input: DTORestoreDocumentationGroupInput,
100
- });
101
-
102
- export type DTODocumentationPageCreateActionInputV2 = z.infer<typeof DTODocumentationPageCreateActionInputV2>;
103
- export type DTODocumentationPageUpdateActionInputV2 = z.infer<typeof DTODocumentationPageUpdateActionInputV2>;
104
- export type DTODocumentationPageMoveActionInputV2 = z.infer<typeof DTODocumentationPageMoveActionInputV2>;
105
- export type DTODocumentationPageDuplicateActionInputV2 = z.infer<typeof DTODocumentationPageDuplicateActionInputV2>;
106
- export type DTODocumentationPageDeleteActionInputV2 = z.infer<typeof DTODocumentationPageDeleteActionInputV2>;
107
- export type DTODocumentationPageRestoreActionInput = z.infer<typeof DTODocumentationPageRestoreActionInput>;
108
- export type DTODocumentationGroupRestoreActionInput = z.infer<typeof DTODocumentationGroupRestoreActionInput>;
@@ -1,15 +0,0 @@
1
- import { DocumentationPageContent } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTODocumentationPageContent = DocumentationPageContent;
9
-
10
- export const DTODocumentationPageContentGetResponse = z.object({
11
- pageContent: DTODocumentationPageContent,
12
- });
13
-
14
- export type DTODocumentationPageContent = z.infer<typeof DTODocumentationPageContent>;
15
- export type DTODocumentationPageContentGetResponse = z.infer<typeof DTODocumentationPageContentGetResponse>;
@@ -1,21 +0,0 @@
1
- import { DocumentationPageV1, PageBlockV1 } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTODocumentationItemConfigurationV1 } from "./item-configuration-v1";
4
-
5
- //
6
- // Read
7
- //
8
-
9
- export const DocumentationPageV1DTO = DocumentationPageV1.omit({
10
- data: true,
11
- meta: true,
12
- parentPersistentId: true,
13
- sortOrder: true,
14
- }).extend({
15
- configuration: DTODocumentationItemConfigurationV1,
16
- blocks: z.array(PageBlockV1),
17
- title: z.string(),
18
- path: z.string(),
19
- });
20
-
21
- export type DocumentationPageV1DTO = z.infer<typeof DocumentationPageV1DTO>;
@@ -1,105 +0,0 @@
1
- import { z } from "zod";
2
- import { DTODocumentationDraftState } from "./draft-state";
3
- import { DTODocumentationItemConfigurationV2 } from "./item-configuration-v2";
4
-
5
- //
6
- // Read
7
- //
8
-
9
- export const DTODocumentationPageV2 = z.object({
10
- id: z.string(),
11
- persistentId: z.string(),
12
-
13
- designSystemVersionId: z.string(),
14
-
15
- title: z.string(),
16
- configuration: DTODocumentationItemConfigurationV2,
17
-
18
- shortPersistentId: z.string(),
19
-
20
- slug: z.string().optional(),
21
- userSlug: z.string().optional(),
22
-
23
- createdAt: z.coerce.date(),
24
- updatedAt: z.coerce.date(),
25
-
26
- path: z.string(),
27
-
28
- /** Defined when a page has changed since last publish and can be included into a partial publish */
29
- draftState: DTODocumentationDraftState.optional(),
30
-
31
- // Backward compatibility
32
- type: z.literal("Page"),
33
- });
34
-
35
- export type DTODocumentationPageV2 = z.infer<typeof DTODocumentationPageV2>;
36
-
37
- //
38
- // Write
39
- //
40
-
41
- export const DTOCreateDocumentationPageInputV2 = z.object({
42
- // Identifier
43
- persistentId: z.string().uuid(),
44
-
45
- // Page properties
46
- title: z.string(),
47
- configuration: DTODocumentationItemConfigurationV2.partial().optional(),
48
-
49
- // Page placement properties
50
- parentPersistentId: z.string().uuid(),
51
- afterPersistentId: z.string().uuid().nullish(),
52
- });
53
-
54
- export const DTOUpdateDocumentationPageInputV2 = z.object({
55
- // Identifier of the group to update
56
- id: z.string(),
57
-
58
- // Page properties
59
- title: z.string().optional(),
60
- configuration: DTODocumentationItemConfigurationV2.partial().optional(),
61
- });
62
-
63
- export const DTOMoveDocumentationPageInputV2 = z.object({
64
- // Identifier of the group to update
65
- id: z.string(),
66
-
67
- // Page placement properties
68
- parentPersistentId: z.string().uuid(),
69
- afterPersistentId: z.string().uuid().nullish(),
70
- });
71
-
72
- export const DTODuplicateDocumentationPageInputV2 = z.object({
73
- // Identifier of the page to duplicate from
74
- id: z.string(),
75
-
76
- // New page persistent id
77
- persistentId: z.string().uuid(),
78
-
79
- // Page placement properties
80
- parentPersistentId: z.string().uuid(),
81
- afterPersistentId: z.string().uuid().nullish(),
82
- });
83
-
84
- export const DTODeleteDocumentationPageInputV2 = z.object({
85
- // Identifier
86
- id: z.string(),
87
- });
88
-
89
- export const DTORestoreDocumentationPageInput = z.object({
90
- persistentId: z.string(),
91
- snapshotId: z.string().optional(),
92
- });
93
-
94
- export const DTORestoreDocumentationGroupInput = z.object({
95
- persistentId: z.string(),
96
- snapshotId: z.string().optional(),
97
- });
98
-
99
- export type DTOCreateDocumentationPageInputV2 = z.infer<typeof DTOCreateDocumentationPageInputV2>;
100
- export type DTOUpdateDocumentationPageInputV2 = z.infer<typeof DTOUpdateDocumentationPageInputV2>;
101
- export type DTOMoveDocumentationPageInputV2 = z.infer<typeof DTOMoveDocumentationPageInputV2>;
102
- export type DTODuplicateDocumentationPageInputV2 = z.infer<typeof DTODuplicateDocumentationPageInputV2>;
103
- export type DTODeleteDocumentationPageInputV2 = z.infer<typeof DTODeleteDocumentationPageInputV2>;
104
- export type DTORestoreDocumentationPageInput = z.infer<typeof DTORestoreDocumentationPageInput>;
105
- export type DTORestoreDocumentationGroupInput = z.infer<typeof DTORestoreDocumentationGroupInput>;
@@ -1,114 +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
- DTODocumentationPageCreateActionInputV2,
22
- DTODocumentationPageCreateActionOutputV2,
23
- DTODocumentationPageDeleteActionInputV2,
24
- DTODocumentationPageDeleteActionOutputV2,
25
- DTODocumentationPageDuplicateActionInputV2,
26
- DTODocumentationPageDuplicateActionOutputV2,
27
- DTODocumentationPageMoveActionInputV2,
28
- DTODocumentationPageMoveActionOutputV2,
29
- DTODocumentationPageRestoreActionInput,
30
- DTODocumentationPageRestoreActionOutput,
31
- DTODocumentationPageUpdateActionInputV2,
32
- DTODocumentationPageUpdateActionOutputV2,
33
- } from "./documentation/page-actions-v2";
34
- import { DTOFigmaNodeRenderActionInput, DTOFigmaNodeRenderActionOutput } from "./figma-nodes/node-actions-v2";
35
- import {
36
- DTOPropertyDefinitionCreateActionInputV2,
37
- DTOPropertyDefinitionCreateActionOutputV2,
38
- DTOPropertyDefinitionDeleteActionInputV2,
39
- DTOPropertyDefinitionDeleteActionOutputV2,
40
- DTOPropertyDefinitionUpdateActionInputV2,
41
- DTOPropertyDefinitionUpdateActionOutputV2,
42
- } from "./properties/property-definitions-actions-v2";
43
-
44
- //
45
- // Read
46
- //
47
-
48
- export const DTOElementActionOutput = z.discriminatedUnion("type", [
49
- // Documentation pages
50
- DTODocumentationPageCreateActionOutputV2,
51
- DTODocumentationPageUpdateActionOutputV2,
52
- DTODocumentationPageMoveActionOutputV2,
53
- DTODocumentationPageDuplicateActionOutputV2,
54
- DTODocumentationPageDeleteActionOutputV2,
55
-
56
- // Documentation groups
57
- DTODocumentationGroupCreateActionOutputV2,
58
- DTODocumentationTabCreateActionOutputV2,
59
- DTODocumentationGroupUpdateActionOutputV2,
60
- DTODocumentationGroupMoveActionOutputV2,
61
- DTODocumentationGroupDuplicateActionOutputV2,
62
- DTODocumentationGroupDeleteActionOutputV2,
63
- DTODocumentationTabGroupDeleteActionOutputV2,
64
-
65
- // Figma frames
66
- DTOFigmaNodeRenderActionOutput,
67
-
68
- // Properties Definitions
69
- DTOPropertyDefinitionCreateActionOutputV2,
70
- DTOPropertyDefinitionUpdateActionOutputV2,
71
- DTOPropertyDefinitionDeleteActionOutputV2,
72
-
73
- // Restore
74
- DTODocumentationPageRestoreActionOutput,
75
- DTODocumentationGroupRestoreActionOutput,
76
- ]);
77
-
78
- export type DTOElementActionOutput = z.infer<typeof DTOElementActionOutput>;
79
-
80
- //
81
- // Write
82
- //
83
-
84
- export const DTOElementActionInput = z.discriminatedUnion("type", [
85
- // Documentation pages
86
- DTODocumentationPageCreateActionInputV2,
87
- DTODocumentationPageUpdateActionInputV2,
88
- DTODocumentationPageMoveActionInputV2,
89
- DTODocumentationPageDuplicateActionInputV2,
90
- DTODocumentationPageDeleteActionInputV2,
91
-
92
- // Documentation groups
93
- DTODocumentationGroupCreateActionInputV2,
94
- DTODocumentationTabCreateActionInputV2,
95
- DTODocumentationGroupUpdateActionInputV2,
96
- DTODocumentationGroupMoveActionInputV2,
97
- DTODocumentationGroupDuplicateActionInputV2,
98
- DTODocumentationGroupDeleteActionInputV2,
99
- DTODocumentationTabGroupDeleteActionInputV2,
100
-
101
- // Figma frames
102
- DTOFigmaNodeRenderActionInput,
103
-
104
- // Properties Definitions
105
- DTOPropertyDefinitionCreateActionInputV2,
106
- DTOPropertyDefinitionUpdateActionInputV2,
107
- DTOPropertyDefinitionDeleteActionInputV2,
108
-
109
- // Restore
110
- DTODocumentationPageRestoreActionInput,
111
- DTODocumentationGroupRestoreActionInput,
112
- ]);
113
-
114
- export type DTOElementActionInput = z.infer<typeof DTOElementActionInput>;
@@ -1,55 +0,0 @@
1
- import { FigmaFileStructure } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTOFigmaNodeOrigin = z.object({
9
- sourceId: z.string(),
10
- fileId: z.string().optional(),
11
- parentName: z.string().optional(),
12
- });
13
-
14
- export const DTOFigmaNodeData = z.object({
15
- // Id of the node in the Figma file
16
- figmaNodeId: z.string(),
17
-
18
- // Validity
19
- isValid: z.boolean(),
20
-
21
- // Asset data
22
- assetId: z.string(),
23
- assetUrl: z.string(),
24
-
25
- // Asset metadata
26
- assetScale: z.number(),
27
- assetWidth: z.number().optional(),
28
- assetHeight: z.number().optional(),
29
- });
30
-
31
- export const DTOFigmaNode = FigmaFileStructure.omit({
32
- data: true,
33
- origin: true
34
- }).extend({
35
- data: DTOFigmaNodeData,
36
- origin: DTOFigmaNodeOrigin
37
- });
38
-
39
- export type DTOFigmaNodeOrigin = z.infer<typeof DTOFigmaNodeOrigin>;
40
- export type DTOFigmaNodeData = z.infer<typeof DTOFigmaNodeData>;
41
- export type DTOFigmaNode = z.infer<typeof DTOFigmaNode>;
42
-
43
- //
44
- // Write
45
- //
46
-
47
- export const DTOFigmaNodeRenderInput = z.object({
48
- // Id of a design system's data source representing a linked Figma file
49
- sourceId: z.string(),
50
-
51
- // Id of a node within the Figma file
52
- figmaFileNodeId: z.string(),
53
- });
54
-
55
- export type DTOFigmaNodeRenderInput = z.infer<typeof DTOFigmaNodeRenderInput>;
@@ -1,2 +0,0 @@
1
- export * from "./figma-node";
2
- export * from "./node-actions-v2";
@@ -1,24 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOFigmaNode, DTOFigmaNodeRenderInput } from "./figma-node";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTOFigmaNodeRenderActionOutput = z.object({
9
- type: z.literal("FigmaNodeRender"),
10
- figmaNodes: z.array(DTOFigmaNode),
11
- });
12
-
13
- export type DTOFigmaNodeRenderActionOutput = z.infer<typeof DTOFigmaNodeRenderActionOutput>;
14
-
15
- //
16
- // Read
17
- //
18
-
19
- export const DTOFigmaNodeRenderActionInput = z.object({
20
- type: z.literal("FigmaNodeRender"),
21
- input: DTOFigmaNodeRenderInput.array(),
22
- });
23
-
24
- export type DTOFigmaNodeRenderActionInput = z.infer<typeof DTOFigmaNodeRenderActionInput>;
@@ -1,21 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOFigmaNode } 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
- });
13
-
14
- export const DTOElementsGetOutput = z.object({
15
- figmaNodes: z.array(DTOFigmaNode).optional(),
16
- });
17
-
18
- export type DTOElementsGetOutput = z.infer<typeof DTOElementsGetOutput>;
19
- export type DTOElementsGetQueryRaw = z.input<typeof DTOElementsGetQuerySchema>;
20
- export type DTOElementsGetQueryParsed = z.output<typeof DTOElementsGetQuerySchema>;
21
- export type DTOElementsGetTypeFilter = z.infer<typeof DTOElementsGetTypeFilter>;
@@ -1,5 +0,0 @@
1
- export * from "./documentation";
2
- export * from "./figma-nodes";
3
- export * from "./properties";
4
- export * from "./elements-action-v2";
5
- export * from "./get-elements-v2";
@@ -1,3 +0,0 @@
1
- export * from "./property-definitions-actions-v2";
2
- export * from "./property-definitions";
3
- export * from "./property-values";