@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.
- package/dist/index.d.mts +1363 -1321
- package/dist/index.d.ts +1363 -1321
- package/dist/index.js +536 -339
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +839 -642
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/api/client.ts +0 -31
- package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
- package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
- package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
- package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
- package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -131
- package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
- package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -72
- package/src/api/conversion/documentation/index.ts +0 -7
- package/src/api/conversion/export/index.ts +0 -1
- package/src/api/conversion/export/pipeline.ts +0 -25
- package/src/api/conversion/index.ts +0 -3
- package/src/api/conversion/integrations/git.ts +0 -37
- package/src/api/conversion/integrations/index.ts +0 -2
- package/src/api/conversion/integrations/integration.ts +0 -37
- package/src/api/dto/aux/color.ts +0 -7
- package/src/api/dto/aux/index.ts +0 -3
- package/src/api/dto/aux/meta.ts +0 -8
- package/src/api/dto/aux/pagination.ts +0 -8
- package/src/api/dto/bff/app-bootstrap-data.ts +0 -20
- package/src/api/dto/bff/index.ts +0 -1
- package/src/api/dto/collections/index.ts +0 -1
- package/src/api/dto/collections/token-collection.ts +0 -24
- package/src/api/dto/design-systems/brand.ts +0 -44
- package/src/api/dto/design-systems/component.ts +0 -40
- package/src/api/dto/design-systems/contact.ts +0 -11
- package/src/api/dto/design-systems/data-source.ts +0 -141
- package/src/api/dto/design-systems/design-system.ts +0 -68
- package/src/api/dto/design-systems/elements-diff.ts +0 -14
- package/src/api/dto/design-systems/figma-variables.ts +0 -108
- package/src/api/dto/design-systems/import-job.ts +0 -61
- package/src/api/dto/design-systems/index.ts +0 -13
- package/src/api/dto/design-systems/members.ts +0 -50
- package/src/api/dto/design-systems/role.ts +0 -11
- package/src/api/dto/design-systems/stats.ts +0 -19
- package/src/api/dto/design-systems/version.ts +0 -56
- package/src/api/dto/design-systems/view.ts +0 -45
- package/src/api/dto/design-tokens/design-token.ts +0 -78
- package/src/api/dto/design-tokens/index.ts +0 -1
- package/src/api/dto/documentation/anchor.ts +0 -15
- package/src/api/dto/documentation/approvals.ts +0 -15
- package/src/api/dto/documentation/block-definition.ts +0 -28
- package/src/api/dto/documentation/block.ts +0 -6
- package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
- package/src/api/dto/documentation/index.ts +0 -8
- package/src/api/dto/documentation/link-preview.ts +0 -23
- package/src/api/dto/documentation/publish.ts +0 -23
- package/src/api/dto/documentation/room.ts +0 -12
- package/src/api/dto/elements/components/figma-component-group.ts +0 -19
- package/src/api/dto/elements/components/figma-component.ts +0 -56
- package/src/api/dto/elements/components/index.ts +0 -2
- package/src/api/dto/elements/documentation/draft-state.ts +0 -37
- package/src/api/dto/elements/documentation/group-action.ts +0 -108
- package/src/api/dto/elements/documentation/group-v1.ts +0 -35
- package/src/api/dto/elements/documentation/group-v2.ts +0 -117
- package/src/api/dto/elements/documentation/hierarchy.ts +0 -22
- package/src/api/dto/elements/documentation/index.ts +0 -13
- package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
- package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
- package/src/api/dto/elements/documentation/metadata.ts +0 -8
- package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -121
- package/src/api/dto/elements/documentation/page-content.ts +0 -15
- package/src/api/dto/elements/documentation/page-v1.ts +0 -21
- package/src/api/dto/elements/documentation/page-v2.ts +0 -120
- package/src/api/dto/elements/documentation/structure.ts +0 -37
- package/src/api/dto/elements/elements-action-v2.ts +0 -104
- package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -106
- package/src/api/dto/elements/figma-nodes/index.ts +0 -2
- package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -24
- package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +0 -17
- package/src/api/dto/elements/frame-node-structures/index.ts +0 -1
- package/src/api/dto/elements/get-elements-v2.ts +0 -21
- package/src/api/dto/elements/index.ts +0 -7
- package/src/api/dto/elements/properties/index.ts +0 -2
- package/src/api/dto/elements/properties/property-definitions.ts +0 -75
- package/src/api/dto/elements/properties/property-values.ts +0 -38
- package/src/api/dto/export/exporter-property.ts +0 -95
- package/src/api/dto/export/exporter.ts +0 -87
- package/src/api/dto/export/filter.ts +0 -6
- package/src/api/dto/export/index.ts +0 -5
- package/src/api/dto/export/job.ts +0 -87
- package/src/api/dto/export/pipeline.ts +0 -43
- package/src/api/dto/figma-components/assets/download.ts +0 -30
- package/src/api/dto/figma-components/assets/index.ts +0 -1
- package/src/api/dto/figma-components/index.ts +0 -1
- package/src/api/dto/index.ts +0 -13
- package/src/api/dto/liveblocks/auth-response.ts +0 -7
- package/src/api/dto/liveblocks/index.ts +0 -1
- package/src/api/dto/themes/index.ts +0 -2
- package/src/api/dto/themes/override.ts +0 -27
- package/src/api/dto/themes/theme.ts +0 -45
- package/src/api/dto/users/authenticated-user.ts +0 -43
- package/src/api/dto/users/index.ts +0 -3
- package/src/api/dto/users/update.ts +0 -8
- package/src/api/dto/users/user.ts +0 -31
- package/src/api/dto/workspaces/git.ts +0 -32
- package/src/api/dto/workspaces/index.ts +0 -6
- package/src/api/dto/workspaces/integrations.ts +0 -34
- package/src/api/dto/workspaces/invitations.ts +0 -30
- package/src/api/dto/workspaces/membership.ts +0 -41
- package/src/api/dto/workspaces/npm-registry.ts +0 -35
- package/src/api/dto/workspaces/workspace.ts +0 -34
- package/src/api/endpoints/codegen/codegen.ts +0 -13
- package/src/api/endpoints/codegen/exporters.ts +0 -13
- package/src/api/endpoints/codegen/index.ts +0 -3
- package/src/api/endpoints/codegen/pipelines.ts +0 -37
- package/src/api/endpoints/design-system/bff.ts +0 -13
- package/src/api/endpoints/design-system/contact.ts +0 -12
- package/src/api/endpoints/design-system/design-systems.ts +0 -55
- package/src/api/endpoints/design-system/index.ts +0 -6
- package/src/api/endpoints/design-system/members.ts +0 -24
- package/src/api/endpoints/design-system/sources.ts +0 -35
- package/src/api/endpoints/design-system/versions/brands.ts +0 -45
- package/src/api/endpoints/design-system/versions/documentation.ts +0 -27
- package/src/api/endpoints/design-system/versions/ds-components.ts +0 -28
- package/src/api/endpoints/design-system/versions/elements-action.ts +0 -55
- package/src/api/endpoints/design-system/versions/elements.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-component-groups.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-components.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +0 -13
- package/src/api/endpoints/design-system/versions/import-jobs.ts +0 -13
- package/src/api/endpoints/design-system/versions/index.ts +0 -18
- package/src/api/endpoints/design-system/versions/overrides.ts +0 -17
- package/src/api/endpoints/design-system/versions/property-definitions.ts +0 -43
- package/src/api/endpoints/design-system/versions/property-values.ts +0 -25
- package/src/api/endpoints/design-system/versions/stats.ts +0 -12
- package/src/api/endpoints/design-system/versions/themes.ts +0 -35
- package/src/api/endpoints/design-system/versions/token-collections.ts +0 -13
- package/src/api/endpoints/design-system/versions/token-groups.ts +0 -28
- package/src/api/endpoints/design-system/versions/tokens.ts +0 -27
- package/src/api/endpoints/design-system/versions/versions.ts +0 -79
- package/src/api/endpoints/index.ts +0 -5
- package/src/api/endpoints/liveblocks.ts +0 -14
- package/src/api/endpoints/users.ts +0 -26
- package/src/api/endpoints/workspaces/index.ts +0 -3
- package/src/api/endpoints/workspaces/workspace-invites.ts +0 -34
- package/src/api/endpoints/workspaces/workspace-members.ts +0 -31
- package/src/api/endpoints/workspaces/workspaces.ts +0 -47
- package/src/api/index.ts +0 -6
- package/src/api/payloads/design-systems/index.ts +0 -2
- package/src/api/payloads/design-systems/update-design-system.ts +0 -29
- package/src/api/payloads/design-systems/version.ts +0 -29
- package/src/api/payloads/documentation/block-definitions.ts +0 -12
- package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
- package/src/api/payloads/documentation/index.ts +0 -2
- package/src/api/payloads/export/index.ts +0 -1
- package/src/api/payloads/export/pipeline.ts +0 -50
- package/src/api/payloads/index.ts +0 -6
- package/src/api/payloads/liveblocks/auth.ts +0 -7
- package/src/api/payloads/liveblocks/index.ts +0 -1
- package/src/api/payloads/users/index.ts +0 -2
- package/src/api/payloads/users/notifications/index.ts +0 -1
- package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
- package/src/api/payloads/users/profile/index.ts +0 -1
- package/src/api/payloads/users/profile/update.ts +0 -4
- package/src/api/payloads/workspaces/index.ts +0 -3
- package/src/api/payloads/workspaces/transfer-ownership.ts +0 -7
- package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
- package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
- package/src/api/transport/index.ts +0 -2
- package/src/api/transport/request-executor-error.ts +0 -66
- package/src/api/transport/request-executor.ts +0 -87
- package/src/index.ts +0 -3
- package/src/utils/figma.ts +0 -53
- package/src/utils/hash.ts +0 -62
- package/src/utils/index.ts +0 -3
- package/src/utils/query.ts +0 -18
- package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -35
- package/src/yjs/design-system-content/index.ts +0 -2
- package/src/yjs/design-system-content/item-configuration.ts +0 -93
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -764
- package/src/yjs/docs-editor/index.ts +0 -7
- package/src/yjs/docs-editor/list-tree-builder.ts +0 -127
- package/src/yjs/docs-editor/mock.ts +0 -2104
- package/src/yjs/docs-editor/model/block.ts +0 -8
- package/src/yjs/docs-editor/model/index.ts +0 -2
- package/src/yjs/docs-editor/model/page.ts +0 -8
- package/src/yjs/docs-editor/prosemirror/index.ts +0 -3
- package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +0 -145
- package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +0 -577
- package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -975
- package/src/yjs/docs-editor/utils.ts +0 -115
- package/src/yjs/index.ts +0 -3
- package/src/yjs/version-room/backend.ts +0 -78
- package/src/yjs/version-room/base.ts +0 -211
- package/src/yjs/version-room/frontend.ts +0 -461
- package/src/yjs/version-room/index.ts +0 -4
- 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,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
|
-
}
|
package/src/api/dto/aux/color.ts
DELETED
package/src/api/dto/aux/index.ts
DELETED
package/src/api/dto/aux/meta.ts
DELETED
|
@@ -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>;
|
package/src/api/dto/bff/index.ts
DELETED
|
@@ -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";
|