@supernova-studio/client 0.58.19 → 1.0.0-alpha.3

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 (196) hide show
  1. package/dist/index.d.mts +1363 -1321
  2. package/dist/index.d.ts +1363 -1321
  3. package/dist/index.js +536 -339
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +839 -642
  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 -72
  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 -25
  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 -13
  40. package/src/api/dto/design-systems/members.ts +0 -50
  41. package/src/api/dto/design-systems/role.ts +0 -11
  42. package/src/api/dto/design-systems/stats.ts +0 -19
  43. package/src/api/dto/design-systems/version.ts +0 -56
  44. package/src/api/dto/design-systems/view.ts +0 -45
  45. package/src/api/dto/design-tokens/design-token.ts +0 -78
  46. package/src/api/dto/design-tokens/index.ts +0 -1
  47. package/src/api/dto/documentation/anchor.ts +0 -15
  48. package/src/api/dto/documentation/approvals.ts +0 -15
  49. package/src/api/dto/documentation/block-definition.ts +0 -28
  50. package/src/api/dto/documentation/block.ts +0 -6
  51. package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
  52. package/src/api/dto/documentation/index.ts +0 -8
  53. package/src/api/dto/documentation/link-preview.ts +0 -23
  54. package/src/api/dto/documentation/publish.ts +0 -23
  55. package/src/api/dto/documentation/room.ts +0 -12
  56. package/src/api/dto/elements/components/figma-component-group.ts +0 -19
  57. package/src/api/dto/elements/components/figma-component.ts +0 -56
  58. package/src/api/dto/elements/components/index.ts +0 -2
  59. package/src/api/dto/elements/documentation/draft-state.ts +0 -37
  60. package/src/api/dto/elements/documentation/group-action.ts +0 -108
  61. package/src/api/dto/elements/documentation/group-v1.ts +0 -35
  62. package/src/api/dto/elements/documentation/group-v2.ts +0 -117
  63. package/src/api/dto/elements/documentation/hierarchy.ts +0 -22
  64. package/src/api/dto/elements/documentation/index.ts +0 -13
  65. package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
  66. package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
  67. package/src/api/dto/elements/documentation/metadata.ts +0 -8
  68. package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -121
  69. package/src/api/dto/elements/documentation/page-content.ts +0 -15
  70. package/src/api/dto/elements/documentation/page-v1.ts +0 -21
  71. package/src/api/dto/elements/documentation/page-v2.ts +0 -120
  72. package/src/api/dto/elements/documentation/structure.ts +0 -37
  73. package/src/api/dto/elements/elements-action-v2.ts +0 -104
  74. package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -106
  75. package/src/api/dto/elements/figma-nodes/index.ts +0 -2
  76. package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -24
  77. package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +0 -17
  78. package/src/api/dto/elements/frame-node-structures/index.ts +0 -1
  79. package/src/api/dto/elements/get-elements-v2.ts +0 -21
  80. package/src/api/dto/elements/index.ts +0 -7
  81. package/src/api/dto/elements/properties/index.ts +0 -2
  82. package/src/api/dto/elements/properties/property-definitions.ts +0 -75
  83. package/src/api/dto/elements/properties/property-values.ts +0 -38
  84. package/src/api/dto/export/exporter-property.ts +0 -95
  85. package/src/api/dto/export/exporter.ts +0 -87
  86. package/src/api/dto/export/filter.ts +0 -6
  87. package/src/api/dto/export/index.ts +0 -5
  88. package/src/api/dto/export/job.ts +0 -87
  89. package/src/api/dto/export/pipeline.ts +0 -43
  90. package/src/api/dto/figma-components/assets/download.ts +0 -30
  91. package/src/api/dto/figma-components/assets/index.ts +0 -1
  92. package/src/api/dto/figma-components/index.ts +0 -1
  93. package/src/api/dto/index.ts +0 -13
  94. package/src/api/dto/liveblocks/auth-response.ts +0 -7
  95. package/src/api/dto/liveblocks/index.ts +0 -1
  96. package/src/api/dto/themes/index.ts +0 -2
  97. package/src/api/dto/themes/override.ts +0 -27
  98. package/src/api/dto/themes/theme.ts +0 -45
  99. package/src/api/dto/users/authenticated-user.ts +0 -43
  100. package/src/api/dto/users/index.ts +0 -3
  101. package/src/api/dto/users/update.ts +0 -8
  102. package/src/api/dto/users/user.ts +0 -31
  103. package/src/api/dto/workspaces/git.ts +0 -32
  104. package/src/api/dto/workspaces/index.ts +0 -6
  105. package/src/api/dto/workspaces/integrations.ts +0 -34
  106. package/src/api/dto/workspaces/invitations.ts +0 -30
  107. package/src/api/dto/workspaces/membership.ts +0 -41
  108. package/src/api/dto/workspaces/npm-registry.ts +0 -35
  109. package/src/api/dto/workspaces/workspace.ts +0 -34
  110. package/src/api/endpoints/codegen/codegen.ts +0 -13
  111. package/src/api/endpoints/codegen/exporters.ts +0 -13
  112. package/src/api/endpoints/codegen/index.ts +0 -3
  113. package/src/api/endpoints/codegen/pipelines.ts +0 -37
  114. package/src/api/endpoints/design-system/bff.ts +0 -13
  115. package/src/api/endpoints/design-system/contact.ts +0 -12
  116. package/src/api/endpoints/design-system/design-systems.ts +0 -55
  117. package/src/api/endpoints/design-system/index.ts +0 -6
  118. package/src/api/endpoints/design-system/members.ts +0 -24
  119. package/src/api/endpoints/design-system/sources.ts +0 -35
  120. package/src/api/endpoints/design-system/versions/brands.ts +0 -45
  121. package/src/api/endpoints/design-system/versions/documentation.ts +0 -27
  122. package/src/api/endpoints/design-system/versions/ds-components.ts +0 -28
  123. package/src/api/endpoints/design-system/versions/elements-action.ts +0 -55
  124. package/src/api/endpoints/design-system/versions/elements.ts +0 -13
  125. package/src/api/endpoints/design-system/versions/figma-component-groups.ts +0 -13
  126. package/src/api/endpoints/design-system/versions/figma-components.ts +0 -13
  127. package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +0 -13
  128. package/src/api/endpoints/design-system/versions/import-jobs.ts +0 -13
  129. package/src/api/endpoints/design-system/versions/index.ts +0 -18
  130. package/src/api/endpoints/design-system/versions/overrides.ts +0 -17
  131. package/src/api/endpoints/design-system/versions/property-definitions.ts +0 -43
  132. package/src/api/endpoints/design-system/versions/property-values.ts +0 -25
  133. package/src/api/endpoints/design-system/versions/stats.ts +0 -12
  134. package/src/api/endpoints/design-system/versions/themes.ts +0 -35
  135. package/src/api/endpoints/design-system/versions/token-collections.ts +0 -13
  136. package/src/api/endpoints/design-system/versions/token-groups.ts +0 -28
  137. package/src/api/endpoints/design-system/versions/tokens.ts +0 -27
  138. package/src/api/endpoints/design-system/versions/versions.ts +0 -79
  139. package/src/api/endpoints/index.ts +0 -5
  140. package/src/api/endpoints/liveblocks.ts +0 -14
  141. package/src/api/endpoints/users.ts +0 -26
  142. package/src/api/endpoints/workspaces/index.ts +0 -3
  143. package/src/api/endpoints/workspaces/workspace-invites.ts +0 -34
  144. package/src/api/endpoints/workspaces/workspace-members.ts +0 -31
  145. package/src/api/endpoints/workspaces/workspaces.ts +0 -47
  146. package/src/api/index.ts +0 -6
  147. package/src/api/payloads/design-systems/index.ts +0 -2
  148. package/src/api/payloads/design-systems/update-design-system.ts +0 -29
  149. package/src/api/payloads/design-systems/version.ts +0 -29
  150. package/src/api/payloads/documentation/block-definitions.ts +0 -12
  151. package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
  152. package/src/api/payloads/documentation/index.ts +0 -2
  153. package/src/api/payloads/export/index.ts +0 -1
  154. package/src/api/payloads/export/pipeline.ts +0 -50
  155. package/src/api/payloads/index.ts +0 -6
  156. package/src/api/payloads/liveblocks/auth.ts +0 -7
  157. package/src/api/payloads/liveblocks/index.ts +0 -1
  158. package/src/api/payloads/users/index.ts +0 -2
  159. package/src/api/payloads/users/notifications/index.ts +0 -1
  160. package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
  161. package/src/api/payloads/users/profile/index.ts +0 -1
  162. package/src/api/payloads/users/profile/update.ts +0 -4
  163. package/src/api/payloads/workspaces/index.ts +0 -3
  164. package/src/api/payloads/workspaces/transfer-ownership.ts +0 -7
  165. package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
  166. package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
  167. package/src/api/transport/index.ts +0 -2
  168. package/src/api/transport/request-executor-error.ts +0 -66
  169. package/src/api/transport/request-executor.ts +0 -87
  170. package/src/index.ts +0 -3
  171. package/src/utils/figma.ts +0 -53
  172. package/src/utils/hash.ts +0 -62
  173. package/src/utils/index.ts +0 -3
  174. package/src/utils/query.ts +0 -18
  175. package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -35
  176. package/src/yjs/design-system-content/index.ts +0 -2
  177. package/src/yjs/design-system-content/item-configuration.ts +0 -93
  178. package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -764
  179. package/src/yjs/docs-editor/index.ts +0 -7
  180. package/src/yjs/docs-editor/list-tree-builder.ts +0 -127
  181. package/src/yjs/docs-editor/mock.ts +0 -2104
  182. package/src/yjs/docs-editor/model/block.ts +0 -8
  183. package/src/yjs/docs-editor/model/index.ts +0 -2
  184. package/src/yjs/docs-editor/model/page.ts +0 -8
  185. package/src/yjs/docs-editor/prosemirror/index.ts +0 -3
  186. package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +0 -145
  187. package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +0 -577
  188. package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
  189. package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -975
  190. package/src/yjs/docs-editor/utils.ts +0 -115
  191. package/src/yjs/index.ts +0 -3
  192. package/src/yjs/version-room/backend.ts +0 -78
  193. package/src/yjs/version-room/base.ts +0 -211
  194. package/src/yjs/version-room/frontend.ts +0 -461
  195. package/src/yjs/version-room/index.ts +0 -4
  196. package/src/yjs/version-room/utils.ts +0 -109
