@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,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,22 +0,0 @@
1
- import { z } from "zod";
2
- import { ObjectMeta } from "@supernova-studio/model";
3
-
4
- export const DTOBrand = z.object({
5
- id: z.string(),
6
- designSystemVersionId: z.string(),
7
- persistentId: z.string(),
8
- meta: ObjectMeta,
9
- });
10
-
11
- export const DTOBrandGetResponse = z.object({ brand: DTOBrand });
12
-
13
- export const DTOBrandCreateResponse = z.object({
14
- brand: DTOBrand,
15
- });
16
-
17
- export const DTOBrandsListResponse = z.object({ brands: z.array(DTOBrand) });
18
-
19
- export type DTOBrand = z.infer<typeof DTOBrand>;
20
- export type DTOBrandGetResponse = z.infer<typeof DTOBrandGetResponse>;
21
- export type DTOBrandCreateResponse = z.infer<typeof DTOBrandCreateResponse>;
22
- export type DTOBrandsListResponse = z.infer<typeof DTOBrandsListResponse>;
@@ -1,122 +0,0 @@
1
- import { z } from "zod";
2
- import {
3
- DataSourceFigmaState,
4
- DataSourceRemoteType,
5
- DataSourceAutoImportMode,
6
- DataSourceStats,
7
- SourceImportSummary,
8
- DataSourceUploadRemoteSource,
9
- DataSourceUploadImportMetadata,
10
- DataSourceFigmaScope,
11
- } from "@supernova-studio/model";
12
-
13
- const DTODataSourceFigmaFileVersion = z.object({
14
- id: z.string(),
15
- created_at: z.coerce.date(),
16
- label: z.string(),
17
- description: z.string(),
18
- });
19
-
20
- export const DTODataSourceFigmaCloud = z.object({
21
- fileId: z.string(),
22
- state: DataSourceFigmaState,
23
- autoImportMode: DataSourceAutoImportMode,
24
- fileThumbnailUrl: z.string().optional(),
25
- lastImportResult: SourceImportSummary.nullish(),
26
- lastImportedAt: z.date().nullish(),
27
- lastImportedVersion: DTODataSourceFigmaFileVersion.nullish(),
28
- lastUpdatesCheckedAt: z.date().nullish(),
29
- ownerId: z.string(),
30
- ownerUserName: z.string().optional(),
31
- preferredCredentialId: z.string().optional(),
32
- stats: DataSourceStats,
33
- });
34
-
35
- export const DTODataSourceFigma = z.object({
36
- id: z.string(),
37
- type: z.literal(DataSourceRemoteType.Enum.Figma),
38
- fileName: z.string(),
39
- scope: DataSourceFigmaScope,
40
- brandId: z.string(),
41
- themeId: z.string().nullish(),
42
- cloud: DTODataSourceFigmaCloud.nullish(),
43
- tokenStudio: z.literal(null),
44
- upload: z.literal(null),
45
- figmaVariablesPlugin: z.literal(null),
46
- });
47
-
48
- // TS is not yet implemented in new BE
49
- export const DTODataSourceTokenStudio = z.object({
50
- id: z.string(),
51
- type: z.literal(DataSourceRemoteType.Enum.TokenStudio),
52
- fileName: z.string(),
53
- brandId: z.string(),
54
- themeId: z.string().nullish(),
55
- cloud: z.literal(null),
56
- tokenStudio: z.object({
57
- settings: z.object({
58
- dryRun: z.boolean(),
59
- verbose: z.boolean(),
60
- preciseCopy: z.boolean(),
61
- }),
62
- connectionName: z.string(),
63
- lastImportedAt: z.date(),
64
- lastImportedResults: z.array(
65
- z.object({
66
- mapping: z.object({
67
- tokenSets: z.array(z.string()),
68
- supernovaBrand: z.string(),
69
- supernovaTheme: z.string().optional(),
70
- }),
71
- isFailed: z.boolean(),
72
- tokensCreated: z.number(),
73
- tokensDeleted: z.number(),
74
- tokensUpdated: z.number(),
75
- })
76
- ),
77
- }),
78
- upload: z.literal(null),
79
- figmaVariablesPlugin: z.literal(null),
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
- themeId: z.literal(null),
88
- cloud: z.literal(null),
89
- tokenStudio: z.literal(null),
90
- upload: z.object({
91
- remoteId: z.string(),
92
- remoteSourceType: DataSourceUploadRemoteSource,
93
- lastImportedAt: z.date().optional(),
94
- lastImportMetadata: DataSourceUploadImportMetadata.optional(),
95
- }),
96
- figmaVariablesPlugin: z.object({
97
- fileId: z.string(),
98
- lastImportedAt: z.date().optional(),
99
- lastImportMetadata: DataSourceUploadImportMetadata.optional(),
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 DTODataSourceCreationResponse = 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 DTODataSourceCreationResponse = z.infer<typeof DTODataSourceCreationResponse>;
122
- export type DTODataSourcesListResponse = z.infer<typeof DTODataSourcesListResponse>;
@@ -1,18 +0,0 @@
1
- import { DesignSystem, ObjectMeta } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTODesignSystem = DesignSystem.omit({
9
- name: true,
10
- description: true,
11
- docExporterId: true,
12
- }).extend({
13
- meta: ObjectMeta,
14
- docExporterId: z.string(),
15
- sources: z.array(z.any()),
16
- });
17
-
18
- export type DTODesignSystem = z.infer<typeof DTODesignSystem>;
@@ -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,8 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const DTOExporterProperty = z.any({});
4
-
5
- export const DTOExporterPropertyListResponse = z.object({ items: z.array(DTOExporterProperty) });
6
-
7
- export type DTOExporterProperty = z.infer<typeof DTOExporterProperty>;
8
- export type DTOExporterPropertyListResponse = z.infer<typeof DTOExporterPropertyListResponse>;
@@ -1,7 +0,0 @@
1
- export * from "./brand";
2
- export * from "./data-source";
3
- export * from "./design-system";
4
- export * from "./elements-diff";
5
- export * from "./exporter-property";
6
- export * from "./version";
7
- export * from "./view";
@@ -1,57 +0,0 @@
1
- import { z } from "zod";
2
- import { ObjectMeta, VersionCreationJob, OmitStrict } from "@supernova-studio/model";
3
- import { DTOCreateVersionInput } from "../../payloads";
4
-
5
- export const DTODesignSystemVersion = z.object({
6
- id: z.string(),
7
- createdAt: z.date(),
8
- meta: ObjectMeta,
9
- version: z.string(),
10
- isReadonly: z.boolean(),
11
- changeLog: z.string(),
12
- designSystemId: z.string(),
13
- });
14
-
15
- export const DTODesignSystemVersionsListResponse = z.object({
16
- designSystemVersions: z.array(DTODesignSystemVersion),
17
- });
18
-
19
- export const DTODesignSystemVersionGetResponse = z.object({
20
- designSystemVersion: DTODesignSystemVersion,
21
- });
22
-
23
- export const DTODesignSystemVersionCreationResponse = z.object({
24
- meta: ObjectMeta,
25
- version: z.string(),
26
- changeLog: z.string(),
27
- isReadOnly: z.boolean(),
28
- designSystemId: z.string(),
29
- jobId: z.string(),
30
- })
31
-
32
- export const VersionSQSPayload = z.object({
33
- jobId: z.string(),
34
- designSystemId: z.string(),
35
- input: DTOCreateVersionInput,
36
- });
37
-
38
- export type VersionSQSPayload = z.infer<typeof VersionSQSPayload>;
39
-
40
- export type DTODesignSystemVersionCreationResponse = z.infer<typeof DTODesignSystemVersionCreationResponse>;
41
- export type DTODesignSystemVersion = z.infer<typeof DTODesignSystemVersion>;
42
- export type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystemVersionsListResponse>;
43
- export type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;
44
-
45
-
46
- export const DTODesignSystemVersionJobsResponse = z.object({
47
- jobs: z.array(VersionCreationJob)
48
- })
49
-
50
- export type DTODesignSystemVersionJobsResponse = z.infer<typeof DTODesignSystemVersionJobsResponse>;
51
-
52
- // Creation job status response
53
- export const DTODesignSystemVersionJobStatusResponse = z.object({
54
- job: VersionCreationJob
55
- });
56
-
57
- export type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;
@@ -1,45 +0,0 @@
1
- import { z } from "zod";
2
- import { ElementPropertyTargetType, ElementViewBaseColumnType, ObjectMeta } from "@supernova-studio/model";
3
-
4
- export const DTOElementViewColumnSharedAttributes = z.object({
5
- id: z.string(),
6
- persistentId: z.string(),
7
- width: z.number(),
8
- });
9
-
10
- export const DTOElementViewBasePropertyColumn = DTOElementViewColumnSharedAttributes.extend({
11
- type: z.literal("BaseProperty"),
12
- basePropertyType: ElementViewBaseColumnType,
13
- });
14
-
15
- export const DTOElementViewPropertyDefinitionColumn = DTOElementViewColumnSharedAttributes.extend({
16
- type: z.literal("PropertyDefinition"),
17
- propertyDefinitionId: z.string(),
18
- });
19
-
20
- export const DTOElementViewThemeColumn = DTOElementViewColumnSharedAttributes.extend({
21
- type: z.literal("Theme"),
22
- themeId: z.string(),
23
- });
24
-
25
- export const DTOElementViewColumn = z.discriminatedUnion("type", [
26
- DTOElementViewBasePropertyColumn,
27
- DTOElementViewPropertyDefinitionColumn,
28
- DTOElementViewThemeColumn,
29
- ]);
30
-
31
- export const DTOElementView = z.object({
32
- meta: ObjectMeta,
33
- persistentId: z.string(),
34
- targetElementType: ElementPropertyTargetType,
35
- id: z.string(),
36
- isDefault: z.boolean(),
37
- columns: z.array(DTOElementViewColumn),
38
- });
39
-
40
- export const DTOElementViewsListResponse = z.object({
41
- elementDataViews: z.array(DTOElementView),
42
- });
43
-
44
- export type DTOElementView = z.infer<typeof DTOElementView>;
45
- export type DTOElementViewsListResponse = z.infer<typeof DTOElementViewsListResponse>;
@@ -1,15 +0,0 @@
1
- import { DocumentationPageAnchor } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTODocumentationPageAnchor = DocumentationPageAnchor;
9
-
10
- export const DTOGetDocumentationPageAnchorsResponse = z.object({
11
- anchors: z.array(DTODocumentationPageAnchor),
12
- });
13
-
14
- export type DTODocumentationPageAnchor = z.infer<typeof DTODocumentationPageAnchor>;
15
- export type DTOGetDocumentationPageAnchorsResponse = z.infer<typeof DTOGetDocumentationPageAnchorsResponse>;
@@ -1,28 +0,0 @@
1
- import {
2
- PageBlockColorV2,
3
- PageBlockDefinition,
4
- PageBlockDefinitionBehavior,
5
- PageBlockDefinitionItem,
6
- PageBlockDefinitionLayout,
7
- PageBlockDefinitionProperty,
8
- PageBlockDefinitionVariant,
9
- } from "@supernova-studio/model";
10
- import { z } from "zod";
11
-
12
- export const DTOPageBlockDefinitionBehavior = PageBlockDefinitionBehavior;
13
- export const DTOPageBlockDefinitionItem = PageBlockDefinitionItem;
14
- export const DTOPageBlockDefinitionLayout = PageBlockDefinitionLayout;
15
- export const DTOPageBlockDefinitionVariant = PageBlockDefinitionVariant;
16
- export const DTOPageBlockDefinitionProperty = PageBlockDefinitionProperty;
17
- export const DTOPageBlockColorV2 = PageBlockColorV2;
18
-
19
- export const DTOPageBlockDefinition = PageBlockDefinition;
20
-
21
- export type DTOPageBlockDefinitionBehavior = z.infer<typeof DTOPageBlockDefinitionBehavior>;
22
- export type DTOPageBlockDefinitionItem = z.infer<typeof DTOPageBlockDefinitionItem>;
23
- export type DTOPageBlockDefinitionLayout = z.infer<typeof DTOPageBlockDefinitionLayout>;
24
- export type DTOPageBlockDefinitionVariant = z.infer<typeof DTOPageBlockDefinitionVariant>;
25
- export type DTOPageBlockDefinitionProperty = z.infer<typeof DTOPageBlockDefinitionProperty>;
26
- export type DTOPageBlockColorV2 = z.infer<typeof DTOPageBlockColorV2>;
27
-
28
- export type DTOPageBlockDefinition = z.infer<typeof DTOPageBlockDefinition>;
@@ -1,6 +0,0 @@
1
- import { PageBlockItemV2 } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- export const DTOPageBlockItemV2 = PageBlockItemV2;
5
-
6
- export type DTOPageBlockItemV2 = z.infer<typeof DTOPageBlockItemV2>;
@@ -1,18 +0,0 @@
1
- import { DesignElementSnapshotReason } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTODocumentationPageV2 } from "../elements/documentation/page-v2";
4
-
5
- export const DTODocumentationPageSnapshot = z.object({
6
- id: z.string(),
7
- designSystemVersionId: z.string(),
8
-
9
- createdAt: z.string(),
10
- updatedAt: z.string(),
11
-
12
- documentationPage: DTODocumentationPageV2,
13
- pageContentHash: z.string(),
14
-
15
- reason: DesignElementSnapshotReason,
16
- });
17
-
18
- export type DTODocumentationPageSnapshot = z.infer<typeof DTODocumentationPageSnapshot>;
@@ -1,6 +0,0 @@
1
- export * from "./anchor";
2
- export * from "./block-definition";
3
- export * from "./block";
4
- export * from "./documentation-page-snapshot";
5
- export * from "./link-preview";
6
- export * from "./publish";
@@ -1,23 +0,0 @@
1
- import { DocumentationLinkPreview } from "@supernova-studio/model";
2
- import { z } from "zod";
3
-
4
- //
5
- // Read
6
- //
7
-
8
- export const DTODocumentationLinkPreviewResponse = z.object({
9
- linkPreview: DocumentationLinkPreview,
10
- });
11
-
12
- export type DTODocumentationLinkPreviewResponse = z.infer<typeof DTODocumentationLinkPreviewResponse>;
13
-
14
- //
15
- // Write
16
- //
17
-
18
- export const DTODocumentationLinkPreviewRequest = z.object({
19
- url: z.string().optional(),
20
- documentationItemPersistentId: z.string().optional(),
21
- });
22
-
23
- export type DTODocumentationLinkPreviewRequest = z.infer<typeof DTODocumentationLinkPreviewRequest>;
@@ -1,25 +0,0 @@
1
- import { PublishedDocEnvironment } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTOExportJob } from "../export";
4
-
5
- export const DTOPublishDocumentationRequest = z.object({
6
- environment: PublishedDocEnvironment,
7
-
8
- /**
9
- * If defined, this allows narrowing down what is published to a set of specific pages and groups
10
- * If undefined, everything will be published.
11
- */
12
- changes: z
13
- .object({
14
- pagePersistentIds: z.string().array(),
15
- groupPersistentIds: z.string().array(),
16
- })
17
- .optional(),
18
- });
19
-
20
- export const DTOPublishDocumentationResponse = z.object({
21
- job: DTOExportJob,
22
- });
23
-
24
- export type DTOPublishDocumentationRequest = z.infer<typeof DTOPublishDocumentationRequest>;
25
- export type DTOPublishDocumentationResponse = z.infer<typeof DTOPublishDocumentationResponse>;
@@ -1,35 +0,0 @@
1
- import { z } from "zod";
2
- import { DTODocumentationItemConfigurationV2 } from "./item-configuration-v2";
3
-
4
- export const DTODocumentationDraftChangeType = z.enum(["Created", "Updated", "Deleted"]);
5
-
6
- export const DTODocumentationDraftStateCreated = z.object({
7
- changeType: z.literal(DTODocumentationDraftChangeType.enum.Created),
8
- });
9
-
10
- export const DTODocumentationDraftStateUpdated = z.object({
11
- changeType: z.literal(DTODocumentationDraftChangeType.enum.Updated),
12
- changes: z.object({
13
- previousTitle: z.string().optional(),
14
- previousConfiguration: DTODocumentationItemConfigurationV2.optional(),
15
- previousContentHash: z.string().optional(),
16
- }),
17
- });
18
-
19
- export const DTODocumentationDraftStateDeleted = z.object({
20
- changeType: z.literal(DTODocumentationDraftChangeType.enum.Deleted),
21
- });
22
-
23
- export const DTODocumentationDraftState = z.discriminatedUnion("changeType", [
24
- DTODocumentationDraftStateCreated,
25
- DTODocumentationDraftStateUpdated,
26
- DTODocumentationDraftStateDeleted,
27
- ]);
28
-
29
- export type DTODocumentationDraftChangeType = z.infer<typeof DTODocumentationDraftChangeType>;
30
-
31
- export type DTODocumentationDraftStateCreated = z.infer<typeof DTODocumentationDraftStateCreated>;
32
- export type DTODocumentationDraftStateUpdated = z.infer<typeof DTODocumentationDraftStateUpdated>;
33
- export type DTODocumentationDraftStateDeleted = z.infer<typeof DTODocumentationDraftStateDeleted>;
34
-
35
- export type DTODocumentationDraftState = z.infer<typeof DTODocumentationDraftState>;
@@ -1,108 +0,0 @@
1
- import { z } from "zod";
2
- import {
3
- DTOCreateDocumentationGroupInput,
4
- DTOCreateDocumentationTabInput,
5
- DTODeleteDocumentationGroupInput,
6
- DTODeleteDocumentationTabGroupInput,
7
- DTODuplicateDocumentationGroupInput,
8
- DTOMoveDocumentationGroupInput,
9
- DTOUpdateDocumentationGroupInput,
10
- } from "./group-v2";
11
-
12
- //
13
- // Read
14
- //
15
-
16
- const SuccessPayload = z.object({
17
- success: z.literal(true),
18
- });
19
-
20
- export const DTODocumentationGroupCreateActionOutputV2 = z.object({
21
- type: z.literal("DocumentationGroupCreate"),
22
- output: SuccessPayload,
23
- });
24
-
25
- export const DTODocumentationTabCreateActionOutputV2 = z.object({
26
- type: z.literal("DocumentationTabCreate"),
27
- output: SuccessPayload,
28
- });
29
-
30
- export const DTODocumentationGroupUpdateActionOutputV2 = z.object({
31
- type: z.literal("DocumentationGroupUpdate"),
32
- output: SuccessPayload,
33
- });
34
-
35
- export const DTODocumentationGroupMoveActionOutputV2 = z.object({
36
- type: z.literal("DocumentationGroupMove"),
37
- output: SuccessPayload,
38
- });
39
-
40
- export const DTODocumentationGroupDuplicateActionOutputV2 = z.object({
41
- type: z.literal("DocumentationGroupDuplicate"),
42
- output: SuccessPayload,
43
- });
44
-
45
- export const DTODocumentationGroupDeleteActionOutputV2 = z.object({
46
- type: z.literal("DocumentationGroupDelete"),
47
- output: SuccessPayload,
48
- });
49
-
50
- export const DTODocumentationTabGroupDeleteActionOutputV2 = z.object({
51
- type: z.literal("DocumentationTabGroupDelete"),
52
- output: SuccessPayload,
53
- });
54
-
55
- export type DTODocumentationGroupCreateActionOutputV2 = z.infer<typeof DTODocumentationGroupCreateActionOutputV2>;
56
- export type DTODocumentationTabCreateActionOutputV2 = z.infer<typeof DTODocumentationTabCreateActionOutputV2>;
57
- export type DTODocumentationGroupUpdateActionOutputV2 = z.infer<typeof DTODocumentationGroupUpdateActionOutputV2>;
58
- export type DTODocumentationGroupMoveActionOutputV2 = z.infer<typeof DTODocumentationGroupMoveActionOutputV2>;
59
- export type DTODocumentationGroupDuplicateActionOutputV2 = z.infer<typeof DTODocumentationGroupDuplicateActionOutputV2>;
60
- export type DTODocumentationGroupDeleteActionOutputV2 = z.infer<typeof DTODocumentationGroupDeleteActionOutputV2>;
61
- export type DTODocumentationTabGroupDeleteActionOutputV2 = z.infer<typeof DTODocumentationTabGroupDeleteActionOutputV2>;
62
-
63
- //
64
- // Write
65
- //
66
-
67
- export const DTODocumentationGroupCreateActionInputV2 = z.object({
68
- type: z.literal("DocumentationGroupCreate"),
69
- input: DTOCreateDocumentationGroupInput,
70
- });
71
-
72
- export const DTODocumentationTabCreateActionInputV2 = z.object({
73
- type: z.literal("DocumentationTabCreate"),
74
- input: DTOCreateDocumentationTabInput,
75
- });
76
-
77
- export const DTODocumentationGroupUpdateActionInputV2 = z.object({
78
- type: z.literal("DocumentationGroupUpdate"),
79
- input: DTOUpdateDocumentationGroupInput,
80
- });
81
-
82
- export const DTODocumentationGroupMoveActionInputV2 = z.object({
83
- type: z.literal("DocumentationGroupMove"),
84
- input: DTOMoveDocumentationGroupInput,
85
- });
86
-
87
- export const DTODocumentationGroupDuplicateActionInputV2 = z.object({
88
- type: z.literal("DocumentationGroupDuplicate"),
89
- input: DTODuplicateDocumentationGroupInput,
90
- });
91
-
92
- export const DTODocumentationGroupDeleteActionInputV2 = z.object({
93
- type: z.literal("DocumentationGroupDelete"),
94
- input: DTODeleteDocumentationGroupInput,
95
- });
96
-
97
- export const DTODocumentationTabGroupDeleteActionInputV2 = z.object({
98
- type: z.literal("DocumentationTabGroupDelete"),
99
- input: DTODeleteDocumentationTabGroupInput,
100
- });
101
-
102
- export type DTODocumentationGroupCreateActionInputV2 = z.infer<typeof DTODocumentationGroupCreateActionInputV2>;
103
- export type DTODocumentationTabGroupCreateActionInputV2 = z.infer<typeof DTODocumentationTabCreateActionInputV2>;
104
- export type DTODocumentationGroupUpdateActionInputV2 = z.infer<typeof DTODocumentationGroupUpdateActionInputV2>;
105
- export type DTODocumentationGroupMoveActionInputV2 = z.infer<typeof DTODocumentationGroupMoveActionInputV2>;
106
- export type DTODocumentationGroupDuplicateActionInputV2 = z.infer<typeof DTODocumentationGroupDuplicateActionInputV2>;
107
- export type DTODocumentationGroupDeleteActionInputV2 = z.infer<typeof DTODocumentationGroupDeleteActionInputV2>;
108
- export type DTODocumentationTabGroupDeleteActionInputV2 = z.infer<typeof DTODocumentationTabGroupDeleteActionInputV2>;
@@ -1,35 +0,0 @@
1
- import { DocumentationGroupBehavior, ElementGroup } from "@supernova-studio/model";
2
- import { z } from "zod";
3
- import { DTODocumentationItemConfigurationV1 } from "./item-configuration-v1";
4
-
5
- //
6
- // Read
7
- //
8
-
9
- /**
10
- * Structure DTO is element properties minus element data (in other words data required
11
- * to display the element in the left panel)
12
- */
13
- export const DTODocumentationGroupStructureV1 = ElementGroup.omit({
14
- sortOrder: true,
15
- parentPersistentId: true,
16
- brandPersistentId: true,
17
- meta: true,
18
- childType: true,
19
- data: true,
20
- shortPersistentId: true,
21
- }).extend({
22
- title: z.string(),
23
- isRoot: z.boolean(),
24
- childrenIds: z.array(z.string()),
25
- groupBehavior: DocumentationGroupBehavior,
26
- shortPersistentId: z.string(),
27
- type: z.literal("Group"),
28
- });
29
-
30
- export const DTODocumentationGroupV1 = DTODocumentationGroupStructureV1.extend({
31
- configuration: DTODocumentationItemConfigurationV1,
32
- });
33
-
34
- export type DTODocumentationGroupStructureV1 = z.infer<typeof DTODocumentationGroupStructureV1>;
35
- export type DTODocumentationGroupV1 = z.infer<typeof DTODocumentationGroupV1>;