@supernova-studio/client 0.48.6 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/index.d.mts +1166 -44199
  2. package/dist/index.mjs +4583 -9902
  3. package/dist/index.mjs.map +1 -1
  4. package/package.json +11 -30
  5. package/dist/index.d.ts +0 -44442
  6. package/dist/index.js +0 -11007
  7. package/dist/index.js.map +0 -1
  8. package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
  9. package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
  10. package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
  11. package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
  12. package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -132
  13. package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
  14. package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -72
  15. package/src/api/conversion/documentation/index.ts +0 -7
  16. package/src/api/conversion/export/index.ts +0 -1
  17. package/src/api/conversion/export/pipeline.ts +0 -24
  18. package/src/api/conversion/index.ts +0 -3
  19. package/src/api/conversion/integrations/git.ts +0 -37
  20. package/src/api/conversion/integrations/index.ts +0 -2
  21. package/src/api/conversion/integrations/integration.ts +0 -37
  22. package/src/api/dto/design-systems/brand.ts +0 -22
  23. package/src/api/dto/design-systems/data-source.ts +0 -122
  24. package/src/api/dto/design-systems/design-system.ts +0 -18
  25. package/src/api/dto/design-systems/elements-diff.ts +0 -14
  26. package/src/api/dto/design-systems/exporter-property.ts +0 -8
  27. package/src/api/dto/design-systems/index.ts +0 -7
  28. package/src/api/dto/design-systems/version.ts +0 -57
  29. package/src/api/dto/design-systems/view.ts +0 -45
  30. package/src/api/dto/documentation/anchor.ts +0 -15
  31. package/src/api/dto/documentation/block-definition.ts +0 -28
  32. package/src/api/dto/documentation/block.ts +0 -6
  33. package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
  34. package/src/api/dto/documentation/index.ts +0 -6
  35. package/src/api/dto/documentation/link-preview.ts +0 -23
  36. package/src/api/dto/documentation/publish.ts +0 -25
  37. package/src/api/dto/elements/documentation/draft-state.ts +0 -35
  38. package/src/api/dto/elements/documentation/group-action.ts +0 -108
  39. package/src/api/dto/elements/documentation/group-v1.ts +0 -35
  40. package/src/api/dto/elements/documentation/group-v2.ts +0 -109
  41. package/src/api/dto/elements/documentation/hierarchy.ts +0 -36
  42. package/src/api/dto/elements/documentation/index.ts +0 -11
  43. package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
  44. package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
  45. package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -108
  46. package/src/api/dto/elements/documentation/page-content.ts +0 -15
  47. package/src/api/dto/elements/documentation/page-v1.ts +0 -21
  48. package/src/api/dto/elements/documentation/page-v2.ts +0 -105
  49. package/src/api/dto/elements/elements-action-v2.ts +0 -114
  50. package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -55
  51. package/src/api/dto/elements/figma-nodes/index.ts +0 -2
  52. package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -24
  53. package/src/api/dto/elements/get-elements-v2.ts +0 -21
  54. package/src/api/dto/elements/index.ts +0 -5
  55. package/src/api/dto/elements/properties/index.ts +0 -3
  56. package/src/api/dto/elements/properties/property-definitions-actions-v2.ts +0 -53
  57. package/src/api/dto/elements/properties/property-definitions.ts +0 -62
  58. package/src/api/dto/elements/properties/property-values.ts +0 -17
  59. package/src/api/dto/export/exporter.ts +0 -73
  60. package/src/api/dto/export/index.ts +0 -3
  61. package/src/api/dto/export/job.ts +0 -75
  62. package/src/api/dto/export/pipeline.ts +0 -20
  63. package/src/api/dto/figma-components/assets/download.ts +0 -30
  64. package/src/api/dto/figma-components/assets/index.ts +0 -1
  65. package/src/api/dto/figma-components/index.ts +0 -1
  66. package/src/api/dto/index.ts +0 -8
  67. package/src/api/dto/liveblocks/auth-response.ts +0 -7
  68. package/src/api/dto/liveblocks/index.ts +0 -1
  69. package/src/api/dto/users/index.ts +0 -1
  70. package/src/api/dto/users/profile/index.ts +0 -1
  71. package/src/api/dto/users/profile/update.ts +0 -7
  72. package/src/api/dto/workspaces/git.ts +0 -32
  73. package/src/api/dto/workspaces/index.ts +0 -5
  74. package/src/api/dto/workspaces/integrations.ts +0 -34
  75. package/src/api/dto/workspaces/membership.ts +0 -29
  76. package/src/api/dto/workspaces/npm-registry.ts +0 -35
  77. package/src/api/dto/workspaces/workspace.ts +0 -16
  78. package/src/api/index.ts +0 -3
  79. package/src/api/payloads/design-systems/brand.ts +0 -11
  80. package/src/api/payloads/design-systems/index.ts +0 -2
  81. package/src/api/payloads/design-systems/version.ts +0 -29
  82. package/src/api/payloads/documentation/block-definitions.ts +0 -12
  83. package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
  84. package/src/api/payloads/documentation/index.ts +0 -2
  85. package/src/api/payloads/export/index.ts +0 -1
  86. package/src/api/payloads/export/pipeline.ts +0 -46
  87. package/src/api/payloads/index.ts +0 -6
  88. package/src/api/payloads/liveblocks/auth.ts +0 -7
  89. package/src/api/payloads/liveblocks/index.ts +0 -1
  90. package/src/api/payloads/users/index.ts +0 -2
  91. package/src/api/payloads/users/notifications/index.ts +0 -1
  92. package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
  93. package/src/api/payloads/users/profile/index.ts +0 -1
  94. package/src/api/payloads/users/profile/update.ts +0 -4
  95. package/src/api/payloads/workspaces/index.ts +0 -2
  96. package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
  97. package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
  98. package/src/index.ts +0 -3
  99. package/src/utils/hash.ts +0 -62
  100. package/src/utils/index.ts +0 -1
  101. package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -33
  102. package/src/yjs/design-system-content/index.ts +0 -2
  103. package/src/yjs/design-system-content/item-configuration.ts +0 -93
  104. package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -697
  105. package/src/yjs/docs-editor/index.ts +0 -7
  106. package/src/yjs/docs-editor/list-tree-builder.ts +0 -135
  107. package/src/yjs/docs-editor/mock.ts +0 -2447
  108. package/src/yjs/docs-editor/model/block.ts +0 -8
  109. package/src/yjs/docs-editor/model/index.ts +0 -2
  110. package/src/yjs/docs-editor/model/page.ts +0 -8
  111. package/src/yjs/docs-editor/prosemirror/index.ts +0 -2
  112. package/src/yjs/docs-editor/prosemirror/schema.ts +0 -657
  113. package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
  114. package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -900
  115. package/src/yjs/docs-editor/utils.ts +0 -115
  116. package/src/yjs/index.ts +0 -3
  117. package/src/yjs/version-room/backend.ts +0 -60
  118. package/src/yjs/version-room/base.ts +0 -185
  119. package/src/yjs/version-room/frontend.ts +0 -298
  120. package/src/yjs/version-room/index.ts +0 -4
  121. package/src/yjs/version-room/utils.ts +0 -6