@@ -1,50 +0,0 @@
1
- import { DesignSystemMembershipUpdates } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTODesignSystemRole } from "./role";
4
-
5
- //
6
- // Read
7
- //
8
-
9
- export const DTODesignSystemMember = z.object({
10
- userId: z.string(),
11
-
12
- /**
13
- * Role that the member has in the design system,
14
- * undefined if set to inherit from workspace
15
- */
16
- designSystemRole: DTODesignSystemRole.optional(),
17
- });
18
-
19
- export const DTODesignSystemInvitation = z.object({
20
- id: z.string(),
21
- workspaceInvitationId: z.string(),
22
-
23
- /**
24
- * Role that the invitation has in the design system,
25
- * undefined if set to inherit from workspace
26
- */
27
- designSystemRole: DTODesignSystemRole.optional(),
28
- });
29
-
30
- export const DTODesignSystemMemberListResponse = z.object({
31
- members: DTODesignSystemMember.array(),
32
- invitations: DTODesignSystemInvitation.array(),
33
- });
34
-
35
- export const DTODesignSystemMembersUpdateResponse = z.object({
36
- ok: z.literal(true),
37
- });
38
-
39
- export type DTODesignSystemMember = z.infer<typeof DTODesignSystemMember>;
40
- export type DTODesignSystemInvitation = z.infer<typeof DTODesignSystemInvitation>;
41
- export type DTODesignSystemMemberListResponse = z.infer<typeof DTODesignSystemMemberListResponse>;
42
- export type DTODesignSystemMembersUpdateResponse = z.infer<typeof DTODesignSystemMembersUpdateResponse>;
43
-
44
- //
45
- // Write
46
- //
47
-
48
- export const DTODesignSystemMembersUpdatePayload = DesignSystemMembershipUpdates;
49
-
50
- export type DTODesignSystemMembersUpdatePayload = z.infer<typeof DTODesignSystemMembersUpdatePayload>;
@@ -1,11 +0,0 @@
1
- import { WorkspaceRole } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTODesignSystemRole = z.enum([
5
- WorkspaceRole.Admin,
6
- WorkspaceRole.Contributor,
7
- WorkspaceRole.Creator,
8
- WorkspaceRole.Viewer,
9
- ]);
10
-
11
- export type DTODesignSystemRole = z.infer<typeof DTODesignSystemRole>;
@@ -1,19 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTODesignSystemVersionStats = z.object({
4
- tokens: z.number(),
5
- designSystemComponents: z.number(),
6
- assets: z.number(),
7
- documentationPages: z.number(),
8
- figmaComponents: z.number(),
9
- });
10
-
11
- export const DTODesignSystemVersionStatsQuery = z.object({
12
- /**
13
- * Unique ID across versions (non-persistent ID)
14
- */
15
- brandId: z.string().optional(),
16
- });
17
-
18
- export type DTODesignSystemVersionStats = z.infer<typeof DTODesignSystemVersionStats>;
19
- export type DTODesignSystemVersionStatsQuery = z.infer<typeof DTODesignSystemVersionStatsQuery>;
@@ -1,56 +0,0 @@
1
- import { ObjectMeta, VersionCreationJob } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOCreateVersionInput } from "../../payloads";
4
-
5
- export const DTODesignSystemVersion = z.object({
6
- id: z.string(),
7
- createdAt: z.coerce.date(),
8
- meta: ObjectMeta,
9
- version: z.string(),
10
- isReadonly: z.boolean(),
11
- changeLog: z.string(),
12
- designSystemId: z.string(),
13
- });
14
-
15
- export const DTODesignSystemVersionsListResponse = z.object({
16
- designSystemVersions: z.array(DTODesignSystemVersion),
17
- });
18
-
19
- export const DTODesignSystemVersionGetResponse = z.object({
20
- designSystemVersion: DTODesignSystemVersion,
21
- });
22
-
23
- export const DTODesignSystemVersionCreationResponse = z.object({
24
- meta: ObjectMeta,
25
- version: z.string(),
26
- changeLog: z.string(),
27
- isReadOnly: z.boolean(),
28
- designSystemId: z.string(),
29
- jobId: z.string(),
30
- });
31
-
32
- export const VersionSQSPayload = z.object({
33
- jobId: z.string(),
34
- designSystemId: z.string(),
35
- input: DTOCreateVersionInput,
36
- });
37
-
38
- export type VersionSQSPayload = z.infer<typeof VersionSQSPayload>;
39
-
40
- export type DTODesignSystemVersionCreationResponse = z.infer<typeof DTODesignSystemVersionCreationResponse>;
41
- export type DTODesignSystemVersion = z.infer<typeof DTODesignSystemVersion>;
42
- export type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystemVersionsListResponse>;
43
- export type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;
44
-
45
- export const DTODesignSystemVersionJobsResponse = z.object({
46
- jobs: z.array(VersionCreationJob),
47
- });
48
-
49
- export type DTODesignSystemVersionJobsResponse = z.infer<typeof DTODesignSystemVersionJobsResponse>;
50
-
51
- // Creation job status response
52
- export const DTODesignSystemVersionJobStatusResponse = z.object({
53
- job: VersionCreationJob,
54
- });
55
-
56
- export type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;
@@ -1,45 +0,0 @@
1
- import { z } from "zod";
2
- import { ElementPropertyTargetType, ElementViewBaseColumnType, ObjectMeta } from "@supernova-studio/model";
3
-
4
- export const DTOElementViewColumnSharedAttributes = z.object({
5
- id: z.string(),
6
- persistentId: z.string(),
7
- width: z.number(),
8
- });
9
-
10
- export const DTOElementViewBasePropertyColumn = DTOElementViewColumnSharedAttributes.extend({
11
- type: z.literal("BaseProperty"),
12
- basePropertyType: ElementViewBaseColumnType,
13
- });
14
-
15
- export const DTOElementViewPropertyDefinitionColumn = DTOElementViewColumnSharedAttributes.extend({
16
- type: z.literal("PropertyDefinition"),
17
- propertyDefinitionId: z.string(),
18
- });
19
-
20
- export const DTOElementViewThemeColumn = DTOElementViewColumnSharedAttributes.extend({
21
- type: z.literal("Theme"),
22
- themeId: z.string(),
23
- });
24
-
25
- export const DTOElementViewColumn = z.discriminatedUnion("type", [
26
- DTOElementViewBasePropertyColumn,
27
- DTOElementViewPropertyDefinitionColumn,
28
- DTOElementViewThemeColumn,
29
- ]);
30
-
31
- export const DTOElementView = z.object({
32
- meta: ObjectMeta,
33
- persistentId: z.string(),
34
- targetElementType: ElementPropertyTargetType,
35
- id: z.string(),
36
- isDefault: z.boolean(),
37
- columns: z.array(DTOElementViewColumn),
38
- });
39
-
40
- export const DTOElementViewsListResponse = z.object({
41
- elementDataViews: z.array(DTOElementView),
42
- });
43
-
44
- export type DTOElementView = z.infer<typeof DTOElementView>;
45
- export type DTOElementViewsListResponse = z.infer<typeof DTOElementViewsListResponse>;
@@ -1,78 +0,0 @@
1
- import { DesignTokenOrigin, DesignTokenType, DesignTokenTypedData, ObjectMeta } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTODesignToken = DesignTokenTypedData.and(
9
- z.object({
10
- id: z.string(),
11
- persistentId: z.string(),
12
- designSystemVersionId: z.string(),
13
- meta: ObjectMeta,
14
- originStyle: DesignTokenOrigin.optional(),
15
- brandId: z.string(),
16
- collectionId: z.string().optional(),
17
- updatedAt: z.coerce.date(),
18
- })
19
- );
20
-
21
- export const DTODesignTokenListResponse = z.object({
22
- tokens: DTODesignToken.array(),
23
- });
24
-
25
- export const DTODesignTokenResponse = z.object({
26
- token: DTODesignToken,
27
- });
28
-
29
- export const DTODesignTokenGroup = z.object({
30
- id: z.string(),
31
- tokenType: DesignTokenType,
32
- persistentId: z.string(),
33
- isRoot: z.boolean(),
34
- brandId: z.string(),
35
- meta: ObjectMeta,
36
- childrenIds: z.string().array(),
37
- });
38
-
39
- export const DTODesignTokenGroupListResponse = z.object({
40
- groups: DTODesignTokenGroup.array(),
41
- });
42
-
43
- export const DTODesignTokenGroupResponse = z.object({
44
- group: DTODesignTokenGroup,
45
- });
46
-
47
- export type DTODesignToken = z.infer<typeof DTODesignToken>;
48
- export type DTODesignTokenResponse = z.infer<typeof DTODesignTokenResponse>;
49
- export type DTODesignTokenListResponse = z.infer<typeof DTODesignTokenListResponse>;
50
-
51
- export type DTODesignTokenGroup = z.infer<typeof DTODesignTokenGroup>;
52
- export type DTODesignTokenGroupListResponse = z.infer<typeof DTODesignTokenGroupListResponse>;
53
- export type DTODesignTokenGroupResponse = z.infer<typeof DTODesignTokenGroupResponse>;
54
-
55
- //
56
- // Write
57
- //
58
-
59
- export const DTODesignTokenCreatePayload = DesignTokenTypedData.and(
60
- z.object({
61
- persistentId: z.string(),
62
- meta: ObjectMeta,
63
- brandId: z.string(),
64
- groupPersistentId: z.string().optional(),
65
- })
66
- );
67
-
68
- export const DTODesignTokenGroupCreatePayload = z.object({
69
- persistentId: z.string(),
70
- meta: ObjectMeta,
71
- brandId: z.string(),
72
- parentId: z.string().optional(),
73
- tokenType: DesignTokenType,
74
- childrenIds: z.string().array(),
75
- });
76
-
77
- export type DTODesignTokenCreatePayload = z.infer<typeof DTODesignTokenCreatePayload>;
78
- export type DTODesignTokenGroupCreatePayload = z.infer<typeof DTODesignTokenGroupCreatePayload>;
@@ -1 +0,0 @@
1
- export * from "./design-token";
@@ -1,15 +0,0 @@
1
- import { DocumentationPageAnchor } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTODocumentationPageAnchor = DocumentationPageAnchor;
9
-
10
- export const DTOGetDocumentationPageAnchorsResponse = z.object({
11
- anchors: z.array(DTODocumentationPageAnchor),
12
- });
13
-
14
- export type DTODocumentationPageAnchor = z.infer<typeof DTODocumentationPageAnchor>;
15
- export type DTOGetDocumentationPageAnchorsResponse = z.infer<typeof DTOGetDocumentationPageAnchorsResponse>;
@@ -1,15 +0,0 @@
1
- import { DocumentationPageApproval, DocumentationPageApprovalState } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTODocumentationPageApprovalState = DocumentationPageApproval;
5
-
6
- export type DTODocumentationPageApprovalState = DocumentationPageApproval;
7
-
8
- export const DTODocumentationGroupApprovalState = z.object({
9
- persistentId: z.string(),
10
- groupId: z.string(),
11
- designSystemVersionId: z.string(),
12
- approvalState: DocumentationPageApprovalState,
13
- });
14
-
15
- export type DTODocumentationGroupApprovalState = z.infer<typeof DTODocumentationGroupApprovalState>;
@@ -1,28 +0,0 @@
1
- import {
2
- PageBlockColorV2,
3
- PageBlockDefinition,
4
- PageBlockDefinitionBehavior,
5
- PageBlockDefinitionItem,
6
- PageBlockDefinitionLayout,
7
- PageBlockDefinitionProperty,
8
- PageBlockDefinitionVariant,
9
- } from "@supernova-studio/model";
10
- import { z } from "zod";
11
-
12
- export const DTOPageBlockDefinitionBehavior = PageBlockDefinitionBehavior;
13
- export const DTOPageBlockDefinitionItem = PageBlockDefinitionItem;
14
- export const DTOPageBlockDefinitionLayout = PageBlockDefinitionLayout;
15
- export const DTOPageBlockDefinitionVariant = PageBlockDefinitionVariant;
16
- export const DTOPageBlockDefinitionProperty = PageBlockDefinitionProperty;
17
- export const DTOPageBlockColorV2 = PageBlockColorV2;
18
-
19
- export const DTOPageBlockDefinition = PageBlockDefinition;
20
-
21
- export type DTOPageBlockDefinitionBehavior = z.infer<typeof DTOPageBlockDefinitionBehavior>;
22
- export type DTOPageBlockDefinitionItem = z.infer<typeof DTOPageBlockDefinitionItem>;
23
- export type DTOPageBlockDefinitionLayout = z.infer<typeof DTOPageBlockDefinitionLayout>;
24
- export type DTOPageBlockDefinitionVariant = z.infer<typeof DTOPageBlockDefinitionVariant>;
25
- export type DTOPageBlockDefinitionProperty = z.infer<typeof DTOPageBlockDefinitionProperty>;
26
- export type DTOPageBlockColorV2 = z.infer<typeof DTOPageBlockColorV2>;
27
-
28
- export type DTOPageBlockDefinition = z.infer<typeof DTOPageBlockDefinition>;
@@ -1,6 +0,0 @@
1
- import { PageBlockItemV2 } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTOPageBlockItemV2 = PageBlockItemV2;
5
-
6
- export type DTOPageBlockItemV2 = z.infer<typeof DTOPageBlockItemV2>;
@@ -1,18 +0,0 @@
1
- import { DesignElementSnapshotReason } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTODocumentationPageV2 } from "../elements/documentation/page-v2";
4
-
5
- export const DTODocumentationPageSnapshot = z.object({
6
- id: z.string(),
7
- designSystemVersionId: z.string(),
8
-
9
- createdAt: z.string(),
10
- updatedAt: z.string(),
11
-
12
- documentationPage: DTODocumentationPageV2,
13
- pageContentHash: z.string(),
14
-
15
- reason: DesignElementSnapshotReason,
16
- });
17
-
18
- export type DTODocumentationPageSnapshot = z.infer<typeof DTODocumentationPageSnapshot>;
@@ -1,8 +0,0 @@
1
- export * from "./anchor";
2
- export * from "./approvals";
3
- export * from "./block-definition";
4
- export * from "./block";
5
- export * from "./documentation-page-snapshot";
6
- export * from "./link-preview";
7
- export * from "./publish";
8
- export * from "./room";
@@ -1,23 +0,0 @@
1
- import { DocumentationLinkPreview } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTODocumentationLinkPreviewResponse = z.object({
9
- linkPreview: DocumentationLinkPreview,
10
- });
11
-
12
- export type DTODocumentationLinkPreviewResponse = z.infer<typeof DTODocumentationLinkPreviewResponse>;
13
-
14
- //
15
- // Write
16
- //
17
-
18
- export const DTODocumentationLinkPreviewRequest = z.object({
19
- url: z.string().optional(),
20
- documentationItemPersistentId: z.string().optional(),
21
- });
22
-
23
- export type DTODocumentationLinkPreviewRequest = z.infer<typeof DTODocumentationLinkPreviewRequest>;
@@ -1,23 +0,0 @@
1
- import { ExportJobDocumentationChanges, PublishedDocEnvironment } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOExportJob } from "../export";
4
-
5
- export const DTOPublishDocumentationChanges = ExportJobDocumentationChanges;
6
-
7
- export const DTOPublishDocumentationRequest = z.object({
8
- environment: PublishedDocEnvironment,
9
-
10
- /**
11
- * If defined, this allows narrowing down what is published to a set of specific pages and groups
12
- * If undefined, everything will be published.
13
- */
14
- changes: DTOPublishDocumentationChanges.optional(),
15
- });
16
-
17
- export const DTOPublishDocumentationResponse = z.object({
18
- job: DTOExportJob,
19
- });
20
-
21
- export type DTOPublishDocumentationChanges = z.infer<typeof DTOPublishDocumentationChanges>;
22
- export type DTOPublishDocumentationRequest = z.infer<typeof DTOPublishDocumentationRequest>;
23
- export type DTOPublishDocumentationResponse = z.infer<typeof DTOPublishDocumentationResponse>;
@@ -1,12 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTODocumentationPageRoom = z.object({
4
- id: z.string(),
5
- });
6
-
7
- export const DTODocumentationPageRoomResponse = z.object({
8
- room: DTODocumentationPageRoom,
9
- });
10
-
11
- export type DTODocumentationPageRoom = z.infer<typeof DTODocumentationPageRoom>;
12
- export type DTODocumentationPageRoomResponse = z.infer<typeof DTODocumentationPageRoomResponse>;
@@ -1,19 +0,0 @@
1
- import z from "zod";
2
- import { DTOObjectMeta } from "../../aux/meta";
3
-
4
- export const DTOFigmaComponentGroup = z.object({
5
- id: z.string(),
6
- designSystemVersionId: z.string(),
7
- persistentId: z.string(),
8
- isRoot: z.boolean(),
9
- brandId: z.string(),
10
- meta: DTOObjectMeta,
11
- childrenIds: z.string().array(),
12
- });
13
-
14
- export const DTOFigmaComponentGroupListResponse = z.object({
15
- groups: DTOFigmaComponentGroup.array(),
16
- });
17
-
18
- export type DTOFigmaComponentGroup = z.infer<typeof DTOFigmaComponentGroup>;
19
- export type DTOFigmaComponentGroupListResponse = z.infer<typeof DTOFigmaComponentGroupListResponse>;
@@ -1,56 +0,0 @@
1
- import {
2
- FigmaComponentBooleanProperty,
3
- FigmaComponentInstanceSwapProperty,
4
- FigmaComponentOrigin,
5
- FigmaComponentProperty,
6
- FigmaComponentTextProperty,
7
- FigmaComponentVariantProperty,
8
- ObjectMeta,
9
- } from "@supernova-studio/model";
10
- import { z } from "zod";
11
-
12
- const DTOFigmaComponentBooleanProperty = FigmaComponentBooleanProperty;
13
- const DTOFigmaComponentInstanceSwapProperty = FigmaComponentInstanceSwapProperty;
14
- const DTOFigmaComponentTextProperty = FigmaComponentTextProperty;
15
- const DTOFigmaComponentVariantProperty = FigmaComponentVariantProperty;
16
- const DTOFigmaComponentProperty = FigmaComponentProperty;
17
- const DTOFigmaComponentPropertyMap = z.record(DTOFigmaComponentProperty);
18
-
19
- export const DTOFigmaComponent = z.object({
20
- id: z.string(),
21
- persistentId: z.string(),
22
- designSystemVersionId: z.string(),
23
- brandId: z.string(),
24
- thumbnailUrl: z.string().optional(),
25
- svgUrl: z.string().optional(),
26
-
27
- exportProperties: z.object({
28
- isAsset: z.boolean(),
29
- }),
30
-
31
- createdAt: z.coerce.date(),
32
- updatedAt: z.coerce.date(),
33
-
34
- meta: ObjectMeta,
35
- originComponent: FigmaComponentOrigin.optional(),
36
-
37
- parentComponentPersistentId: z.string().optional(),
38
- childrenPersistentIds: z.string().array().optional(),
39
-
40
- componentPropertyDefinitions: DTOFigmaComponentPropertyMap.optional(),
41
- variantPropertyValues: z.record(z.string()).optional(),
42
- });
43
-
44
- export const DTOFigmaComponentListResponse = z.object({
45
- components: DTOFigmaComponent.array(),
46
- });
47
-
48
- export type DTOFigmaComponentBooleanProperty = z.infer<typeof DTOFigmaComponentBooleanProperty>;
49
- export type DTOFigmaComponentInstanceSwapProperty = z.infer<typeof DTOFigmaComponentInstanceSwapProperty>;
50
- export type DTOFigmaComponentTextProperty = z.infer<typeof DTOFigmaComponentTextProperty>;
51
- export type DTOFigmaComponentVariantProperty = z.infer<typeof DTOFigmaComponentVariantProperty>;
52
- export type DTOFigmaComponentProperty = z.infer<typeof DTOFigmaComponentProperty>;
53
- export type DTOFigmaComponentPropertyMap = z.infer<typeof DTOFigmaComponentPropertyMap>;
54
-
55
- export type DTOFigmaComponent = z.infer<typeof DTOFigmaComponent>;
56
- export type DTOFigmaComponentListResponse = z.infer<typeof DTOFigmaComponentListResponse>;
@@ -1,2 +0,0 @@
1
- export * from "./figma-component-group";
2
- export * from "./figma-component";
@@ -1,37 +0,0 @@
1
- import { z } from "zod";
2
- import { DTODocumentationItemConfigurationV2 } from "./item-configuration-v2";
3
-
4
- export const DTODocumentationDraftChangeType = z.enum(["Created", "Updated", "Deleted"]);
5
-
6
- export const DTODocumentationDraftStateCreated = z.object({
7
- changeType: z.literal(DTODocumentationDraftChangeType.enum.Created),
8
- });
9
-
10
- export const DTODocumentationDraftStateUpdated = z.object({
11
- changeType: z.literal(DTODocumentationDraftChangeType.enum.Updated),
12
- changes: z.object({
13
- previousTitle: z.string().optional(),
14
- previousConfiguration: DTODocumentationItemConfigurationV2.optional(),
15
- previousContentHash: z.string().optional(),
16
- }),
17
- });
18
-
19
- export const DTODocumentationDraftStateDeleted = z.object({
20
- changeType: z.literal(DTODocumentationDraftChangeType.enum.Deleted),
21
- deletedAt: z.coerce.date(),
22
- deletedByUserId: z.string(),
23
- });
24
-
25
- export const DTODocumentationDraftState = z.discriminatedUnion("changeType", [
26
- DTODocumentationDraftStateCreated,
27
- DTODocumentationDraftStateUpdated,
28
- DTODocumentationDraftStateDeleted,
29
- ]);
30
-
31
- export type DTODocumentationDraftChangeType = z.infer<typeof DTODocumentationDraftChangeType>;
32
-
33
- export type DTODocumentationDraftStateCreated = z.infer<typeof DTODocumentationDraftStateCreated>;
34
- export type DTODocumentationDraftStateUpdated = z.infer<typeof DTODocumentationDraftStateUpdated>;
35
- export type DTODocumentationDraftStateDeleted = z.infer<typeof DTODocumentationDraftStateDeleted>;
36
-
37
- export type DTODocumentationDraftState = z.infer<typeof DTODocumentationDraftState>;
@@ -1,108 +0,0 @@
1
- import { z } from "zod";
2
- import {
3
- DTOCreateDocumentationGroupInput,
4
- DTOCreateDocumentationTabInput,
5
- DTODeleteDocumentationGroupInput,
6
- DTODeleteDocumentationTabGroupInput,
7
- DTODuplicateDocumentationGroupInput,
8
- DTOMoveDocumentationGroupInput,
9
- DTOUpdateDocumentationGroupInput,
10
- } from "./group-v2";
11
-
12
- //
13
- // Read
14
- //
15
-
16
- const SuccessPayload = z.object({
17
- success: z.literal(true),
18
- });
19
-
20
- export const DTODocumentationGroupCreateActionOutputV2 = z.object({
21
- type: z.literal("DocumentationGroupCreate"),
22
- output: SuccessPayload,
23
- });
24
-
25
- export const DTODocumentationTabCreateActionOutputV2 = z.object({
26
- type: z.literal("DocumentationTabCreate"),
27
- output: SuccessPayload,
28
- });
29
-
30
- export const DTODocumentationGroupUpdateActionOutputV2 = z.object({
31
- type: z.literal("DocumentationGroupUpdate"),
32
- output: SuccessPayload,
33
- });
34
-
35
- export const DTODocumentationGroupMoveActionOutputV2 = z.object({
36
- type: z.literal("DocumentationGroupMove"),
37
- output: SuccessPayload,
38
- });
39
-
40
- export const DTODocumentationGroupDuplicateActionOutputV2 = z.object({
41
- type: z.literal("DocumentationGroupDuplicate"),
42
- output: SuccessPayload,
43
- });
44
-
45
- export const DTODocumentationGroupDeleteActionOutputV2 = z.object({
46
- type: z.literal("DocumentationGroupDelete"),
47
- output: SuccessPayload,
48
- });
49
-
50
- export const DTODocumentationTabGroupDeleteActionOutputV2 = z.object({
51
- type: z.literal("DocumentationTabGroupDelete"),
52
- output: SuccessPayload,
53
- });
54
-
55
- export type DTODocumentationGroupCreateActionOutputV2 = z.infer<typeof DTODocumentationGroupCreateActionOutputV2>;
56
- export type DTODocumentationTabCreateActionOutputV2 = z.infer<typeof DTODocumentationTabCreateActionOutputV2>;
57
- export type DTODocumentationGroupUpdateActionOutputV2 = z.infer<typeof DTODocumentationGroupUpdateActionOutputV2>;
58
- export type DTODocumentationGroupMoveActionOutputV2 = z.infer<typeof DTODocumentationGroupMoveActionOutputV2>;
59
- export type DTODocumentationGroupDuplicateActionOutputV2 = z.infer<typeof DTODocumentationGroupDuplicateActionOutputV2>;
60
- export type DTODocumentationGroupDeleteActionOutputV2 = z.infer<typeof DTODocumentationGroupDeleteActionOutputV2>;
61
- export type DTODocumentationTabGroupDeleteActionOutputV2 = z.infer<typeof DTODocumentationTabGroupDeleteActionOutputV2>;
62
-
63
- //
64
- // Write
65
- //
66
-
67
- export const DTODocumentationGroupCreateActionInputV2 = z.object({
68
- type: z.literal("DocumentationGroupCreate"),
69
- input: DTOCreateDocumentationGroupInput,
70
- });
71
-
72
- export const DTODocumentationTabCreateActionInputV2 = z.object({
73
- type: z.literal("DocumentationTabCreate"),
74
- input: DTOCreateDocumentationTabInput,
75
- });
76
-
77
- export const DTODocumentationGroupUpdateActionInputV2 = z.object({
78
- type: z.literal("DocumentationGroupUpdate"),
79
- input: DTOUpdateDocumentationGroupInput,
80
- });
81
-
82
- export const DTODocumentationGroupMoveActionInputV2 = z.object({
83
- type: z.literal("DocumentationGroupMove"),
84
- input: DTOMoveDocumentationGroupInput,
85
- });
86
-
87
- export const DTODocumentationGroupDuplicateActionInputV2 = z.object({
88
- type: z.literal("DocumentationGroupDuplicate"),
89
- input: DTODuplicateDocumentationGroupInput,
90
- });
91
-
92
- export const DTODocumentationGroupDeleteActionInputV2 = z.object({
93
- type: z.literal("DocumentationGroupDelete"),
94
- input: DTODeleteDocumentationGroupInput,
95
- });
96
-
97
- export const DTODocumentationTabGroupDeleteActionInputV2 = z.object({
98
- type: z.literal("DocumentationTabGroupDelete"),
99
- input: DTODeleteDocumentationTabGroupInput,
100
- });
101
-
102
- export type DTODocumentationGroupCreateActionInputV2 = z.infer<typeof DTODocumentationGroupCreateActionInputV2>;
103
- export type DTODocumentationTabGroupCreateActionInputV2 = z.infer<typeof DTODocumentationTabCreateActionInputV2>;
104
- export type DTODocumentationGroupUpdateActionInputV2 = z.infer<typeof DTODocumentationGroupUpdateActionInputV2>;
105
- export type DTODocumentationGroupMoveActionInputV2 = z.infer<typeof DTODocumentationGroupMoveActionInputV2>;
106
- export type DTODocumentationGroupDuplicateActionInputV2 = z.infer<typeof DTODocumentationGroupDuplicateActionInputV2>;
107
- export type DTODocumentationGroupDeleteActionInputV2 = z.infer<typeof DTODocumentationGroupDeleteActionInputV2>;
108
- export type DTODocumentationTabGroupDeleteActionInputV2 = z.infer<typeof DTODocumentationTabGroupDeleteActionInputV2>;