@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,87 +0,0 @@
1
- import {
2
- nullishToOptional,
3
- PulsarContributionConfigurationProperty,
4
- PulsarContributionVariant,
5
- PulsarCustomBlock,
6
- } from "@supernova-studio/model";
7
- import { z } from "zod";
8
- import { DTOExporterPropertyDefinition } from "./exporter-property";
9
-
10
- //
11
- // Read
12
- //
13
-
14
- export const DTOExporterType = z.enum(["documentation", "code"]);
15
- export const DTOExporterSource = z.enum(["git", "upload"]);
16
- export const DTOExporterMembershipRole = z.enum(["Owner", "OwnerArchived", "User"]);
17
-
18
- export const DTOExporterListQuery = z.object({
19
- limit: z.coerce.number().optional(),
20
- });
21
-
22
- export const DTOExporter = z.object({
23
- id: z.string(),
24
- name: z.string(),
25
- isPrivate: z.boolean(),
26
- exporterType: DTOExporterType,
27
- isDefaultDocumentationExporter: z.boolean(),
28
-
29
- iconURL: z.string().optional(),
30
- configurationProperties: PulsarContributionConfigurationProperty.array(),
31
- properties: DTOExporterPropertyDefinition.array().optional(),
32
- customBlocks: PulsarCustomBlock.array(),
33
- blockVariants: z.record(z.string(), PulsarContributionVariant.array()),
34
-
35
- usesBrands: z.boolean(),
36
- usesThemes: z.boolean(),
37
-
38
- source: DTOExporterSource,
39
-
40
- gitUrl: nullishToOptional(z.string()),
41
- gitBranch: nullishToOptional(z.string()),
42
- gitDirectory: nullishToOptional(z.string()),
43
- });
44
-
45
- export const DTOExporterMembership = z.object({
46
- workspaceId: z.string(),
47
- exporterId: z.string(),
48
- role: DTOExporterMembershipRole,
49
- });
50
-
51
- export const DTOExporterResponse = z.object({
52
- exporter: DTOExporter,
53
- membership: DTOExporterMembership,
54
- });
55
-
56
- export const DTOExporterListResponse = z.object({
57
- exporters: DTOExporter.array(),
58
- membership: DTOExporterMembership.array(),
59
- });
60
-
61
- export type DTOExporterListQuery = z.infer<typeof DTOExporterListQuery>;
62
- export type DTOExporterType = z.infer<typeof DTOExporterType>;
63
- export type DTOExporterSource = z.infer<typeof DTOExporterSource>;
64
- export type DTOExporterMembershipRole = z.infer<typeof DTOExporterMembershipRole>;
65
- export type DTOExporter = z.infer<typeof DTOExporter>;
66
- export type DTOExporterMembership = z.infer<typeof DTOExporterMembership>;
67
- export type DTOExporterResponse = z.infer<typeof DTOExporterResponse>;
68
- export type DTOExporterListResponse = z.infer<typeof DTOExporterListResponse>;
69
-
70
- //
71
- // Write
72
- //
73
-
74
- export const DTOExporterGitProviderEnum = z.enum(["github", "gitlab", "bitbucket", "azure"]);
75
-
76
- export const DTOExporterCreateInput = z.object({
77
- url: z.string(),
78
- provider: DTOExporterGitProviderEnum,
79
- });
80
-
81
- export const DTOExporterUpdateInput = z.object({
82
- url: z.string().optional(),
83
- });
84
-
85
- export type DTOExporterGitProviderEnum = z.infer<typeof DTOExporterGitProviderEnum>;
86
- export type DTOExporterCreateInput = z.infer<typeof DTOExporterCreateInput>;
87
- export type DTOExporterUpdateInput = z.infer<typeof DTOExporterUpdateInput>;
@@ -1,6 +0,0 @@
1
- import { ExportJobFindByFilter } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTOExportJobsListFilter = ExportJobFindByFilter;
5
-
6
- export type DTOExportJobsListFilter = z.infer<typeof DTOExportJobsListFilter>;
@@ -1,5 +0,0 @@
1
- export * from "./exporter-property";
2
- export * from "./exporter";
3
- export * from "./filter";
4
- export * from "./job";
5
- export * from "./pipeline";
@@ -1,96 +0,0 @@
1
- import {
2
- ExportJobDocsDestinationResult,
3
- ExportJobResult,
4
- ExportJobStatus,
5
- ExporterDestinationAzure,
6
- ExporterDestinationBitbucket,
7
- ExporterDestinationDocs,
8
- ExporterDestinationGithub,
9
- ExporterDestinationGitlab,
10
- ExporterDestinationS3,
11
- ObjectMeta,
12
- } from "@supernova-studio/model";
13
- import { z } from "zod";
14
- import { DTOExporterPropertyDefinitionValueMap } from "./exporter-property";
15
-
16
- export const DTOExportJobCreatedBy = z.object({
17
- userId: z.string(),
18
- userName: z.string(),
19
- });
20
-
21
- export const DTOExportJobDesignSystemPreview = z.object({
22
- id: z.string(),
23
- meta: ObjectMeta,
24
- });
25
-
26
- export const DTOExportJobDesignSystemVersionPreview = z.object({
27
- id: z.string(),
28
- meta: ObjectMeta,
29
- version: z.string(),
30
- isReadonly: z.boolean(),
31
- });
32
-
33
- export const DTOExportJobDestinations = z.object({
34
- s3: ExporterDestinationS3.optional(),
35
- azure: ExporterDestinationAzure.optional(),
36
- bitbucket: ExporterDestinationBitbucket.optional(),
37
- github: ExporterDestinationGithub.optional(),
38
- gitlab: ExporterDestinationGitlab.optional(),
39
- documentation: ExporterDestinationDocs.optional(),
40
- webhookUrl: z.string().optional(),
41
- });
42
-
43
- export const DTOExportJobResult = ExportJobResult.omit({
44
- sndocs: true,
45
- }).extend({
46
- documentation: ExportJobDocsDestinationResult.optional(),
47
- });
48
-
49
- export const DTOExportJob = z.object({
50
- id: z.string(),
51
-
52
- createdAt: z.coerce.date(),
53
- finishedAt: z.coerce.date().optional(),
54
-
55
- index: z.number().optional(),
56
- status: ExportJobStatus,
57
- estimatedExecutionTime: z.number().optional(),
58
-
59
- createdBy: DTOExportJobCreatedBy.optional(),
60
- designSystem: DTOExportJobDesignSystemPreview,
61
- designSystemVersion: DTOExportJobDesignSystemVersionPreview,
62
-
63
- destinations: DTOExportJobDestinations,
64
-
65
- exporterId: z.string(),
66
- scheduleId: z.string().optional(),
67
-
68
- result: DTOExportJobResult.optional(),
69
-
70
- brandPersistentId: z.string().optional(),
71
- themePersistentId: z.string().optional(),
72
- themePersistentIds: z.string().array().optional(),
73
-
74
- exporterConfigurationProperties: DTOExporterPropertyDefinitionValueMap.optional(),
75
- });
76
-
77
- export const DTOExportJobResponse = z.object({
78
- job: DTOExportJob,
79
- });
80
-
81
- // Deprecated: Use only for test purposes and extend if only necessary. This defines the BE response for an export job.
82
- export const DTOExportJobResponseLegacy = z.object({
83
- job: z.object({
84
- id: z.string(),
85
- status: ExportJobStatus,
86
- }),
87
- });
88
-
89
- export type DTOExportJobResponseLegacy = z.infer<typeof DTOExportJobResponseLegacy>;
90
- export type DTOExportJobCreatedBy = z.infer<typeof DTOExportJobCreatedBy>;
91
- export type DTOExportJobDesignSystemPreview = z.infer<typeof DTOExportJobDesignSystemPreview>;
92
- export type DTOExportJobDesignSystemVersionPreview = z.infer<typeof DTOExportJobDesignSystemVersionPreview>;
93
- export type DTOExportJobDestinations = z.infer<typeof DTOExportJobDestinations>;
94
- export type DTOExportJobResult = z.infer<typeof DTOExportJobResult>;
95
- export type DTOExportJob = z.infer<typeof DTOExportJob>;
96
- export type DTOExportJobResponse = z.infer<typeof DTOExportJobResponse>;
@@ -1,43 +0,0 @@
1
- import { ExportDestinationsMap, PipelineEventType } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOExporterPropertyDefinitionValueMap } from "./exporter-property";
4
- import { DTOExportJob } from "./job";
5
-
6
- export const DTOPipelineListQuery = z.object({
7
- designSystemId: z.string().optional(),
8
- exporterId: z.string().optional(),
9
- latestJobsLimit: z.coerce.number().optional(),
10
- });
11
-
12
- export const DTOPipeline = z.object({
13
- id: z.string(),
14
- name: z.string(),
15
- eventType: PipelineEventType,
16
- isEnabled: z.boolean(),
17
- workspaceId: z.string(),
18
- designSystemId: z.string(),
19
- exporterId: z.string(),
20
- brandPersistentId: z.string().optional(),
21
-
22
- themePersistentId: z.string().optional(),
23
- themePersistentIds: z.string().array().optional(),
24
-
25
- exporterConfigurationProperties: DTOExporterPropertyDefinitionValueMap.optional(),
26
-
27
- ...ExportDestinationsMap.shape,
28
-
29
- latestJobs: DTOExportJob.array(),
30
- });
31
-
32
- export const DTOPipelineListResponse = z.object({
33
- pipelines: DTOPipeline.array(),
34
- });
35
-
36
- export const DTOPipelineResponse = z.object({
37
- pipeline: DTOPipeline,
38
- });
39
-
40
- export type DTOPipelineListQuery = z.infer<typeof DTOPipelineListQuery>;
41
- export type DTOPipeline = z.infer<typeof DTOPipeline>;
42
- export type DTOPipelineResponse = z.infer<typeof DTOPipelineResponse>;
43
- export type DTOPipelineListResponse = z.infer<typeof DTOPipelineListResponse>;
@@ -1,30 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOAssetRenderConfiguration = z.object({
4
- prefix: z.string().optional(),
5
- suffix: z.string().optional(),
6
- scale: z.enum(["x1", "x2", "x3", "x4"]),
7
- format: z.enum(["png", "pdf", "svg"]),
8
- });
9
-
10
- export const DTORenderedAssetFile = z.object({
11
- assetId: z.string(),
12
- fileName: z.string(),
13
- sourceUrl: z.string(),
14
- settings: DTOAssetRenderConfiguration,
15
- originalName: z.string(),
16
- });
17
-
18
- export const DTODownloadAssetsRequest = z.object({
19
- persistentIds: z.array(z.string().uuid()).optional(),
20
- settings: DTOAssetRenderConfiguration.array(),
21
- });
22
-
23
- export const DTODownloadAssetsResponse = z.object({
24
- items: DTORenderedAssetFile.array(),
25
- });
26
-
27
- export type DTOAssetRenderConfiguration = z.infer<typeof DTOAssetRenderConfiguration>;
28
- export type DTORenderedAssetFile = z.infer<typeof DTORenderedAssetFile>;
29
- export type DTODownloadAssetsRequest = z.infer<typeof DTODownloadAssetsRequest>;
30
- export type DTODownloadAssetsResponse = z.infer<typeof DTODownloadAssetsResponse>;
@@ -1 +0,0 @@
1
- export * from "./download";
@@ -1 +0,0 @@
1
- export * from "./assets";
@@ -1,13 +0,0 @@
1
- export * from "./aux";
2
- export * from "./bff";
3
- export * from "./collections";
4
- export * from "./design-systems";
5
- export * from "./design-tokens";
6
- export * from "./documentation";
7
- export * from "./elements";
8
- export * from "./export";
9
- export * from "./figma-components";
10
- export * from "./liveblocks";
11
- export * from "./themes";
12
- export * from "./users";
13
- export * from "./workspaces";
@@ -1,7 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOLiveblocksAuthResponse = z.object({
4
- token: z.string(),
5
- })
6
-
7
- export type DTOLiveblocksAuthResponse = z.infer<typeof DTOLiveblocksAuthResponse>;
@@ -1 +0,0 @@
1
- export * from "./auth-response";
@@ -1,2 +0,0 @@
1
- export * from "./override";
2
- export * from "./theme";
@@ -1,27 +0,0 @@
1
- import { DesignTokenTypedData, ThemeOverrideOrigin } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTOThemeOverride = DesignTokenTypedData.and(
9
- z.object({
10
- tokenPersistentId: z.string(),
11
- origin: ThemeOverrideOrigin.optional(),
12
- })
13
- );
14
-
15
- export type DTOThemeOverride = z.infer<typeof DTOThemeOverride>;
16
-
17
- //
18
- // Write
19
- //
20
-
21
- export const DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(
22
- z.object({
23
- tokenPersistentId: z.string(),
24
- })
25
- );
26
-
27
- export type DTOThemeOverrideCreatePayload = z.infer<typeof DTOThemeOverrideCreatePayload>;
@@ -1,45 +0,0 @@
1
- import { ObjectMeta } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOThemeOverride } from "./override";
4
-
5
- //
6
- // Read
7
- //
8
-
9
- export const DTOTheme = z.object({
10
- id: z.string(),
11
- persistentId: z.string(),
12
- designSystemVersionId: z.string(),
13
- brandId: z.string(),
14
-
15
- meta: ObjectMeta,
16
- codeName: z.string(),
17
-
18
- overrides: DTOThemeOverride.array(),
19
- });
20
-
21
- export const DTOThemeResponse = z.object({
22
- theme: DTOTheme,
23
- });
24
-
25
- export const DTOThemeListResponse = z.object({
26
- themes: DTOTheme.array(),
27
- });
28
-
29
- export type DTOTheme = z.infer<typeof DTOTheme>;
30
- export type DTOThemeResponse = z.infer<typeof DTOThemeResponse>;
31
- export type DTOThemeListResponse = z.infer<typeof DTOThemeListResponse>;
32
-
33
- //
34
- // Write
35
- //
36
-
37
- export const DTOThemeCreatePayload = z.object({
38
- meta: ObjectMeta,
39
- persistentId: z.string(),
40
- brandId: z.string(),
41
- codeName: z.string(),
42
- overrides: DTOThemeOverride.array(),
43
- });
44
-
45
- export type DTOThemeCreatePayload = z.infer<typeof DTOThemeCreatePayload>;
@@ -1,46 +0,0 @@
1
- import { UserOnboardingDepartment, UserOnboardingJobLevel, UserSource, UserTheme } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOUser, DTOUserProfile } from "./user";
4
-
5
- export const DTOUserOnboardingDepartment = UserOnboardingDepartment;
6
- export const DTOUserOnboardingJobLevel = UserOnboardingJobLevel;
7
- export const DTOUserSource = UserSource;
8
- export const DTOUserTheme = UserTheme;
9
-
10
- export const DTOUserOnboarding = z.object({
11
- companyName: z.string().optional(),
12
- numberOfPeopleInOrg: z.string().optional(),
13
- numberOfPeopleInDesignTeam: z.string().optional(),
14
- department: DTOUserOnboardingDepartment.optional(),
15
- jobTitle: z.string().optional(),
16
- phase: z.string().optional(),
17
- jobLevel: DTOUserOnboardingJobLevel.optional(),
18
- designSystemName: z.string().optional(),
19
- defaultDestination: z.string().optional(),
20
- isPageDraftOnboardingFinished: z.boolean().optional(),
21
- });
22
-
23
- export const DTOAuthenticatedUserProfile = DTOUserProfile.extend({
24
- onboarding: DTOUserOnboarding.optional(),
25
- theme: DTOUserTheme.optional(),
26
- });
27
-
28
- export const DTOAuthenticatedUser = DTOUser.extend({
29
- profile: DTOAuthenticatedUserProfile,
30
- createdAt: z.coerce.date(),
31
- loggedOutAt: z.coerce.date().optional(),
32
- source: DTOUserSource.optional(),
33
- });
34
-
35
- export const DTOAuthenticatedUserResponse = z.object({
36
- user: DTOAuthenticatedUser,
37
- });
38
-
39
- export type DTOUserOnboardingDepartment = z.infer<typeof DTOUserOnboardingDepartment>;
40
- export type DTOUserOnboardingJobLevel = z.infer<typeof DTOUserOnboardingJobLevel>;
41
- export type DTOUserSource = z.infer<typeof DTOUserSource>;
42
- export type DTOUserTheme = z.infer<typeof DTOUserTheme>;
43
- export type DTOUserOnboarding = z.infer<typeof DTOUserOnboarding>;
44
- export type DTOAuthenticatedUserProfile = z.infer<typeof DTOAuthenticatedUserProfile>;
45
- export type DTOAuthenticatedUser = z.infer<typeof DTOAuthenticatedUser>;
46
- export type DTOAuthenticatedUserResponse = z.infer<typeof DTOAuthenticatedUserResponse>;
@@ -1,3 +0,0 @@
1
- export * from "./authenticated-user";
2
- export * from "./update";
3
- export * from "./user";
@@ -1,8 +0,0 @@
1
- import { User } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTOUserProfileUpdateResponse = z.object({
5
- user: User,
6
- });
7
-
8
- export type DTOUserProfileUpdateResponse = z.infer<typeof DTOUserProfileUpdateResponse>;
@@ -1,31 +0,0 @@
1
- import { UserProfileUpdate } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- /**
5
- * Definition of a user profile as inspectable by other users (i.e. reduced version)
6
- */
7
- export const DTOUserProfile = z.object({
8
- name: z.string(),
9
- nickname: z.string().optional(),
10
- avatar: z.string().optional(),
11
- });
12
-
13
- /**
14
- * Definition of a user as inspectable by other users (i.e. reduced version)
15
- */
16
- export const DTOUser = z.object({
17
- id: z.string(),
18
- email: z.string(),
19
- profile: DTOUserProfile,
20
- });
21
-
22
- export const DTOUserGetResponse = z.object({
23
- user: DTOUser,
24
- });
25
-
26
- export const DTOUserProfileUpdate = UserProfileUpdate;
27
-
28
- export type DTOUserProfile = z.infer<typeof DTOUserProfile>;
29
- export type DTOUser = z.infer<typeof DTOUser>;
30
- export type DTOUserGetResponse = z.infer<typeof DTOUserGetResponse>;
31
- export type DTOUserProfileUpdate = z.infer<typeof DTOUserProfileUpdate>;
@@ -1,32 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOGitOrganization = z.object({
4
- id: z.string(),
5
- name: z.string(),
6
- url: z.string(),
7
- slug: z.string(),
8
- });
9
- export type DTOGitOrganization = z.infer<typeof DTOGitOrganization>;
10
-
11
- export const DTOGitProject = z.object({
12
- id: z.string(),
13
- name: z.string(),
14
- url: z.string(),
15
- slug: z.string(),
16
- });
17
- export type DTOGitProject = z.infer<typeof DTOGitProject>;
18
-
19
- export const DTOGitRepository = z.object({
20
- id: z.string(),
21
- name: z.string(),
22
- url: z.string(),
23
- slug: z.string(),
24
- defaultBranch: z.string().optional(),
25
- });
26
- export type DTOGitRepository = z.infer<typeof DTOGitRepository>;
27
-
28
- export const DTOGitBranch = z.object({
29
- name: z.string(),
30
- lastCommitId: z.string(),
31
- });
32
- export type DTOGitBranch = z.infer<typeof DTOGitBranch>;
@@ -1,6 +0,0 @@
1
- export * from "./git";
2
- export * from "./integrations";
3
- export * from "./invitations";
4
- export * from "./membership";
5
- export * from "./npm-registry";
6
- export * from "./workspace";
@@ -1,34 +0,0 @@
1
- import { ExtendedIntegrationType, IntegrationCredentials, IntegrationDesignSystem } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTOIntegrationCredentials = IntegrationCredentials.omit({
5
- accessToken: true,
6
- refreshToken: true,
7
- });
8
-
9
- export const DTOIntegration = z.object({
10
- id: z.string(),
11
- workspaceId: z.string(),
12
- type: ExtendedIntegrationType,
13
- createdAt: z.coerce.date(),
14
- integrationCredentials: z.array(DTOIntegrationCredentials).optional(),
15
- integrationDesignSystems: z.array(IntegrationDesignSystem).optional(),
16
- });
17
-
18
- export const DTOIntegrationOAuthGetResponse = z.object({
19
- url: z.string(),
20
- });
21
-
22
- export const DTOIntegrationPostResponse = z.object({
23
- integration: DTOIntegration,
24
- });
25
-
26
- export const DTOIntegrationsGetListResponse = z.object({
27
- integrations: DTOIntegration.array(),
28
- });
29
-
30
- export type DTOIntegration = z.infer<typeof DTOIntegration>;
31
- export type DTOIntegrationCredentials = z.infer<typeof DTOIntegrationCredentials>;
32
- export type DTOIntegrationOAuthGetResponse = z.infer<typeof DTOIntegrationOAuthGetResponse>;
33
- export type DTOIntegrationPostResponse = z.infer<typeof DTOIntegrationPostResponse>;
34
- export type DTOIntegrationsGetListResponse = z.infer<typeof DTOIntegrationsGetListResponse>;
@@ -1,30 +0,0 @@
1
- import { WorkspaceInvitation, WorkspaceRoleSchema } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTOWorkspaceInvitationInput = z.object({
5
- email: z.string().email(),
6
- role: WorkspaceRoleSchema,
7
- });
8
-
9
- export const DTOWorkspaceInvitationsListInput = z.object({
10
- invites: DTOWorkspaceInvitationInput.array().max(100),
11
- designSystemId: z.string().optional(),
12
- });
13
-
14
- export const DTOWorkspaceInvitationsResponse = z.object({
15
- invitations: WorkspaceInvitation.array(),
16
- });
17
-
18
- export const DTOWorkspaceInviteUpdate = z.object({
19
- role: WorkspaceRoleSchema,
20
- });
21
-
22
- export const DTOWorkspaceInvitationUpdateResponse = z.object({
23
- invitation: WorkspaceInvitation,
24
- });
25
-
26
- export type DTOWorkspaceInvitationInput = z.infer<typeof DTOWorkspaceInvitationInput>;
27
- export type DTOWorkspaceInvitationsListInput = z.infer<typeof DTOWorkspaceInvitationsListInput>;
28
- export type DTOWorkspaceInvitationsResponse = z.infer<typeof DTOWorkspaceInvitationsResponse>;
29
- export type DTOWorkspaceInviteUpdate = z.infer<typeof DTOWorkspaceInviteUpdate>;
30
- export type DTOWorkspaceInvitationUpdateResponse = z.infer<typeof DTOWorkspaceInvitationUpdateResponse>;
@@ -1,41 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOWorkspace } from "./workspace";
3
- import { User, WorkspaceRoleSchema } from "@supernova-studio/model";
4
-
5
- //
6
- // Read
7
- //
8
-
9
- export const DTOWorkspaceRole = z.enum(["Owner", "Admin", "Creator", "Viewer", "Billing", "Contributor"]);
10
-
11
- export const DTOUserWorkspaceMembership = z.object({
12
- // Workspace the user is a member of
13
- workspace: DTOWorkspace,
14
-
15
- // Assigned role the user has in the workspace
16
- role: DTOWorkspaceRole,
17
-
18
- // Role that determines actual permissions the user has in the workspace
19
- // E.g. this is different from the default role when editors are downgraded to viewers
20
- // when a workspace's subscription is downgraded to free tier
21
- effectiveRole: DTOWorkspaceRole,
22
- });
23
-
24
- export const DTOWorkspaceMember = z.object({
25
- user: User,
26
- role: WorkspaceRoleSchema,
27
- effectiveRole: WorkspaceRoleSchema,
28
- });
29
-
30
- export const DTOUserWorkspaceMembershipsResponse = z.object({
31
- membership: z.array(DTOUserWorkspaceMembership),
32
- });
33
-
34
- export const DTOWorkspaceMembersListResponse = z.object({
35
- members: z.array(DTOWorkspaceMember),
36
- });
37
-
38
- export type DTOWorkspaceRole = z.infer<typeof DTOWorkspaceRole>;
39
- export type DTOUserWorkspaceMembership = z.infer<typeof DTOUserWorkspaceMembership>;
40
- export type DTOUserWorkspaceMembershipsResponse = z.infer<typeof DTOUserWorkspaceMembershipsResponse>;
41
- export type DTOWorkspaceMembersListResponse = z.infer<typeof DTOWorkspaceMembersListResponse>;
@@ -1,35 +0,0 @@
1
- import { NpmRegistryAuthType, NpmRegistryType } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTONpmRegistryConfigConstants = {
9
- passwordPlaceholder: "redacted",
10
- };
11
-
12
- export const DTONpmRegistryConfig = z.object({
13
- // Registry basic configuration
14
- registryType: NpmRegistryType,
15
- registryUrl: z.string(),
16
- customRegistryUrl: z.string().optional(),
17
-
18
- // URL of Supernova NPM packages proxy
19
- proxyUrl: z.string(),
20
-
21
- // Auth configuration
22
- authType: NpmRegistryAuthType,
23
- accessToken: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),
24
- username: z.string().optional(),
25
- password: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),
26
-
27
- // NPM package scopes for whih the proxy should be enabled
28
- enabledScopes: z.array(z.string()),
29
-
30
- // True if client should bypass Supernova proxy and connect directly to the registry
31
- // (e.g. when the NPM registry is behind a VPN or firewall which prevents Supernova from accessing it)
32
- bypassProxy: z.boolean(),
33
- });
34
-
35
- export type DTONpmRegistryConfig = z.infer<typeof DTONpmRegistryConfig>;