@@ -1,53 +0,0 @@
1
- import { z } from "zod";
2
- import {
3
- DTOCreateElementPropertyDefinitionInputV2,
4
- DTODeleteElementPropertyDefinitionInputV2,
5
- DTOElementPropertyDefinition,
6
- DTOUpdateElementPropertyDefinitionInputV2,
7
- } from "./property-definitions";
8
-
9
- // Outputs
10
-
11
- const SuccessPayload = z.object({
12
- success: z.literal(true),
13
- });
14
-
15
- export const DTOPropertyDefinitionCreateActionOutputV2 = z.object({
16
- type: z.literal("PropertyDefinitionCreate"),
17
- definition: DTOElementPropertyDefinition,
18
- });
19
-
20
- export const DTOPropertyDefinitionUpdateActionOutputV2 = z.object({
21
- type: z.literal("PropertyDefinitionUpdate"),
22
- definition: DTOElementPropertyDefinition,
23
- });
24
-
25
- export const DTOPropertyDefinitionDeleteActionOutputV2 = z.object({
26
- type: z.literal("PropertyDefinitionDelete"),
27
- output: SuccessPayload,
28
- });
29
-
30
- export type DTOPropertyDefinitionCreateActionOutputV2 = z.infer<typeof DTOPropertyDefinitionCreateActionOutputV2>;
31
- export type DTOPropertyDefinitionUpdateActionOutputV2 = z.infer<typeof DTOPropertyDefinitionUpdateActionOutputV2>;
32
- export type DTOPropertyDefinitionDeleteActionOutputV2 = z.infer<typeof DTOPropertyDefinitionDeleteActionOutputV2>;
33
-
34
- // Inputs
35
-
36
- export const DTOPropertyDefinitionCreateActionInputV2 = z.object({
37
- type: z.literal("PropertyDefinitionCreate"),
38
- input: DTOCreateElementPropertyDefinitionInputV2,
39
- });
40
-
41
- export const DTOPropertyDefinitionUpdateActionInputV2 = z.object({
42
- type: z.literal("PropertyDefinitionUpdate"),
43
- input: DTOUpdateElementPropertyDefinitionInputV2,
44
- });
45
-
46
- export const DTOPropertyDefinitionDeleteActionInputV2 = z.object({
47
- type: z.literal("PropertyDefinitionDelete"),
48
- input: DTODeleteElementPropertyDefinitionInputV2,
49
- });
50
-
51
- export type DTOPropertyDefinitionCreateActionInputV2 = z.infer<typeof DTOPropertyDefinitionCreateActionInputV2>;
52
- export type DTOPropertyDefinitionUpdateActionInputV2 = z.infer<typeof DTOPropertyDefinitionUpdateActionInputV2>;
53
- export type DTOPropertyDefinitionDeleteActionInputV2 = z.infer<typeof DTOPropertyDefinitionDeleteActionInputV2>;
@@ -1,62 +0,0 @@
1
- import {
2
- ElementPropertyDefinitionOption,
3
- ElementPropertyLinkType,
4
- ElementPropertyTargetType,
5
- ElementPropertyTypeSchema,
6
- ObjectMeta,
7
- } from "@supernova-studio/model";
8
- import { z } from "zod";
9
-
10
- const CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
11
-
12
- // DTO Object
13
- export const DTOElementPropertyDefinition = z.object({
14
- id: z.string(),
15
- designSystemVersionId: z.string(),
16
- meta: ObjectMeta,
17
- persistentId: z.string(),
18
- type: ElementPropertyTypeSchema,
19
- targetElementType: ElementPropertyTargetType,
20
- codeName: z.string().regex(CODE_NAME_REGEX),
21
- options: z.array(ElementPropertyDefinitionOption).optional(),
22
- linkElementType: ElementPropertyLinkType.optional(),
23
- });
24
-
25
- export type DTOElementPropertyDefinition = z.infer<typeof DTOElementPropertyDefinition>;
26
-
27
- //
28
- // Read
29
- //
30
-
31
- export const DTOElementPropertyDefinitionsGetResponse = z.object({
32
- definitions: z.array(DTOElementPropertyDefinition),
33
- });
34
-
35
- export type DTOElementPropertyDefinitionsGetResponse = z.infer<typeof DTOElementPropertyDefinitionsGetResponse>;
36
-
37
- //
38
- // Write
39
- //
40
-
41
- export const DTOCreateElementPropertyDefinitionInputV2 = DTOElementPropertyDefinition.omit({
42
- id: true,
43
- designSystemVersionId: true,
44
- });
45
-
46
- export type DTOCreateElementPropertyDefinitionInputV2 = z.infer<typeof DTOCreateElementPropertyDefinitionInputV2>;
47
-
48
- export const DTOUpdateElementPropertyDefinitionInputV2 = z.object({
49
- id: z.string(),
50
- name: z.string().optional(),
51
- description: z.string().optional(),
52
- codeName: z.string().regex(CODE_NAME_REGEX).optional(),
53
- options: z.array(ElementPropertyDefinitionOption).optional(),
54
- });
55
-
56
- export type DTOUpdateElementPropertyDefinitionInputV2 = z.infer<typeof DTOUpdateElementPropertyDefinitionInputV2>;
57
-
58
- export const DTODeleteElementPropertyDefinitionInputV2 = z.object({
59
- id: z.string(),
60
- });
61
-
62
- export type DTODeleteElementPropertyDefinitionInputV2 = z.infer<typeof DTODeleteElementPropertyDefinitionInputV2>;
@@ -1,17 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOElementPropertyValue = z.object({
4
- id: z.string(),
5
- designSystemVersionId: z.string(),
6
- definitionId: z.string(),
7
- targetElementId: z.string(),
8
- value: z.union([z.string(), z.number(), z.boolean()]).optional(),
9
- valuePreview: z.string().optional(),
10
- });
11
-
12
- export const DTOElementPropertyValuesGetResponse = z.object({
13
- values: z.array(DTOElementPropertyValue),
14
- });
15
-
16
- export type DTOElementPropertyValue = z.infer<typeof DTOElementPropertyValue>;
17
- export type DTOElementPropertyValuesGetResponse = z.infer<typeof DTOElementPropertyValuesGetResponse>;
@@ -1,73 +0,0 @@
1
- import {
2
- PulsarContributionConfigurationProperty,
3
- PulsarContributionVariant,
4
- PulsarCustomBlock,
5
- } from "@supernova-studio/model";
6
- import { z } from "zod";
7
-
8
- //
9
- // Read
10
- //
11
-
12
- export const DTOExporterType = z.enum(["documentation", "code"]);
13
- export const DTOExporterSource = z.enum(["git", "upload"]);
14
- export const DTOExporterMembershipRole = z.enum(["Owner", "OwnerArchived", "User"]);
15
-
16
- export const DTOExporter = z.object({
17
- id: z.string(),
18
- name: z.string(),
19
- isPrivate: z.boolean(),
20
- exporterType: DTOExporterType,
21
- isDefaultDocumentationExporter: z.boolean(),
22
-
23
- iconURL: z.string().optional(),
24
- configurationProperties: PulsarContributionConfigurationProperty.array(),
25
- customBlocks: PulsarCustomBlock.array(),
26
- blockVariants: z.record(z.string(), PulsarContributionVariant.array()),
27
-
28
- usesBrands: z.boolean(),
29
- usesThemes: z.boolean(),
30
-
31
- source: DTOExporterSource,
32
-
33
- gitUrl: z.string().optional(),
34
- gitBranch: z.string().optional(),
35
- gitDirectory: z.string().optional(),
36
- });
37
-
38
- export const DTOExporterMembership = z.object({
39
- workspaceId: z.string(),
40
- exporterId: z.string(),
41
- role: DTOExporterMembershipRole,
42
- });
43
-
44
- export const DTOExporterCreateOutput = z.object({
45
- exporter: DTOExporter,
46
- membership: DTOExporterMembership,
47
- });
48
-
49
- export type DTOExporterType = z.infer<typeof DTOExporterType>;
50
- export type DTOExporterSource = z.infer<typeof DTOExporterSource>;
51
- export type DTOExporterMembershipRole = z.infer<typeof DTOExporterMembershipRole>;
52
- export type DTOExporter = z.infer<typeof DTOExporter>;
53
- export type DTOExporterMembership = z.infer<typeof DTOExporterMembership>;
54
- export type DTOExporterCreateOutput = z.infer<typeof DTOExporterCreateOutput>;
55
-
56
- //
57
- // Write
58
- //
59
-
60
- export const DTOExporterGitProviderEnum = z.enum(["github", "gitlab", "bitbucket", "azure"]);
61
-
62
- export const DTOExporterCreateInput = z.object({
63
- url: z.string(),
64
- provider: DTOExporterGitProviderEnum,
65
- });
66
-
67
- export const DTOExporterUpdateInput = z.object({
68
- url: z.string().optional(),
69
- });
70
-
71
- export type DTOExporterGitProviderEnum = z.infer<typeof DTOExporterGitProviderEnum>;
72
- export type DTOExporterCreateInput = z.infer<typeof DTOExporterCreateInput>;
73
- export type DTOExporterUpdateInput = z.infer<typeof DTOExporterUpdateInput>;
@@ -1,3 +0,0 @@
1
- export * from "./exporter";
2
- export * from "./job";
3
- export * from "./pipeline";
@@ -1,75 +0,0 @@
1
- import {
2
- ExportJobResult,
3
- ExportJobStatus,
4
- ExporterDestinationAzure,
5
- ExporterDestinationBitbucket,
6
- ExporterDestinationDocs,
7
- ExporterDestinationGithub,
8
- ExporterDestinationGitlab,
9
- ExporterDestinationS3,
10
- ObjectMeta,
11
- } from "@supernova-studio/model";
12
- import { z } from "zod";
13
-
14
- export const DTOExportJobCreatedBy = z.object({
15
- userId: z.string(),
16
- userName: z.string(),
17
- });
18
-
19
- export const DTOExportJobDesignSystemPreview = z.object({
20
- id: z.string(),
21
- meta: ObjectMeta,
22
- });
23
-
24
- export const DTOExportJobDesignSystemVersionPreview = z.object({
25
- id: z.string(),
26
- meta: ObjectMeta,
27
- version: z.string(),
28
- isReadonly: z.boolean(),
29
- });
30
-
31
- export const DTOExportJobDestinations = z.object({
32
- s3: ExporterDestinationS3.optional(),
33
- azure: ExporterDestinationAzure.optional(),
34
- bitbucket: ExporterDestinationBitbucket.optional(),
35
- github: ExporterDestinationGithub.optional(),
36
- gitlab: ExporterDestinationGitlab.optional(),
37
- documentation: ExporterDestinationDocs.optional(),
38
- webhookUrl: z.string().optional(),
39
- });
40
-
41
- export const DTOExportJob = z.object({
42
- id: z.string(),
43
-
44
- createdAt: z.coerce.date(),
45
- finishedAt: z.coerce.date().optional(),
46
-
47
- index: z.number().optional(),
48
- status: ExportJobStatus,
49
- estimatedExecutionTime: z.number().optional(),
50
-
51
- createdBy: DTOExportJobCreatedBy.optional(),
52
- designSystem: DTOExportJobDesignSystemPreview,
53
- designSystemVersion: DTOExportJobDesignSystemVersionPreview,
54
-
55
- destinations: DTOExportJobDestinations,
56
-
57
- exporterId: z.string(),
58
- scheduleId: z.string().optional(),
59
-
60
- result: ExportJobResult.optional(),
61
-
62
- brandPersistentId: z.string().optional(),
63
- themePersistentId: z.string().optional(),
64
- });
65
-
66
- export const DTOExportJobResponse = z.object({
67
- job: DTOExportJob,
68
- });
69
-
70
- export type DTOExportJobCreatedBy = z.infer<typeof DTOExportJobCreatedBy>;
71
- export type DTOExportJobDesignSystemPreview = z.infer<typeof DTOExportJobDesignSystemPreview>;
72
- export type DTOExportJobDesignSystemVersionPreview = z.infer<typeof DTOExportJobDesignSystemVersionPreview>;
73
- export type DTOExportJobDestinations = z.infer<typeof DTOExportJobDestinations>;
74
- export type DTOExportJob = z.infer<typeof DTOExportJob>;
75
- export type DTOExportJobResponse = z.infer<typeof DTOExportJobResponse>;
@@ -1,20 +0,0 @@
1
- import { ExportDestinationsMap, PipelineEventType } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOExportJob } from "./job";
4
-
5
- export const DTOPipeline = z.object({
6
- id: z.string(),
7
- name: z.string(),
8
- eventType: PipelineEventType,
9
- isEnabled: z.boolean(),
10
- workspaceId: z.string(),
11
- designSystemId: z.string(),
12
- exporterId: z.string(),
13
- brandPersistentId: z.string().optional(),
14
- themePersistentId: z.string().optional(),
15
- ...ExportDestinationsMap.shape,
16
-
17
- latestJobs: DTOExportJob.array(),
18
- });
19
-
20
- export type DTOPipeline = z.infer<typeof DTOPipeline>;
@@ -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,8 +0,0 @@
1
- export * from "./design-systems";
2
- export * from "./documentation";
3
- export * from "./elements";
4
- export * from "./export";
5
- export * from "./figma-components";
6
- export * from "./liveblocks";
7
- export * from "./users";
8
- 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 +0,0 @@
1
- export * from "./profile";
@@ -1 +0,0 @@
1
- export * from "./update";
@@ -1,7 +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
- export type DTOUserProfileUpdateResponse = z.infer<typeof DTOUserProfileUpdateResponse>;
@@ -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,5 +0,0 @@
1
- export * from "./git";
2
- export * from "./integrations";
3
- export * from "./membership";
4
- export * from "./npm-registry";
5
- 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,29 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOWorkspace } from "./workspace";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTOWorkspaceRole = z.enum(["Owner", "Admin", "Creator", "Viewer", "Billing"]);
9
-
10
- export const DTOUserWorkspaceMembership = z.object({
11
- // Workspace the user is a member of
12
- workspace: DTOWorkspace,
13
-
14
- // Assigned role the user has in the workspace
15
- role: DTOWorkspaceRole,
16
-
17
- // Role that determines actual permissions the user has in the workspace
18
- // E.g. this is different from the default role when editors are downgraded to viewers
19
- // when a workspace's subscription is downgraded to free tier
20
- effectiveRole: DTOWorkspaceRole,
21
- });
22
-
23
- export const DTOUserWorkspaceMembershipsResponse = z.object({
24
- membership: z.array(DTOUserWorkspaceMembership),
25
- });
26
-
27
- export type DTOWorkspaceRole = z.infer<typeof DTOWorkspaceRole>;
28
- export type DTOUserWorkspaceMembership = z.infer<typeof DTOUserWorkspaceMembership>;
29
- export type DTOUserWorkspaceMembershipsResponse = z.infer<typeof DTOUserWorkspaceMembershipsResponse>;
@@ -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>;
@@ -1,16 +0,0 @@
1
- import { Subscription, WorkspaceProfile } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTONpmRegistryConfig } from "./npm-registry";
4
-
5
- //
6
- // Read
7
- //
8
-
9
- export const DTOWorkspace = z.object({
10
- id: z.string(),
11
- profile: WorkspaceProfile,
12
- subscription: Subscription,
13
- npmRegistry: DTONpmRegistryConfig.optional(),
14
- });
15
-
16
- export type DTOWorkspace = z.infer<typeof DTOWorkspace>;
package/src/api/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./conversion";
2
- export * from "./dto";
3
- export * from "./payloads";
@@ -1,11 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOCreateBrandInput = z.object({
4
- persistentId: z.string().uuid(),
5
- meta: z.object({
6
- name: z.string(),
7
- description: z.string(),
8
- }),
9
- });
10
-
11
- export type DTOCreateBrandInput = z.infer<typeof DTOCreateBrandInput>;
@@ -1,2 +0,0 @@
1
- export * from "./brand";
2
- export * from "./version";
@@ -1,29 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const ObjectMeta = z.object({
4
- name: z.string().max(150).optional(),
5
- description: z.string().max(2000).optional(),
6
- });
7
-
8
- export function validateDesignSystemVersion(version: string) {
9
- const urlCompliantRegex = /^[a-zA-Z0-9+.-]+$/;
10
- return urlCompliantRegex.test(version);
11
- }
12
-
13
- export const DTOCreateVersionInput = z.object({
14
- meta: ObjectMeta,
15
- version: z.string().refine(validateDesignSystemVersion, {
16
- message: "Invalid semantic versioning format",
17
- }),
18
- changeLog: z.string().optional(),
19
- });
20
-
21
- export type DTOCreateVersionInput = z.infer<typeof DTOCreateVersionInput>;
22
-
23
- export const DTOUpdateVersionInput = z.object({
24
- meta: ObjectMeta,
25
- version: z.string(), // required for PUT, but not editable
26
- changeLog: z.string(),
27
- });
28
-
29
- export type DTOUpdateVersionInput = z.infer<typeof DTOUpdateVersionInput>;
@@ -1,12 +0,0 @@
1
- import { z } from "zod";
2
- import { DTOPageBlockDefinition } from "../../dto/documentation/block-definition";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTOGetBlockDefinitionsOutput = z.object({
9
- definitions: z.array(DTOPageBlockDefinition),
10
- });
11
-
12
- export type DTOGetBlockDefinitionsOutput = z.infer<typeof DTOGetBlockDefinitionsOutput>;
@@ -1,7 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTODocumentationPublishTypeQueryParams = z.object({
4
- environment: z.enum(["Live", "Preview"]),
5
- });
6
-
7
- export type DTODocumentationPublishTypeQueryParams = z.infer<typeof DTODocumentationPublishTypeQueryParams>;
@@ -1,2 +0,0 @@
1
- export * from "./block-definitions";
2
- export * from "./design-data-doc-diff";
@@ -1 +0,0 @@
1
- export * from "./pipeline";
@@ -1,46 +0,0 @@
1
- import {
2
- ExporterDestinationAzure,
3
- ExporterDestinationBitbucket,
4
- ExporterDestinationDocs,
5
- ExporterDestinationGithub,
6
- ExporterDestinationGitlab,
7
- ExporterDestinationS3,
8
- GitObjectsQuery,
9
- PipelineDestinationType,
10
- PipelineEventType,
11
- } from "@supernova-studio/model";
12
- import { z } from "zod";
13
-
14
- export const DTOPipelineCreateBody = z.object({
15
- name: z.string(),
16
- exporterId: z.string(),
17
- designSystemId: z.string(),
18
- isEnabled: z.boolean(),
19
- eventType: PipelineEventType,
20
- brandPersistentId: z.string().optional(),
21
- themePersistentId: z.string().optional(),
22
-
23
- destination: PipelineDestinationType.optional(),
24
- gitQuery: GitObjectsQuery,
25
- destinations: z.object({
26
- s3: ExporterDestinationS3.nullish(),
27
- azure: ExporterDestinationAzure.nullish(),
28
- bitbucket: ExporterDestinationBitbucket.nullish(),
29
- github: ExporterDestinationGithub.nullish(),
30
- gitlab: ExporterDestinationGitlab.nullish(),
31
- documentation: ExporterDestinationDocs.nullish(),
32
- webhookUrl: z.string().nullish(),
33
- }),
34
- });
35
-
36
- export const DTOPipelineUpdateBody = DTOPipelineCreateBody.extend({
37
- id: z.string(),
38
- });
39
-
40
- export const DTOPipelineTriggerBody = z.object({
41
- designSystemVersionId: z.string(),
42
- });
43
-
44
- export type DTOPipelineCreateBody = z.infer<typeof DTOPipelineCreateBody>;
45
- export type DTOPipelineUpdateBody = z.infer<typeof DTOPipelineUpdateBody>;
46
- export type DTOPipelineTriggerBody = z.infer<typeof DTOPipelineTriggerBody>;