@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,37 +0,0 @@
1
- import { GitBranch, GitOrganization, GitProject, GitRepository } from "@supernova-studio/model";
2
- import { DTOGitBranch, DTOGitOrganization, DTOGitProject, DTOGitRepository } from "../../dto";
3
-
4
- export function gitOrganizationToDto(org: GitOrganization): DTOGitOrganization {
5
- return {
6
- id: org.id,
7
- name: org.name,
8
- url: org.url,
9
- slug: org.slug,
10
- };
11
- }
12
-
13
- export function gitProjectToDto(project: GitProject): DTOGitProject {
14
- return {
15
- id: project.id,
16
- name: project.name,
17
- url: project.url,
18
- slug: project.slug,
19
- };
20
- }
21
-
22
- export function gitRepositoryToDto(repo: GitRepository): DTOGitRepository {
23
- return {
24
- id: repo.id,
25
- name: repo.name,
26
- url: repo.url,
27
- slug: repo.slug,
28
- defaultBranch: repo.defaultBranch,
29
- };
30
- }
31
-
32
- export function gitBranchToDto(branch: GitBranch): DTOGitBranch {
33
- return {
34
- name: branch.name,
35
- lastCommitId: branch.lastCommitId,
36
- };
37
- }
@@ -1,2 +0,0 @@
1
- export * from "./git";
2
- export * from "./integration";
@@ -1,37 +0,0 @@
1
- import { ExtendedIntegration, IntegrationCredentials } from "@supernova-studio/model";
2
- import { DTOIntegration, DTOIntegrationCredentials } from "../../dto";
3
-
4
- export function integrationToDto(integration: ExtendedIntegration): DTOIntegration {
5
- return {
6
- id: integration.id,
7
- workspaceId: integration.workspaceId,
8
- type: integration.type,
9
- createdAt: integration.createdAt,
10
- integrationCredentials: integration.integrationCredentials?.map(integrationCredentialToDto),
11
- integrationDesignSystems: integration.integrationDesignSystems ?? undefined,
12
- };
13
- }
14
-
15
- export function integrationCredentialToDto(credential: IntegrationCredentials): DTOIntegrationCredentials {
16
- return {
17
- id: credential.id,
18
-
19
- createdAt: credential.createdAt,
20
- refreshedAt: credential.refreshedAt,
21
- expiresAt: credential.expiresAt,
22
-
23
- integrationId: credential.integrationId,
24
- type: credential.type,
25
-
26
- userId: credential.userId,
27
- user: credential.user,
28
-
29
- customUrl: credential.customUrl,
30
-
31
- profile: credential.profile,
32
- tokenName: credential.tokenName,
33
- username: credential.username,
34
- appInstallationId: credential.appInstallationId,
35
- state: credential.state,
36
- };
37
- }
@@ -1,7 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOColorTokenInlineData = z.object({
4
- value: z.string().regex(/^#[a-f0-9]{6,8}$/),
5
- });
6
-
7
- export type DTOColorTokenInlineData = z.infer<typeof DTOColorTokenInlineData>;
@@ -1,3 +0,0 @@
1
- export * from "./color";
2
- export * from "./meta";
3
- export * from "./pagination";
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOObjectMeta = z.object({
4
- name: z.string().max(512),
5
- description: z.string().max(2048).optional(),
6
- });
7
-
8
- export type DTOObjectMeta = z.infer<typeof DTOObjectMeta>;
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOPagination = z.object({
4
- limit: z.string().optional(),
5
- offset: z.string().optional(),
6
- });
7
-
8
- export type DTOPagination = z.infer<typeof DTOPagination>;
@@ -1,20 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOBrand, DTODesignSystem, DTODesignSystemVersion } from "../design-systems";
3
- import { DTOUserWorkspaceMembership } from "../workspaces";
4
-
5
- export const DTOAppBootstrapDataQuery = z.object({
6
- preferredWorkspaceId: z.string().optional(),
7
- preferredDesignSystemId: z.string().optional(),
8
- preferredVersionId: z.string().optional(),
9
- preferredBrandId: z.string().optional(),
10
- });
11
-
12
- export const DTOAppBootstrapDataResponse = z.object({
13
- workspaceMembership: DTOUserWorkspaceMembership.optional(),
14
- designSystem: DTODesignSystem.optional(),
15
- version: DTODesignSystemVersion.optional(),
16
- brand: DTOBrand.optional(),
17
- });
18
-
19
- export type DTOAppBootstrapDataQuery = z.infer<typeof DTOAppBootstrapDataQuery>;
20
- export type DTOAppBootstrapDataResponse = z.infer<typeof DTOAppBootstrapDataResponse>;
@@ -1 +0,0 @@
1
- export * from "./app-bootstrap-data";
@@ -1 +0,0 @@
1
- export * from "./token-collection";
@@ -1,24 +0,0 @@
1
- import { CollectionOrigin, ColorTokenInlineData, ObjectMeta } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTOTokenCollection = z.object({
5
- id: z.string(),
6
- persistentId: z.string(),
7
- designSystemVersionId: z.string(),
8
-
9
- meta: ObjectMeta,
10
- backgroundColor: ColorTokenInlineData.optional(),
11
- elementPropertyOptionId: z.string(),
12
-
13
- createdAt: z.coerce.date(),
14
- updatedAt: z.coerce.date(),
15
-
16
- origin: CollectionOrigin.optional(),
17
- });
18
-
19
- export const DTOTokenCollectionsListReponse = z.object({
20
- collections: DTOTokenCollection.array(),
21
- });
22
-
23
- export type DTOTokenCollection = z.infer<typeof DTOTokenCollection>;
24
- export type DTOTokenCollectionsListReponse = z.infer<typeof DTOTokenCollectionsListReponse>;
@@ -1,44 +0,0 @@
1
- import { ObjectMeta } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOObjectMeta } from "../aux";
4
-
5
- //
6
- // Read
7
- //
8
-
9
- export const DTOBrand = z.object({
10
- id: z.string(),
11
- designSystemVersionId: z.string(),
12
- persistentId: z.string(),
13
- meta: ObjectMeta,
14
- });
15
-
16
- export const DTOBrandGetResponse = z.object({ brand: DTOBrand });
17
-
18
- export const DTOBrandCreateResponse = z.object({
19
- brand: DTOBrand,
20
- });
21
-
22
- export const DTOBrandsListResponse = z.object({ brands: z.array(DTOBrand) });
23
-
24
- export type DTOBrand = z.infer<typeof DTOBrand>;
25
- export type DTOBrandGetResponse = z.infer<typeof DTOBrandGetResponse>;
26
- export type DTOBrandCreateResponse = z.infer<typeof DTOBrandCreateResponse>;
27
- export type DTOBrandsListResponse = z.infer<typeof DTOBrandsListResponse>;
28
-
29
- //
30
- // Write
31
- //
32
-
33
- export const DTOBrandCreatePayload = z.object({
34
- persistentId: z.string().uuid(),
35
- meta: DTOObjectMeta,
36
- });
37
-
38
- export const DTOBrandUpdatePayload = z.object({
39
- meta: DTOObjectMeta.optional(),
40
- persistentId: z.string(),
41
- });
42
-
43
- export type DTOBrandCreatePayload = z.infer<typeof DTOBrandCreatePayload>;
44
- export type DTOBrandUpdatePayload = z.infer<typeof DTOBrandUpdatePayload>;
@@ -1,40 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOObjectMeta } from "../aux";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTODesignSystemComponent = z.object({
9
- id: z.string(),
10
- persistentId: z.string(),
11
- designSystemVersionId: z.string(),
12
- brandId: z.string(),
13
- meta: DTOObjectMeta,
14
- createdAt: z.coerce.date(),
15
- updatedAt: z.coerce.date(),
16
- });
17
-
18
- export const DTODesignSystemComponentResponse = z.object({
19
- designSystemComponent: DTODesignSystemComponent,
20
- });
21
-
22
- export const DTODesignSystemComponentListResponse = z.object({
23
- designSystemComponents: DTODesignSystemComponent.array(),
24
- });
25
-
26
- export type DTODesignSystemComponent = z.infer<typeof DTODesignSystemComponent>;
27
- export type DTODesignSystemComponentResponse = z.infer<typeof DTODesignSystemComponentResponse>;
28
- export type DTODesignSystemComponentListResponse = z.infer<typeof DTODesignSystemComponentListResponse>;
29
-
30
- //
31
- // Write
32
- //
33
-
34
- export const DTODesignSystemComponentCreateInput = z.object({
35
- brandId: z.string(), // Persistent ID,
36
- persistentId: z.string(),
37
- meta: DTOObjectMeta,
38
- });
39
-
40
- export type DTODesignSystemComponentCreateInput = z.infer<typeof DTODesignSystemComponentCreateInput>;
@@ -1,11 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOUser } from "../users";
3
-
4
- export const DTODesignSystemContactsResponse = z.object({
5
- contacts: z.object({
6
- workspace: z.array(DTOUser),
7
- designSystem: z.array(DTOUser),
8
- }),
9
- });
10
-
11
- export type DTODesignSystemContactsResponse = z.infer<typeof DTODesignSystemContactsResponse>;
@@ -1,141 +0,0 @@
1
- import {
2
- DataSourceAutoImportMode,
3
- DataSourceFigmaScope,
4
- DataSourceFigmaState,
5
- DataSourceRemoteType,
6
- DataSourceStats,
7
- DataSourceUploadImportMetadata,
8
- DataSourceUploadRemoteSource,
9
- SourceImportSummary,
10
- } from "@supernova-studio/model";
11
- import { z } from "zod";
12
-
13
- //
14
- // Read
15
- //
16
-
17
- export const DTODataSourceFigmaScope = DataSourceFigmaScope;
18
-
19
- const DTODataSourceFigmaFileVersion = z.object({
20
- id: z.string(),
21
- created_at: z.coerce.date(),
22
- label: z.string(),
23
- description: z.string(),
24
- });
25
-
26
- export const DTODataSourceFigmaCloud = z.object({
27
- fileId: z.string(),
28
- state: DataSourceFigmaState,
29
- autoImportMode: DataSourceAutoImportMode,
30
- fileThumbnailUrl: z.string().optional(),
31
- lastImportResult: SourceImportSummary.nullish(),
32
- lastImportedAt: z.coerce.date().nullish(),
33
- lastImportedVersion: DTODataSourceFigmaFileVersion.nullish(),
34
- lastUpdatesCheckedAt: z.date().nullish(),
35
- ownerId: z.string(),
36
- ownerUserName: z.string().optional(),
37
- preferredCredentialId: z.string().optional(),
38
- stats: DataSourceStats,
39
- });
40
-
41
- export const DTODataSourceFigma = z.object({
42
- id: z.string(),
43
- type: z.literal(DataSourceRemoteType.Enum.Figma),
44
- fileName: z.string(),
45
- scope: DTODataSourceFigmaScope,
46
- brandId: z.string(),
47
- themeId: z.string().nullish(),
48
- cloud: DTODataSourceFigmaCloud.nullish(),
49
- });
50
-
51
- // TS is not yet implemented in new BE
52
- export const DTODataSourceTokenStudio = z.object({
53
- id: z.string(),
54
- type: z.literal(DataSourceRemoteType.Enum.TokenStudio),
55
- fileName: z.string(),
56
- brandId: z.string(),
57
- themeId: z.string().nullish(),
58
- tokenStudio: z.object({
59
- settings: z.object({
60
- dryRun: z.boolean(),
61
- verbose: z.boolean(),
62
- preciseCopy: z.boolean(),
63
- }),
64
- connectionName: z.string(),
65
- lastImportedAt: z.coerce.date(),
66
- lastImportedResults: z.array(
67
- z.object({
68
- mapping: z.object({
69
- tokenSets: z.array(z.string()),
70
- supernovaBrand: z.string(),
71
- supernovaTheme: z.string().optional(),
72
- }),
73
- isFailed: z.boolean(),
74
- tokensCreated: z.number(),
75
- tokensDeleted: z.number(),
76
- tokensUpdated: z.number(),
77
- })
78
- ),
79
- }),
80
- });
81
-
82
- export const DTODataSourceFigmaVariablesPlugin = z.object({
83
- id: z.string(),
84
- type: z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),
85
- fileName: z.string(),
86
- brandId: z.string(),
87
- upload: z.object({
88
- remoteId: z.string(),
89
- remoteSourceType: DataSourceUploadRemoteSource,
90
- lastImportedAt: z.coerce.date().optional(),
91
- lastImportMetadata: DataSourceUploadImportMetadata.optional(),
92
- isTokenTypeSplitEnabled: z.boolean(),
93
- }),
94
- figmaVariablesPlugin: z.object({
95
- fileId: z.string(),
96
- lastImportedAt: z.coerce.date().optional(),
97
- lastImportMetadata: DataSourceUploadImportMetadata.optional(),
98
- isTokenTypeSplitEnabled: z.boolean(),
99
- isCollectionsMigrationCompleted: z.boolean().default(false),
100
- }),
101
- });
102
-
103
- export const DTODataSource = z.discriminatedUnion("type", [
104
- DTODataSourceFigma,
105
- DTODataSourceFigmaVariablesPlugin,
106
- DTODataSourceTokenStudio,
107
- ]);
108
-
109
- export const DTODataSourcesListResponse = z.object({
110
- sources: z.array(DTODataSource),
111
- });
112
-
113
- export const DTODataSourceResponse = z.object({
114
- source: DTODataSource,
115
- });
116
-
117
- export type DTODataSourceFigma = z.infer<typeof DTODataSourceFigma>;
118
- export type DTODataSourceTokenStudio = z.infer<typeof DTODataSourceTokenStudio>;
119
- export type DTODataSourceFigmaVariablesPlugin = z.infer<typeof DTODataSourceFigmaVariablesPlugin>;
120
- export type DTODataSource = z.infer<typeof DTODataSource>;
121
- export type DTODataSourceResponse = z.infer<typeof DTODataSourceResponse>;
122
- export type DTODataSourcesListResponse = z.infer<typeof DTODataSourcesListResponse>;
123
-
124
- //
125
- // Write
126
- //
127
-
128
- export const DTODataSourceFigmaCreatePayload = z.object({
129
- brandPersistentId: z.string(),
130
- figmaFileUrl: z.string(),
131
- scope: DTODataSourceFigmaScope,
132
- autoImportMode: DataSourceAutoImportMode,
133
- });
134
-
135
- export const DTODataSourceFigmaImportPayload = z.object({
136
- sourceIds: z.array(z.string()),
137
- });
138
-
139
- export type DTODataSourceFigmaScope = z.infer<typeof DTODataSourceFigmaScope>;
140
- export type DTODataSourceFigmaCreatePayload = z.infer<typeof DTODataSourceFigmaCreatePayload>;
141
- export type DTODataSourceFigmaImportPayload = z.infer<typeof DTODataSourceFigmaImportPayload>;
@@ -1,68 +0,0 @@
1
- import { DesignSystem, DesignSystemAccessMode, ObjectMeta, WorkspaceRoleSchema } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTODesignSystemMembersUpdatePayload } from "./members";
4
- import { DTODesignSystemRole } from "./role";
5
-
6
- //
7
- // Read
8
- //
9
-
10
- export const DTODesignSystem = DesignSystem.omit({
11
- name: true,
12
- description: true,
13
- docExporterId: true,
14
- }).extend({
15
- meta: ObjectMeta,
16
- docExporterId: z.string(),
17
- sources: z.array(z.any()),
18
- isPublic: z.literal(true),
19
-
20
- /**
21
- * Whether or not user who is requesting the design system
22
- * has access to the design system's contents.
23
- */
24
- isAvailableToUser: z.boolean(),
25
-
26
- /**
27
- * @deprecated
28
- */
29
- role: WorkspaceRoleSchema.optional(),
30
-
31
- /**
32
- * User's role within the design system that can come either from
33
- * the design system or workspace.
34
- */
35
- effectiveRole: DTODesignSystemRole.optional(),
36
- });
37
-
38
- export const DTODesignSystemResponse = z.object({
39
- designSystem: DTODesignSystem,
40
- });
41
-
42
- export const DTODesignSystemsListResponse = z.object({
43
- designSystems: DTODesignSystem.array(),
44
- });
45
-
46
- export type DTODesignSystem = z.infer<typeof DTODesignSystem>;
47
- export type DTODesignSystemResponse = z.infer<typeof DTODesignSystemResponse>;
48
- export type DTODesignSystemsListResponse = z.infer<typeof DTODesignSystemsListResponse>;
49
-
50
- //
51
- // Write
52
- //
53
-
54
- export const DTODesignSystemCreateInput = z.object({
55
- workspaceId: z.string(),
56
- meta: ObjectMeta.optional(),
57
- name: z.string().min(2).max(64).optional(),
58
- description: z.string().max(1024).optional(),
59
- accessMode: DesignSystemAccessMode.optional(),
60
-
61
- invites: DTODesignSystemMembersUpdatePayload.pick({
62
- usersToInvite: true,
63
- invitesToInvite: true,
64
- emailsToInvite: true,
65
- }).optional(),
66
- });
67
-
68
- export type DTODesignSystemCreateInput = z.infer<typeof DTODesignSystemCreateInput>;
@@ -1,14 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTODiffCountBase = z.object({
4
- created: z.number(),
5
- updated: z.number(),
6
- deleted: z.number(),
7
- });
8
-
9
- export const DTODesignElementsDataDiffResponse = z.object({
10
- tokens: DTODiffCountBase,
11
- assets: DTODiffCountBase,
12
- });
13
-
14
- export type DTODesignElementsDataDiffResponse = z.infer<typeof DTODesignElementsDataDiffResponse>;
@@ -1,108 +0,0 @@
1
- import { z } from "zod";
2
-
3
- const DimensionsVariableScopeSchema = z.enum([
4
- "CORNER_RADIUS",
5
- "WIDTH_HEIGHT",
6
- "GAP",
7
- "STROKE_FLOAT",
8
- "EFFECT_FLOAT",
9
- "OPACITY",
10
- "FONT_SIZE",
11
- "LINE_HEIGHT",
12
- "LETTER_SPACING",
13
- "PARAGRAPH_SPACING",
14
- "PARAGRAPH_INDENT",
15
- "FONT_WEIGHT",
16
- ]);
17
-
18
- const StringVariableScopeSchema = z.enum(["TEXT_CONTENT", "FONT_FAMILY", "FONT_STYLE"]);
19
-
20
- export type DimensionsVariableScopeType = z.infer<typeof DimensionsVariableScopeSchema>;
21
- export const DimensionsVariableScopeType = DimensionsVariableScopeSchema.enum;
22
-
23
- export type StringVariableScopeType = z.infer<typeof StringVariableScopeSchema>;
24
- export const StringVariableScopeType = StringVariableScopeSchema.enum;
25
-
26
- const VariableScope = z.string();
27
-
28
- const ReferencedVariableOrigin = z.object({
29
- name: z.string(),
30
- remote: z.boolean(),
31
- });
32
-
33
- export const RGB = z.object({
34
- r: z.number(),
35
- g: z.number(),
36
- b: z.number(),
37
- });
38
-
39
- export const RGBA = RGB.extend({
40
- a: z.number(),
41
- });
42
-
43
- export const VariableAlias = z.object({
44
- type: z.literal("VARIABLE_ALIAS"),
45
- id: z.string(),
46
- resolvedValue: z.boolean().or(z.number()).or(z.string()).or(RGBA).or(RGB).optional(),
47
- referenceOrigin: ReferencedVariableOrigin.optional().or(z.null()),
48
- });
49
-
50
- export const VariableValue = z.boolean().or(z.number()).or(z.string()).or(RGBA).or(RGB).or(VariableAlias);
51
- export const ResolvedVariableType = z.enum(["BOOLEAN", "FLOAT", "STRING", "COLOR"]);
52
-
53
- export const Variable = z.object({
54
- id: z.string(),
55
- name: z.string(),
56
- key: z.string(),
57
- variableCollectionId: z.string(),
58
- resolvedType: ResolvedVariableType,
59
- valuesByMode: z.record(VariableValue),
60
- remote: z.boolean(),
61
- description: z.string(),
62
- hiddenFromPublishing: z.boolean(),
63
- scopes: z.array(VariableScope),
64
- codeSyntax: z.record(z.any()).optional(),
65
- });
66
-
67
- export const VariableMode = z.object({
68
- modeId: z.string(),
69
- name: z.string(),
70
- });
71
-
72
- export const Collection = z.object({
73
- id: z.string(),
74
- name: z.string(),
75
- modes: z.array(VariableMode),
76
- defaultModeId: z.string(),
77
- remote: z.boolean(),
78
- hiddenFromPublishing: z.boolean(),
79
- });
80
-
81
- export const VariablesMapping = z.object({
82
- variableCollections: z.array(z.string()).min(1),
83
- variableMode: z.string().min(1),
84
- supernovaBrand: z.string().min(1),
85
- supernovaTheme: z.string().min(1).optional().or(z.null()),
86
- });
87
-
88
- export const FormattedCollections = z.object({
89
- variables: z.record(z.string(), Variable),
90
- variableCollections: z.record(z.string(), Collection),
91
- mappings: z.array(VariablesMapping).optional(),
92
- variablesOrder: z.string().array().optional(),
93
- });
94
-
95
- //
96
- // Types
97
- //
98
-
99
- export type RGB = z.infer<typeof RGB>;
100
- export type RGBA = z.infer<typeof RGBA>;
101
- export type ResolvedVariableType = z.infer<typeof ResolvedVariableType>;
102
- export type Variable = z.infer<typeof Variable>;
103
- export type VariableAlias = z.infer<typeof VariableAlias>;
104
- export type VariableValue = z.infer<typeof VariableValue>;
105
- export type VariableMode = z.infer<typeof VariableMode>;
106
- export type Collection = z.infer<typeof Collection>;
107
- export type VariablesMapping = z.infer<typeof VariablesMapping>;
108
- export type FormattedCollections = z.infer<typeof FormattedCollections>;
@@ -1,61 +0,0 @@
1
- import {
2
- DataSourceAutoImportMode,
3
- DataSourceFigmaScope,
4
- DataSourceRemoteType,
5
- ImportJobState,
6
- } from "@supernova-studio/model";
7
- import { z } from "zod";
8
-
9
- //
10
- // Read
11
- //
12
-
13
- export const DTOImportJob = z.object({
14
- id: z.string(),
15
- designSystemId: z.string(),
16
- designSystemVersionId: z.string(),
17
- operation: z.literal("Import"),
18
- createdAt: z.coerce.date(),
19
- stateChangedAt: z.coerce.date(),
20
- state: ImportJobState,
21
- sourceIds: z.string().array(),
22
- });
23
-
24
- export const DTOImportJobResponse = z.object({
25
- job: DTOImportJob,
26
- });
27
-
28
- export type DTOImportJob = z.infer<typeof DTOImportJob>;
29
- export type DTOImportJobResponse = z.infer<typeof DTOImportJobResponse>;
30
-
31
- //
32
- // Write
33
- //
34
-
35
- export const DTOBffFigmaImportRequestBody = z.object({
36
- type: z.literal(DataSourceRemoteType.Enum.Figma),
37
- brandPersistentId: z.string().optional(),
38
- fileId: z.string(),
39
- scope: DataSourceFigmaScope,
40
- autoImportMode: DataSourceAutoImportMode,
41
- });
42
-
43
- export const DTOBffUploadImportRequestBody = z.object({
44
- type: z
45
- .enum([DataSourceRemoteType.Enum.FigmaVariablesPlugin, "Upload"])
46
- .transform(v => DataSourceRemoteType.Enum.FigmaVariablesPlugin),
47
- brandPersistentId: z.string().optional(),
48
- sourceName: z.string().optional(),
49
- remoteId: z.string(),
50
- isTokenTypeSplitEnabled: z.boolean().optional(),
51
- payload: z.any(),
52
- });
53
-
54
- export const DTOBffImportRequestBody = z.discriminatedUnion("type", [
55
- DTOBffFigmaImportRequestBody,
56
- DTOBffUploadImportRequestBody,
57
- ]);
58
-
59
- export type DTOBffFigmaImportRequestBody = z.infer<typeof DTOBffFigmaImportRequestBody>;
60
- export type DTOBffUploadImportRequestBody = z.infer<typeof DTOBffUploadImportRequestBody>;
61
- export type DTOBffImportRequestBody = z.infer<typeof DTOBffImportRequestBody>;
@@ -1,13 +0,0 @@
1
- export * from "./brand";
2
- export * from "./component";
3
- export * from "./contact";
4
- export * from "./data-source";
5
- export * from "./design-system";
6
- export * from "./elements-diff";
7
- export * from "./figma-variables";
8
- export * from "./import-job";
9
- export * from "./members";
10
- export * from "./role";
11
- export * from "./stats";
12
- export * from "./version";
13
- export * from "./view";